-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvue.config.js
42 lines (42 loc) · 974 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
module.exports = {
productionSourceMap: false,
configureWebpack: {
performance: {
hints: 'warning',
// 入口起点的最大体积
maxEntrypointSize: 50000000,
// 生成文件的最大体积
maxAssetSize: 30000000,
// 只给出 js 文件的性能提示
assetFilter: function (assetFilename) {
return assetFilename.endsWith('.js')
}
},
module: {
rules: [
{
test: /\.(svg)(\?.*)?$/,
use: [
{
loader: 'svg-sprite-loader',
options: {
limit: 10000,
name: 'assets/img/[name].[hash:7].[ext]',
symbolId: 'icon-[name]'
}
}
]
}
]
}
},
publicPath: process.env.NODE_ENV === 'production'
? '././'
: './',
chainWebpack: config => {
config.module
.rule('svg')
.test(() => false)
.use('file-loader')
}
}