forked from maaxpool/wchia-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
31 lines (29 loc) · 952 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
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
const isProd = process.env.NODE_ENV === 'production'
// trigger build
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '/' : './',
productionSourceMap: false,
assetsDir: "assets",
lintOnSave: false, // 禁用eslint
configureWebpack: config => {
if (isProd) {
config.plugins.push(new CompressionWebpackPlugin({
algorithm: 'gzip',
test: new RegExp('\\.('+ productionGzipExtensions +')$'),
threshold: 10240,
minRatio: 0.8
}))
}
},
devServer: {
open: true,
proxy: {
'/rpc': {
target: process.env.VUE_APP_URL,
changeOrigin: true, // 是否改变域名
}
}
}
}