From d0878d4d18f8aa2830e7015318c854dfbac4f4d6 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 16 Jun 2023 17:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20config:=20=E5=88=A0=E9=99=A4comp?= =?UTF-8?q?ression-webpack-plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.config.js | 11 ----------- package.json | 3 +-- yarn.lock | 11 ----------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index b2e8d32e..c7b9692d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -28,7 +28,6 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin' const postcssNormalize = require('postcss-normalize'); const appPackageJson = require(paths.appPackageJson); -const CompressionPlugin = require('compression-webpack-plugin'); // Source maps are resource heavy and can cause out of memory issue for large source files. // const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'; const shouldUseSourceMap = false; @@ -592,16 +591,6 @@ module.exports = function (webpackEnv) { ] }, plugins: [ - process.env.NODE_ENV !== 'development' && - new CompressionPlugin({ - filename: '[path].gz[query]', // 目标资源名称。[file] 会被替换成原资源。[path] 会被替换成原资源路径,[query] 替换成原查询字符串 - algorithm: 'gzip', // 算法 - test: new RegExp('\\.(js|css)$'), // 压缩 js 与 css - threshold: 1024, // 只处理比这个值大的资源。按字节计算 - minRatio: 0.8, // 只有压缩率比这个值小的资源才会被处理 - deleteOriginalAssets: true - }), - // Generates an `index.html` file with the