-
Notifications
You must be signed in to change notification settings - Fork 38
/
vue.config.js
34 lines (33 loc) · 1000 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
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const CompressionWebpackPlugin = require('compression-webpack-plugin');
module.exports = {
publicPath:'/',
assetsDir:'static',
devServer: {
disableHostCheck: true
},
productionSourceMap: false,
configureWebpack:{
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
warnings: false,
compress: {
drop_console: true,//console
drop_debugger: true,
pure_funcs: ['console.log']//移除console
}
}
})
]
},
plugins: [
new CompressionWebpackPlugin({
test:/\.js$|\.html$|\.css$/, //匹配文件名
threshold: 10240,//对超过10k的数据压缩
deleteOriginalAssets: false //不删除源文件
})
]
}
}