-
Notifications
You must be signed in to change notification settings - Fork 4
/
vue.config.js
144 lines (139 loc) · 4.5 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')
const resolve = dirPath => path.join(__dirname, './', dirPath)
module.exports = {
"transpileDependencies": [
"vuetify"
],
pages: {
index: {
// entry for the page
entry: 'src/main.js',
// the source template
template: 'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'SenseCAP One Configuration Tool',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
settings: {
entry: 'src/main-settings.js',
template: 'public/index.html',
filename: 'settings.html',
title: 'SenseCAP One Configuration Tool - Settings',
chunks: ['chunk-vendors', 'chunk-common', 'settings']
},
fwupdate: {
entry: 'src/main-update.js',
template: 'public/index.html',
filename: 'fwupdate.html',
title: 'SenseCAP One Configuration Tool - Firmware Update',
chunks: ['chunk-vendors', 'chunk-common', 'fwupdate']
},
},
chainWebpack: config => {
config.module
.rule("i18n")
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use("i18n")
.loader("@intlify/vue-i18n-loader")
.end();
/** svg */
const svgRule = config.module.rule('svg') // 找到svg-loader
svgRule.uses.clear() // 清除已有的loader, 如果不这样做会添加在此loader之后
svgRule.exclude.add(/node_modules/) // 正则匹配排除node_modules目录
svgRule.include.add(resolve('src/icons'))
svgRule // 添加svg新的loader处理
.test(/\.svg$/)
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
// 修改images loader 添加svg处理
const imagesRule = config.module.rule('images')
imagesRule.exclude.add(resolve('src/icons'))
imagesRule.test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/)
/** svg end */
},
pluginOptions: {
electronBuilder: {
// List native deps here if they don't work
externals: ['serialport'],
// If you are using Yarn Workspaces, you may have multiple node_modules folders
// List them all here so that VCP Electron Builder can find them
// nodeModulesPath: ['../../node_modules', './node_modules']
nodeIntegration: true,
builderOptions: {
// options placed here will be merged with default configuration and passed to electron-builder
'appId': 'cc.seeed.sensecap.tools.one',
'productName': 'SenseCAP One Configuration Tool',
'copyright': 'Copyright ©2008-2024 Seeed Technology Co.,Ltd.',
'nsis': {
'installerIcon': 'build/icon.ico',
'installerHeader': 'build/icon.png',
'installerHeaderIcon': 'build/icon.ico',
'oneClick': false,
'allowToChangeInstallationDirectory': true,
'runAfterFinish': false
},
'win': {
'verifyUpdateCodeSignature': false,
'target': [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
},
{
"target": "portable",
"arch": [
"x64",
"ia32"
]
}
],
'icon': 'build/icon.ico',
},
'dmg': {
'title': 'SenseCAP One Configuration Tool',
'icon': 'build/icon.png',
'contents': [
{
'x': 100,
'y': 200
},
{
'x': 400,
'y': 200,
'type': 'link',
'path': '/Applications'
}
],
},
'mac': {
'category': 'public.app-category.developer-tools',
'target': 'default',
'icon': 'build/icon.png',
"hardenedRuntime" : true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist"
},
"afterSign": "scripts/notarize.js",
"linux": {
"target": ["AppImage", "deb"],
"icon": "build/icon.png"
},
"publish": "github"
}
}
}
}