Skip to content

Commit

Permalink
chore(deps): update (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Dec 17, 2020
1 parent 5b8b356 commit 72f3093
Show file tree
Hide file tree
Showing 18 changed files with 922 additions and 992 deletions.
766 changes: 362 additions & 404 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/preset-env": "^7.12.11",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@gfx/zopfli": "^1.0.15",
Expand All @@ -58,18 +58,18 @@
"del": "^6.0.0",
"del-cli": "^3.0.1",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-import": "^2.22.1",
"file-loader": "^6.2.0",
"husky": "^4.3.0",
"husky": "^4.3.6",
"jest": "^26.6.3",
"lint-staged": "^10.5.1",
"memfs": "^3.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.2",
"standard-version": "^9.0.0",
"webpack": "^5.10.0",
"workbox-webpack-plugin": "^6.0.0-alpha.3"
"webpack": "^5.11.0",
"workbox-webpack-plugin": "^6.0.2"
},
"keywords": [
"webpack"
Expand Down
16 changes: 6 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,16 @@ class CompressionPlugin {

if (this.options.deleteOriginalAssets) {
if (this.options.deleteOriginalAssets === "keep-source-map") {
const updatedAssetInfo = {
related: { ...info.related, sourceMap: null },
};

compilation.updateAsset(name, inputSource, updatedAssetInfo);
compilation.updateAsset(name, inputSource, {
related: { sourceMap: null },
});
}

compilation.deleteAsset(name);
} else {
const newOriginalInfo = {
related: { [relatedName]: newName, ...info.related },
};

compilation.updateAsset(name, inputSource, newOriginalInfo);
compilation.updateAsset(name, inputSource, {
related: { [relatedName]: newName },
});
}

compilation.emitAsset(newName, output, newInfo);
Expand Down
12 changes: 3 additions & 9 deletions test/CompressionPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,12 @@ describe("CompressionPlugin", () => {
}).apply(compiler);
new CompressionPlugin({
minRatio: Infinity,
algorithm: (input, options, callback) => {
return callback(null, input);
},
algorithm: (input, options, callback) => callback(null, input),
filename: "[path][base].compress",
}).apply(compiler);
new CompressionPlugin({
minRatio: Infinity,
algorithm: (input, options, callback) => {
return callback(null, input);
},
algorithm: (input, options, callback) => callback(null, input),
filename: "[path][base].custom?foo=bar#hash",
}).apply(compiler);

Expand Down Expand Up @@ -337,9 +333,7 @@ describe("CompressionPlugin", () => {
}).apply(compiler);
new CompressionPlugin({
minRatio: Infinity,
algorithm: (input, options, callback) => {
return callback(null, input);
},
algorithm: (input, options, callback) => callback(null, input),
filename: "[path][base].custom",
}).apply(compiler);

Expand Down
Loading

0 comments on commit 72f3093

Please sign in to comment.