-
Notifications
You must be signed in to change notification settings - Fork 48
/
vue.config.js
74 lines (70 loc) · 1.95 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
const path = require('path')
const resolve = (dir) => {
return path.join(__dirname, dir)
}
const config = {
configureWebpack: {
// electron 入口
entry: './core/main.js'
},
chainWebpack: (config) => {
// import 别名
config.resolve.alias.set('~', resolve('./')).set('@', resolve('app'))
// svg 加载
config.module.rule('svg').delete('type').use('svg-vue3-loader').loader('svg-vue3-loader')
},
pluginOptions: {
// electron 打包配置
electronBuilder: {
// 输出路径
outputDir: 'release',
// node 集成
nodeIntegration: true,
// 自定义通信协议
customFileProtocol: 'monit://./',
// 主进程入口
mainProcessFile: 'core/main.ts',
// 渲染进程入口
rendererProcessFile: 'app/main.ts',
chainWebpackMainProcess: (config) => {
config.resolve.alias.set('~', resolve('./'))
},
// 构建选项
builderOptions: {
// 应用名
productName: 'Monit',
// 图标
icon: 'public/img/icon.png',
// 应用 ID
appId: 'monit.fzf404.art',
// 打包命名
artifactName: '${productName}-${version}-${os}-${arch}.${ext}',
// 发布地址
publish: ['github'],
// 多平台配置
win: {
target: ['nsis', '7z']
},
linux: {
target: 'AppImage'
},
mac: {
target: {
target: 'dmg',
arch: ['x64', 'arm64']
},
entitlements: 'entitlements.mac.plist',
extendInfo: {
NSMicrophoneUsageDescription: '请提供麦克风权限!',
NSCameraUsageDescription: '请提供相机权限!'
}
}
}
}
}
}
if (process.env.NODE_ENV === 'development') {
// 热重载配置
config.pluginOptions.electronBuilder.mainProcessWatch = ['config/*.ts', 'core/*.ts', 'event/*.ts', 'server/*.ts']
}
module.exports = { ...config }