-
Notifications
You must be signed in to change notification settings - Fork 9
/
vue.config.js
73 lines (72 loc) · 1.76 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
/* eslint-disable no-template-curly-in-string */
const path = require('path')
module.exports = {
publicPath: '/',
css: {
loaderOptions: {
// 设置 scss 公用变量文件
sass: {
prependData: '@import \'~@/assets/style/index.scss\';'
}
}
},
pluginOptions: {
autoRouting: {
chunkNamePrefix: 'page-'
},
electronBuilder: {
nodeIntegration: true,
chainWebpackMainProcess: config => {
config.module
.rule('babel')
.test(/\.js$/)
.include
.add(path.resolve(__dirname, 'src/lib/iconfont-sdk'))
.add(path.resolve(__dirname, 'src/background.js'))
.end()
.use('babel')
.loader('babel-loader')
.options({
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
electron: '9'
}
}
]
],
plugins: ['@babel/plugin-proposal-class-properties']
})
},
builderOptions: {
publish: {
provider: 'generic',
url: 'https://cdn.d2.pub/mirrors/d2-projects/iconfont-desktop/releases/latest/'
},
productName: 'iconfont-desktop',
artifactName: '${productName}-${version}.${ext}',
win: {
signAndEditExecutable: false,
target: [
'nsis',
'portable'
]
},
portable: {
artifactName: '${productName}-portable-${version}.${ext}'
}
}
}
},
chainWebpack: config => {
config.module
.rule('md')
.test(/\.md$/)
.use('text-loader')
.loader('text-loader')
.end()
}
}