🔧 config: 删除compression-webpack-plugin
This commit is contained in:
parent
a25e842c03
commit
d0878d4d18
|
@ -28,7 +28,6 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'
|
||||||
const postcssNormalize = require('postcss-normalize');
|
const postcssNormalize = require('postcss-normalize');
|
||||||
|
|
||||||
const appPackageJson = require(paths.appPackageJson);
|
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.
|
// 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 = process.env.GENERATE_SOURCEMAP !== 'false';
|
||||||
const shouldUseSourceMap = false;
|
const shouldUseSourceMap = false;
|
||||||
|
@ -592,16 +591,6 @@ module.exports = function (webpackEnv) {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
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 <script> injected.
|
|
||||||
new HtmlWebpackPlugin(
|
new HtmlWebpackPlugin(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
{},
|
{},
|
||||||
|
|
|
@ -121,7 +121,6 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/parser": "^7.16.7",
|
"@babel/parser": "^7.16.7",
|
||||||
"compression-webpack-plugin": "^5.0.1",
|
|
||||||
"react-json-view": "^1.21.3",
|
"react-json-view": "^1.21.3",
|
||||||
"webpack": "^5.60.0"
|
"webpack": "^5.60.0"
|
||||||
},
|
},
|
||||||
|
|
11
yarn.lock
11
yarn.lock
|
@ -4499,17 +4499,6 @@ compressible@~2.0.16:
|
||||||
dependencies:
|
dependencies:
|
||||||
mime-db ">= 1.43.0 < 2"
|
mime-db ">= 1.43.0 < 2"
|
||||||
|
|
||||||
compression-webpack-plugin@^5.0.1:
|
|
||||||
version "5.0.2"
|
|
||||||
resolved "https://repo.huaweicloud.com/repository/npm/compression-webpack-plugin/-/compression-webpack-plugin-5.0.2.tgz#df84e682cfa1fb2a230e71cf83d50c323d5369c2"
|
|
||||||
integrity sha512-F2G4cQfsMZ6CiPlG22Q5EDUCqnfyZqTjyJP5cMgNYUbBg/dUzV3hto8yTFFIogDCTWooVbePHQE0qL6FrJUSsA==
|
|
||||||
dependencies:
|
|
||||||
cacache "^15.0.5"
|
|
||||||
find-cache-dir "^3.3.1"
|
|
||||||
schema-utils "^2.7.0"
|
|
||||||
serialize-javascript "^4.0.0"
|
|
||||||
webpack-sources "^1.4.3"
|
|
||||||
|
|
||||||
compression@^1.7.4:
|
compression@^1.7.4:
|
||||||
version "1.7.4"
|
version "1.7.4"
|
||||||
resolved "https://repo.huaweicloud.com/repository/npm/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
|
resolved "https://repo.huaweicloud.com/repository/npm/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
|
||||||
|
|
Loading…
Reference in New Issue