-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforge.config.js
73 lines (67 loc) · 1.76 KB
/
forge.config.js
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
const { version } = require('./package.json')
const semver = require('semver')
const externalsWin = ['active-win-universal', 'ffi-napi', 'ref-napi', 'iconv']
const externalsDarwin = ['active-win-universal']
const externals = process.platform === 'darwin' ? externalsDarwin : externalsWin
const checkAlpha = (version) => {
const parsed = semver.parse(version)
if (parsed.prerelease[0] === 'alpha') return true
return false
}
const isAlpha = checkAlpha(version)
const appBundleId = isAlpha ? 'com.workduck.mex-alpha' : 'com.workduck.mex'
const icon = isAlpha ? 'assets/icon-alpha.icns' : 'assets/icon.icns'
module.exports = {
electronRebuildConfig: {
forceABI: 101
},
packagerConfig: {
icon: icon,
appBundleId: appBundleId,
protocols: [
{
protocol: 'mex',
name: 'mex',
schemes: 'mex'
}
],
extendInfo: {
NSAppleEventsUsageDescription: 'Mex can control other applications with AppleScript.'
}
},
plugins: [
[
'@electron-forge/plugin-webpack',
{
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [
{
html: './src/mex.html',
js: './src/index.mex.tsx',
name: 'mex_window'
},
{
html: './src/spotlight.html',
js: './src/index.spotlight.tsx',
name: 'spotlight_window'
},
{
html: './src/toast.html',
js: './src/index.toast.tsx',
name: 'toast_window'
}
]
}
}
],
[
'@timfish/forge-externals-plugin',
{
externals: externals,
includeDeps: true
}
]
]
}