-
Notifications
You must be signed in to change notification settings - Fork 125
/
vue.config.js
167 lines (160 loc) · 6.6 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// vue.config.js
const path = require('path');
// const webpack = require('webpack')
// const PreloadPlugin = require('@vue/preload-webpack-plugin')
const pkg = require('./package.json');
const CopywebpackPlugin = require('copy-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath: '.',
chainWebpack: config => {
config.module.rules.delete('eslint');
},
configureWebpack: {
// Webpack configuration applied to web builds and the electron renderer process
target: "electron-renderer",
resolve: {
mainFields: ['main', 'browser'],
alias: {
'@': resolve('src'),
},
}
},
pluginOptions: {
chainWebpack: config => {
config.module.rules.delete('eslint');
},
electronBuilder: {
preload: 'src/ui/workspace/bridgeClientImpl.js',
externals: ['electron-screenshots'],
chainWebpackMainProcess: (config) => {
// Chain webpack config for electron main process only
config.module
.rule('native')
.test(/\.node$/)
.use('native-ext-loader')
.loader('native-ext-loader')
.end();
// config.externals({
// 'electron-screenshots': 'require("electron-screenshots")'
// });
config.plugin('copy').use(CopywebpackPlugin, [
[
{
from: `${__dirname}/public/**/*`,
to: `${__dirname}/dist_electron`,
},
]
]);
},
chainWebpackRendererProcess: (config) => {
// Chain webpack config for electron renderer process only (won't be applied to web builds)
config.module
.rule("vue")
.use("vue-loader")
.loader("vue-loader")
.tap(options => {
// options.compilerOptions.directives = {
// html(node, directiveMeta) {
// (node.props || (node.props = [])).push({
// name: "innerHTML",
// value: `xss(_s(${directiveMeta.value}), xssOptions())`
// });
// }
// };
options.compilerOptions = {
compatConfig: {
MODE: 3
}
}
return options;
});
},
// nodeIntegration: true,
contextIsolation: false,
webSecurity: false,
// Use this to change the entrypoint of your app's main process
// mainProcessFile: 'src/myBackgroundFile.js',
// Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
// rendererProcessFile: 'src/myMainRenderFile.js',
// Provide an array of files that, when changed, will recompile the main process and restart Electron
// Your main process file will be added by default
// mainProcessWatch: ['src/myFile1', 'src/myFile2'],
// Provide a list of arguments that Electron will be launched with during "electron:serve",
// which can be accessed from the main process (src/background.js).
// Note that it is ignored when --debug flag is used with "electron:serve", as you must launch Electron yourself
// Command line args (excluding --debug, --dashboard, and --headless) are passed to Electron as well
// mainProcessArgs: ['--arg-name', 'arg-value']
mainProcessArgs: ['--disable-background-timer-throttling', ''],
// outputDir: 'release',
builderOptions: {
// 产品名称
productName: '野火IM',
// 修改appId是,需要同时修改backgroud.js里面设置的appUserModelId,设置见:app.setAppUserModelId(xxx)
appId: pkg.appId,
compression: 'normal',
artifactName: '${productName}-${version}-${os}-${arch}.${ext}',
protocols: {
name: "wf-deep-linking",
schemes: ["wfc"]
},
mac: {
extendInfo: {
NSCameraUsageDescription: "This app requires camera access to record video.",
NSMicrophoneUsageDescription: "This app requires microphone access to record audio."
},
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: "build/mac/entitlements.mac.plist",
entitlementsInherit: "build/mac/entitlements.mac.plist",
target: [
{
target: 'default',
arch: [
'universal'
]
}
]
},
linux: {
category: "Chat",
executableName: '野火IM',
target: [
'deb',
'AppImage'
]
},
deb: {
afterInstall: 'entries/install.sh'
},
extraResources: [
{
from: './build/icons',
to: 'extraResources/icons'
}
],
extraFiles: [
{
from: 'entries',
to: 'entries'
}
],
win: {
target: "nsis",
requestedExecutionLevel: "asInvoker"
},
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true,
artifactName: '${productName}-${version}-${os}-${arch}-setup.${ext}',
deleteAppDataOnUninstall: true,
perMachine: false,
createDesktopShortcut: true,
shortcutName: '${productName}',
}
}
}
},
}