-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.js
57 lines (56 loc) · 1.65 KB
/
ui.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
const prompts = require('./uiOptions')
module.exports = (api) => {
api.describeTask({
match: /vue-cli-service electron:build/,
description: 'Build your app for production with electron-builder',
link: 'https://MatthijsBurgh.github.io/vue-cli-plugin-electron-builder/',
prompts,
onBeforeRun: ({ answers, args }) => {
// Args
if (answers.dir) args.push('--dir')
if (answers.windows) {
args.push('--windows')
// For each windows target, add it after --windows
answers.windowsTargets.forEach((t) => {
args.push(t)
})
}
if (answers.linux) {
args.push('--linux')
// For each linux target, add it after --linux
answers.linuxTargets.forEach((t) => {
args.push(t)
})
}
if (answers.macos) {
args.push('--macos')
// For each macos target, add it after --macos
answers.macosTargets.forEach((t) => {
args.push(t)
})
}
// add --[arch] for each architecture target
answers.archs.forEach((a) => {
args.push(`--${a}`)
})
}
})
api.describeTask({
match: /vue-cli-service electron:serve/,
description: 'Serve your app, launch electron',
link: 'https://MatthijsBurgh.github.io/vue-cli-plugin-electron-builder/',
prompts: [
{
name: 'noSandbox',
type: 'confirm',
default: false,
description: 'Disable sandbox (--no-sandbox)',
link: 'https://github.com/electron/electron/issues/18265'
}
],
onBeforeRun: ({ answers, args }) => {
// Args
if (answers.noSandbox) args.push('--no-sandbox')
}
})
}