分类目录归档:react

react 和umi配置gzip


1,安装插件

npm install compression-webpack-plugin --save--dev

2,引用插件和配置规则

const CompressionPlugin = require('compression-webpack-plugin');
const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i;

3,在webpack插件中使用

new CompressionPlugin({
    filename: '[path].gz[query]',
    algorithm

查看详情