forked from halo-dev/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
49 lines (42 loc) · 1.15 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
const pkg = require('./package.json')
const { defineConfig } = require('@vue/cli-service')
const dynamicThemePlugin = require('./src/webpack/dynamicTheme.js')
const CompressionPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i
module.exports = defineConfig({
publicPath: process.env.PUBLIC_PATH,
chainWebpack: config => {
config.plugin('html').tap(args => {
args[0].version = pkg.version
return args
})
if (process.env.NODE_ENV === 'production') {
config.plugin('compressionPlugin').use(
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: productionGzipExtensions,
threshold: 10240,
minRatio: 0.8,
deleteOriginalAssets: false
})
)
}
},
configureWebpack: {
plugins: [dynamicThemePlugin()]
},
css: {
loaderOptions: {
less: {
modifyVars: {
'border-radius-base': '2px'
},
javascriptEnabled: true
}
}
},
lintOnSave: false,
transpileDependencies: [],
productionSourceMap: false
})