Skip to content

Commit 72f3093

Browse files
chore(deps): update (#233)
1 parent 5b8b356 commit 72f3093

18 files changed

+922
-992
lines changed

package-lock.json

+362-404
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"devDependencies": {
4848
"@babel/cli": "^7.12.1",
4949
"@babel/core": "^7.12.3",
50-
"@babel/preset-env": "^7.12.1",
50+
"@babel/preset-env": "^7.12.11",
5151
"@commitlint/cli": "^11.0.0",
5252
"@commitlint/config-conventional": "^11.0.0",
5353
"@gfx/zopfli": "^1.0.15",
@@ -58,18 +58,18 @@
5858
"del": "^6.0.0",
5959
"del-cli": "^3.0.1",
6060
"eslint": "^7.13.0",
61-
"eslint-config-prettier": "^6.15.0",
61+
"eslint-config-prettier": "^7.0.0",
6262
"eslint-plugin-import": "^2.22.1",
6363
"file-loader": "^6.2.0",
64-
"husky": "^4.3.0",
64+
"husky": "^4.3.6",
6565
"jest": "^26.6.3",
6666
"lint-staged": "^10.5.1",
6767
"memfs": "^3.2.0",
6868
"npm-run-all": "^4.1.5",
6969
"prettier": "^2.1.2",
7070
"standard-version": "^9.0.0",
71-
"webpack": "^5.10.0",
72-
"workbox-webpack-plugin": "^6.0.0-alpha.3"
71+
"webpack": "^5.11.0",
72+
"workbox-webpack-plugin": "^6.0.2"
7373
},
7474
"keywords": [
7575
"webpack"

src/index.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,16 @@ class CompressionPlugin {
260260

261261
if (this.options.deleteOriginalAssets) {
262262
if (this.options.deleteOriginalAssets === "keep-source-map") {
263-
const updatedAssetInfo = {
264-
related: { ...info.related, sourceMap: null },
265-
};
266-
267-
compilation.updateAsset(name, inputSource, updatedAssetInfo);
263+
compilation.updateAsset(name, inputSource, {
264+
related: { sourceMap: null },
265+
});
268266
}
269267

270268
compilation.deleteAsset(name);
271269
} else {
272-
const newOriginalInfo = {
273-
related: { [relatedName]: newName, ...info.related },
274-
};
275-
276-
compilation.updateAsset(name, inputSource, newOriginalInfo);
270+
compilation.updateAsset(name, inputSource, {
271+
related: { [relatedName]: newName },
272+
});
277273
}
278274

279275
compilation.emitAsset(newName, output, newInfo);

test/CompressionPlugin.test.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,12 @@ describe("CompressionPlugin", () => {
132132
}).apply(compiler);
133133
new CompressionPlugin({
134134
minRatio: Infinity,
135-
algorithm: (input, options, callback) => {
136-
return callback(null, input);
137-
},
135+
algorithm: (input, options, callback) => callback(null, input),
138136
filename: "[path][base].compress",
139137
}).apply(compiler);
140138
new CompressionPlugin({
141139
minRatio: Infinity,
142-
algorithm: (input, options, callback) => {
143-
return callback(null, input);
144-
},
140+
algorithm: (input, options, callback) => callback(null, input),
145141
filename: "[path][base].custom?foo=bar#hash",
146142
}).apply(compiler);
147143

@@ -337,9 +333,7 @@ describe("CompressionPlugin", () => {
337333
}).apply(compiler);
338334
new CompressionPlugin({
339335
minRatio: Infinity,
340-
algorithm: (input, options, callback) => {
341-
return callback(null, input);
342-
},
336+
algorithm: (input, options, callback) => callback(null, input),
343337
filename: "[path][base].custom",
344338
}).apply(compiler);
345339

0 commit comments

Comments
 (0)