mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-22 03:29:04 +00:00
merge: with dev
This commit is contained in:
@@ -43,6 +43,9 @@ module.exports = {
|
||||
warnings: false,
|
||||
errors: true
|
||||
},
|
||||
watchOptions: {
|
||||
aggregateTimeout: 2000
|
||||
},
|
||||
proxy: {
|
||||
// change xxx-api/login => mock/login
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
@@ -99,15 +102,7 @@ module.exports = {
|
||||
elementLocale: resolve('node_modules/element-ui/lib/locale/lang/en.js')
|
||||
},
|
||||
extensions: ['.vue', '.js', '.json']
|
||||
},
|
||||
plugins: [
|
||||
new CompressionWebpackPlugin({
|
||||
algorithm: 'gzip',
|
||||
test: productionGzipExtensions, // 处理所有匹配此 {RegExp} 的资源
|
||||
threshold: 10240, // 只处理比这个值大的资源。按字节计算(楼主设置10K以上进行压缩)
|
||||
minRatio: 0.8 // 只有压缩率比这个值小的资源才会被处理
|
||||
})
|
||||
]
|
||||
}
|
||||
},
|
||||
chainWebpack(config) {
|
||||
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||
@@ -158,6 +153,21 @@ module.exports = {
|
||||
config => config.devtool('cheap-source-map')
|
||||
)
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV === 'production', config => {
|
||||
config
|
||||
.plugin('CompressionWebpackPlugin')
|
||||
.use(CompressionWebpackPlugin, [
|
||||
{
|
||||
algorithm: 'gzip',
|
||||
test: productionGzipExtensions, // 处理所有匹配此 {RegExp} 的资源
|
||||
threshold: 10240, // 只处理比这个值大的资源。按字节计算(楼主设置10K以上进行压缩)
|
||||
minRatio: 0.8, // 只有压缩率比这个值小的资源才会被处理
|
||||
cache: false
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
config => {
|
||||
|
Reference in New Issue
Block a user