提交 06eed262 编写于 作者: tony001's avatar tony001

测试压缩打包

上级 6846a725
......@@ -3,6 +3,7 @@ TARGET=PSSYSAPP
</#ibiztemplate>
const path = require('path');
const os = require('os');
const CompressionPlugin = require("compression-webpack-plugin");
function resolve(dir) {
return path.join(__dirname, dir)
......@@ -138,5 +139,16 @@ module.exports = {
// 单个进程最大使用内存
ForkTsCheckerPlugin.memoryLimit = 4096;
}
if(Object.is(config.mode, 'production')){
return{
plugins: [
new CompressionPlugin({
test:/\.js$|\.html$|.\css/, //匹配文件名
threshold: 10240,//对超过10k的数据压缩
deleteOriginalAssets: false //不删除源文件
})
]
}
}
},
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册