-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathforge.config.ts
More file actions
89 lines (84 loc) · 3.01 KB
/
forge.config.ts
File metadata and controls
89 lines (84 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import type { ForgeConfig } from '@electron-forge/shared-types'
import { MakerSquirrel } from '@electron-forge/maker-squirrel'
import { MakerZIP } from '@electron-forge/maker-zip'
import { MakerDeb } from '@electron-forge/maker-deb'
import { MakerRpm } from '@electron-forge/maker-rpm'
import { MakerDMG } from '@electron-forge/maker-dmg'
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives'
import { WebpackPlugin } from '@electron-forge/plugin-webpack'
import path from 'path'
import { mainConfig } from './packages/databyss-desktop/webpack.main.config'
import { rendererConfig } from './packages/databyss-desktop/webpack.renderer.config'
// load env from .env.production.local
require('dotenv').config({
path: path.resolve('./.env.production.local'),
})
const appleApiKey = path.resolve('./private_keys/appleApiKey.p8')
const appleApiKeyId = process.env.APPLE_API_KEY_ID!
const appleApiIssuer = process.env.APPLE_API_ISSUER!
console.log('[forge.config] appleApiKey', appleApiKey)
console.log('[forge.config] appleApiKeyId', appleApiKeyId)
console.log('[forge.config] appleApiIssuer', appleApiIssuer)
const config: ForgeConfig = {
packagerConfig: {
osxNotarize: {
appleApiKey,
appleApiKeyId,
appleApiIssuer,
},
osxSign: {},
appBundleId: 'org.databyss.databyss-app',
asar: {
unpack: '*.{node,dll}',
},
name: 'Databyss',
icon: 'public/appIcon',
protocols: [
{
name: 'databyss',
schemes: ['databyss'],
},
],
},
rebuildConfig: {},
makers: [
new MakerSquirrel({}),
// new MakerZIP({}, ['darwin']),
new MakerDMG({
icon: 'public/appIcon.icns',
overwrite: true,
}),
new MakerRpm({}),
new MakerDeb({}),
],
plugins: [
new AutoUnpackNativesPlugin({}),
new WebpackPlugin({
mainConfig,
devContentSecurityPolicy: `default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: dbdrive: data: gap:; connect-src self * 'unsafe-inline' blob: dbdrive: data: gap:; frame-src * self blob: data: gap:; style-src-elem * self 'unsafe-inline'`,
renderer: {
// config: rendererConfig('production') as WebpackConfiguration,
config: rendererConfig,
entryPoints: [
{
html: './packages/databyss-desktop/src/index.html',
js: './packages/databyss-desktop/src/renderer.tsx',
name: 'main_window',
preload: {
js: './packages/databyss-desktop/src/preload.ts',
},
},
{
html: './packages/databyss-desktop/pdfview/index.html',
js: './packages/databyss-desktop/pdfview/main.js',
name: 'pdfview_window',
preload: {
js: './packages/databyss-desktop/pdfview/preload.js',
},
},
],
},
}),
],
}
export default config