Merge branch 'master' into deploy
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const defaultSettings = require('./src/settings.js')
|
||||
const CompressionPlugin = require('compression-webpack-plugin')
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
@@ -50,7 +51,16 @@ module.exports = {
|
||||
'@': resolve('src'),
|
||||
'@crud': resolve('src/components/Crud')
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
// https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件
|
||||
new CompressionPlugin({
|
||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||
filename: '[path].gz[query]', // 压缩后的文件名
|
||||
algorithm: 'gzip', // 使用gzip压缩
|
||||
minRatio: 0.8 // 压缩率小于1才会压缩
|
||||
})
|
||||
]
|
||||
},
|
||||
chainWebpack(config) {
|
||||
config.plugins.delete('preload') // TODO: need test
|
||||
|
||||
Reference in New Issue
Block a user