-
-
Notifications
You must be signed in to change notification settings - Fork 671
/
vue.config.js
42 lines (41 loc) · 1016 Bytes
/
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
const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = defineConfig({
configureWebpack: config => {
config.plugins = [
...config.plugins,
new NodePolyfillPlugin()
],
config.experiments = {
syncWebAssembly: true
}
// 非Node环境下去掉electron模块
if (!process.env.IS_ELECTRON) {
config.externals = {
electron: 'commonjs2 electron',
}
}
},
transpileDependencies: true,
publicPath: './', // 设置资源文件的根路径
devServer: {
hot: true//自动保存
},
pluginOptions: {
electronBuilder: {
nodeIntegration: true,
customFileProtocol: "./",
mainProcessFile: 'src/background.js',
builderOptions: {
appId: 'com.example.app',
productName: 'ChatGPT_JCM',
win: {
icon: './public/app.ico'
},
mac: {
icon: './public/app.icns'
}
}
}
}
})