-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
103 lines (98 loc) · 3.27 KB
/
vue.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
// vue.config.js
module.exports = {
lintOnSave: true,
productionSourceMap: false,
pluginOptions: {
// https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html#webpack-configuration
electronBuilder: {
// mainProcessFile: 'backend/main.js',
// preload: 'backend/preload.js',
nodeIntegration: true,
builderOptions: {
productName: "electron-updater-template",
appId: "com.demo.app",
// files: ['dist_electron/**/*'],
extends: null,
directories: {
output: "dist_electron",
},
mac: {
target: [{ target: "dmg", arch: ["x64", "arm64", "universal"] }],
// eslint-disable-next-line no-template-curly-in-string
artifactName: "${productName}-${os}-${version}-${arch}.${ext}",
category: "public.app-category.developer-tools",
// icon: "build/icons/icon.icns",
type: "development",
darkModeSupport: false,
},
dmg: {
icon: "build/icons/icon.icns",
iconSize: 85,
},
win: {
target: [
{ target: "portable", arch: ["x64"] },
{ target: "nsis", arch: ["x64"] },
],
icon: "build/icons/icon.ico",
},
nsis: {
oneClick: true,
perMachine: true,
installerIcon: "build/icons/icon.ico",
deleteAppDataOnUninstall: true,
// eslint-disable-next-line no-template-curly-in-string
artifactName: "${productName}-Setup-${version}.${ext}",
},
linux: {
target: [
{ target: "AppImage", arch: ["x64"] },
// { target: "tar.gz", arch: ["x64"] },
// { target: "deb", arch: ["x64", "armv7l"] },
// { target: "rpm", arch: ["x64"] },
// { target: 'snap', arch: ['x64'] }
// { target: 'pacman', arch: ['x64'] }
],
category: "Development",
// icon: "build/icons/icon.icns",
},
publish: [
{
/* https://www.electron.build/configuration/publish#githuboptions */
provider: "github",
repo: "electron-updater-template",
owner: "zx",
vPrefixedTagName: true,
releaseType: "draft",
private: true,
// your personal/company token
token: "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",
},
],
},
// 主线程的配置文件
chainWebpackMainProcess: (config) => {
config.plugin("define").tap((args) => {
args[0]["IS_ELECTRON"] = true;
return args;
});
},
// 渲染线程的配置文件
chainWebpackRendererProcess: (config) => {
// 渲染线程的一些其他配置
// Chain webpack config for electron renderer process only
// The following example will set IS_ELECTRON to true in your app
config.plugin("define").tap((args) => {
args[0]["IS_ELECTRON"] = true;
return args;
});
},
mainProcessWatch: ["background"],
},
},
chainWebpack: (config) => {
config.resolve.alias.set("@", resolve("src"));
},
};