-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildConfig.js
More file actions
81 lines (76 loc) · 1.95 KB
/
buildConfig.js
File metadata and controls
81 lines (76 loc) · 1.95 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const builder = require('electron-builder')
const Platform = builder.Platform
/**
* @type {import('electron-builder').Configuration}
*/
const options = {
appId: 'com.app.id',
productName: 'nuxt_electron',
// protocols: {
// name: 'Your deeplink',
// - Don't forget to set `MimeType: "x-scheme-handler/deeplink"` for `linux.desktop` entry!
// schemes: ['deeplink']
// },
// - Electron auto-updater config
// publish: [
// {
// provider: 'github',
// owner: 'eternalc0der',
// repo: 'electron-nuxt3',
// releaseType: 'release'
// }
// ],
// "store" | "normal" | "maximum" - For testing builds, use 'store' to reduce build time significantly.
compression: 'maximum',
removePackageScripts: true,
nodeGypRebuild: false,
buildDependenciesFromSource: false,
directories: {
output: 'electron-dist'
},
win: {
// eslint-disable-next-line no-template-curly-in-string
artifactName: '${productName}-Setup-${version}.${ext}',
target: [
{
target: 'nsis',
arch: ['x64', 'ia32']
}
]
},
nsis: {
deleteAppDataOnUninstall: true
},
mac: {
category: 'public.app-category.entertainment',
hardenedRuntime: false,
gatekeeperAssess: false,
target: [
{
target: 'default',
arch: ['x64', 'arm64']
}
]
},
linux: {
maintainer: 'Your Name',
desktop: {
StartupNotify: 'false',
Encoding: 'UTF-8',
MimeType: 'x-scheme-handler/deeplink'
},
target: ['AppImage', 'rpm', 'deb']
}
}
const platform = 'WINDOWS' // "MAC" | "LINUX" | "WINDOWS" - Change this to build for other platforms
builder
.build({
targets: Platform[platform].createTarget(),
config: options
})
.then((result) => {
console.log('----------------------------')
console.log('Platform:', platform)
console.log('Output:', JSON.stringify(result, null, 2))
})