Merge branch 'master' into deploy

This commit is contained in:
Zheng Jie
2022-06-07 17:34:06 +08:00
10 changed files with 26 additions and 321 deletions

View File

@@ -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