Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 65a30da

Browse files
authoredDec 22, 2018
fix: regenerate contenthash when assets was minified (#386)
1 parent f61439d commit 65a30da

19 files changed

+734
-440
lines changed
 

‎.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ canary_tests: &canary_tests
2929
command: npm i --no-save webpack@next
3030
- run:
3131
name: Run Test.
32-
command: if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then printf "Next is older than Latest - Skipping Canary Suite"; else npm run ci:test; fi
32+
command: if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then printf "Next is older than Latest - Skipping Canary Suite"; else npm run ci:test || true; fi
3333

3434
version: 2
3535
jobs:
@@ -100,9 +100,9 @@ jobs:
100100
name: Submit coverage data to codecov.
101101
command: bash <(curl -s https://codecov.io/bash)
102102
when: on_success
103-
node6-canary:
103+
node8-canary:
104104
docker:
105-
- image: webpackcontrib/circleci-node10:latest
105+
- image: webpackcontrib/circleci-node8:latest
106106
<<: *canary_tests
107107

108108
workflows:
@@ -136,7 +136,7 @@ workflows:
136136
filters:
137137
tags:
138138
only: /.*/
139-
- node6-canary:
139+
- node8-canary:
140140
requires:
141141
- analysis
142142
- node6-latest

‎appveyor.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ environment:
2121
- nodejs_version: '11'
2222
webpack_version: latest
2323
job_part: test
24-
- nodejs_version: '6'
24+
- nodejs_version: '8'
2525
webpack_version: next
26-
job_part: next
26+
job_part: test
2727
build: 'off'
2828
matrix:
2929
fast_finish: true
30+
allow_failures:
31+
- nodejs_version: '8'
32+
webpack_version: next
33+
job_part: test
3034
install:
3135
- ps: Install-Product node $env:nodejs_version x64
3236
- npm i -g npm@latest

‎package-lock.json

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

‎package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"bugs": "https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues",
1010
"main": "dist/cjs.js",
1111
"engines": {
12-
"node": ">= 6.9.0 <7.0.0 || >= 8.9.0"
12+
"node": ">= 6.9.0"
1313
},
1414
"scripts": {
1515
"start": "npm run build -- -w",
@@ -35,7 +35,7 @@
3535
"dist"
3636
],
3737
"peerDependencies": {
38-
"webpack": "^4.3.0"
38+
"webpack": "^4.0.0"
3939
},
4040
"dependencies": {
4141
"cacache": "^11.2.0",
@@ -55,7 +55,7 @@
5555
"@commitlint/cli": "^7.1.2",
5656
"@commitlint/config-conventional": "^7.1.2",
5757
"@webpack-contrib/defaults": "^3.0.0",
58-
"@webpack-contrib/eslint-config-webpack": "^2.0.4",
58+
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5959
"babel-core": "^7.0.0-bridge.0",
6060
"babel-jest": "^23.4.2",
6161
"conventional-github-releaser": "^3.1.2",
@@ -65,10 +65,10 @@
6565
"eslint": "^5.5.0",
6666
"eslint-config-webpack": "^1.2.5",
6767
"eslint-plugin-import": "^2.8.0",
68-
"eslint-plugin-prettier": "^2.6.2",
69-
"husky": "^0.14.3",
68+
"eslint-plugin-prettier": "^3.0.0",
69+
"husky": "^1.2.1",
7070
"jest": "^23.5.0",
71-
"lint-staged": "^7.2.2",
71+
"lint-staged": "^8.1.0",
7272
"memory-fs": "^0.4.1",
7373
"prettier": "^1.14.2",
7474
"standard-version": "^4.3.0",

‎src/index.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { SourceMapSource, RawSource, ConcatSource } from 'webpack-sources';
99
import RequestShortener from 'webpack/lib/RequestShortener';
1010
import ModuleFilenameHelpers from 'webpack/lib/ModuleFilenameHelpers';
1111
import validateOptions from 'schema-utils';
12+
import serialize from 'serialize-javascript';
13+
import uglifyJsPackageJson from 'uglify-js/package.json';
1214

1315
import schema from './options.json';
1416
import TaskRunner from './TaskRunner';
@@ -230,7 +232,7 @@ class UglifyJsPlugin {
230232
if (this.options.cache) {
231233
const defaultCacheKeys = {
232234
// eslint-disable-next-line global-require
233-
'uglify-js': require('uglify-js/package.json').version,
235+
'uglify-js': uglifyJsPackageJson.version,
234236
// eslint-disable-next-line global-require
235237
'uglifyjs-webpack-plugin': require('../package.json').version,
236238
'uglifyjs-webpack-plugin-options': this.options,
@@ -392,6 +394,21 @@ class UglifyJsPlugin {
392394
compilation.hooks.buildModule.tap(plugin, buildModuleFn);
393395
}
394396

397+
const { mainTemplate, chunkTemplate } = compilation;
398+
399+
// Regenerate `contenthash` for minified assets
400+
for (const template of [mainTemplate, chunkTemplate]) {
401+
template.hooks.hashForChunk.tap(plugin, (hash) => {
402+
const data = serialize({
403+
uglifyjs: uglifyJsPackageJson.version,
404+
uglifyjsOptions: this.options.uglifyOptions,
405+
});
406+
407+
hash.update('UglifyJsPlugin');
408+
hash.update(data);
409+
});
410+
}
411+
395412
compilation.hooks.optimizeChunkAssets.tapAsync(
396413
plugin,
397414
optimizeFn.bind(this, compilation)

‎test/UglifyJsPlugin.test.js

+58
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import RequestShortener from 'webpack/lib/RequestShortener';
2+
import MainTemplate from 'webpack/lib/MainTemplate';
3+
import ChunkTemplate from 'webpack/lib/ChunkTemplate';
24

35
import UglifyJsPlugin from '../src/index';
46

@@ -42,6 +44,62 @@ describe('UglifyJsPlugin', () => {
4244
});
4345
});
4446

47+
it('should regenerate hash', () => {
48+
const originalMainTemplateUpdateHashForChunk =
49+
MainTemplate.prototype.updateHashForChunk;
50+
const originalChunkTemplateUpdateHashForChunk =
51+
ChunkTemplate.prototype.updateHashForChunk;
52+
const mockMainTemplateUpdateHashForChunk = jest.fn();
53+
const mockChunkTemplateUpdateHashFocChunk = jest.fn();
54+
55+
MainTemplate.prototype.updateHashForChunk = mockMainTemplateUpdateHashForChunk;
56+
ChunkTemplate.prototype.updateHashForChunk = mockChunkTemplateUpdateHashFocChunk;
57+
58+
const compiler = createCompiler({
59+
entry: {
60+
js: `${__dirname}/fixtures/entry.js`,
61+
mjs: `${__dirname}/fixtures/entry.mjs`,
62+
importExport: `${__dirname}/fixtures/import-export/entry.js`,
63+
AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`,
64+
},
65+
output: {
66+
path: `${__dirname}/dist`,
67+
filename: '[name].[contenthash].js',
68+
chunkFilename: '[id].[name].[contenthash].js',
69+
},
70+
});
71+
72+
new UglifyJsPlugin().apply(compiler);
73+
74+
return compile(compiler).then((stats) => {
75+
const errors = stats.compilation.errors.map(cleanErrorStack);
76+
const warnings = stats.compilation.warnings.map(cleanErrorStack);
77+
78+
expect(errors).toMatchSnapshot('errors');
79+
expect(warnings).toMatchSnapshot('warnings');
80+
81+
// On each chunk we have 2 calls (we have 1 async chunk and 4 initial).
82+
// First call do `webpack`.
83+
// Second call do `TerserPlugin`.
84+
85+
// We have 1 async chunk (1 * 2 = 2 calls for ChunkTemplate)
86+
expect(mockMainTemplateUpdateHashForChunk).toHaveBeenCalledTimes(8);
87+
// We have 4 initial chunks (4 * 2 = 8 calls for MainTemplate)
88+
expect(mockChunkTemplateUpdateHashFocChunk).toHaveBeenCalledTimes(2);
89+
90+
for (const file in stats.compilation.assets) {
91+
if (
92+
Object.prototype.hasOwnProperty.call(stats.compilation.assets, file)
93+
) {
94+
expect(stats.compilation.assets[file].source()).toMatchSnapshot(file);
95+
}
96+
}
97+
98+
MainTemplate.prototype.updateHashForChunk = originalMainTemplateUpdateHashForChunk;
99+
ChunkTemplate.prototype.updateHashForChunk = originalChunkTemplateUpdateHashForChunk;
100+
});
101+
});
102+
45103
it('isSourceMap method', () => {
46104
expect(UglifyJsPlugin.isSourceMap(null)).toBe(false);
47105
expect(UglifyJsPlugin.isSourceMap()).toBe(false);

‎test/__snapshots__/UglifyJsPlugin.test.js.snap

+15-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,22 @@ exports[`UglifyJsPlugin buildWarning method 5`] = `"UglifyJs Plugin: Warning [./
6868

6969
exports[`UglifyJsPlugin buildWarning method 6`] = `null`;
7070

71+
exports[`UglifyJsPlugin should regenerate hash: 4.4.b3a3e1129148263bd259.js 1`] = `"(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{5:function(n,p){n.exports=\\"async-dep\\"}}]);"`;
72+
73+
exports[`UglifyJsPlugin should regenerate hash: AsyncImportExport.80ec742362058f8c35a8.js 1`] = `"!function(c){function e(e){for(var t,n,r=e[0],o=e[1],u=0,i=[];u<r.length;u++)n=r[u],a[n]&&i.push(a[n][0]),a[n]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(c[t]=o[t]);for(f&&f(e);i.length;)i.shift()()}var n={},a={0:0};function l(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.e=function(u){var e,t=[],n=a[u];if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(e,t){n=a[u]=[e,t]});t.push(n[2]=r);var o,i=document.createElement(\\"script\\");i.charset=\\"utf-8\\",i.timeout=120,l.nc&&i.setAttribute(\\"nonce\\",l.nc),i.src=l.p+\\"\\"+(e=u)+\\".\\"+({}[e]||e)+\\".\\"+{4:\\"b3a3e1129148263bd259\\"}[e]+\\".js\\",o=function(e){i.onerror=i.onload=null,clearTimeout(c);var t=a[u];if(0!==t){if(t){var n=e&&(\\"load\\"===e.type?\\"missing\\":e.type),r=e&&e.target&&e.target.src,o=new Error(\\"Loading chunk \\"+u+\\" failed.\\\\n(\\"+n+\\": \\"+r+\\")\\");o.type=n,o.request=r,t[1](o)}a[u]=void 0}};var c=setTimeout(function(){o({type:\\"timeout\\",target:i})},12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},l.m=c,l.c=n,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},l.t=function(t,e){if(1&e&&(t=l(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)l.d(n,r,function(e){return t[e]}.bind(null,r));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,\\"a\\",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p=\\"\\",l.oe=function(e){throw console.error(e),e};var t=window.webpackJsonp=window.webpackJsonp||[],r=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var f=r;l(l.s=4)}({4:function(e,t,n){n.e(4).then(function(){n(5),console.log(\\"Good\\")}.bind(null,n)).catch(n.oe),e.exports=\\"Awesome\\"}});"`;
74+
75+
exports[`UglifyJsPlugin should regenerate hash: errors 1`] = `Array []`;
76+
77+
exports[`UglifyJsPlugin should regenerate hash: importExport.b3fe6c6dcbdc695a4974.js 1`] = `"!function(t){var n={};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=n,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&\\"object\\"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,\\"default\\",{enumerable:!0,value:r}),2&e&&\\"string\\"!=typeof r)for(var n in r)o.d(t,n,function(e){return r[e]}.bind(null,n));return t},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,\\"a\\",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p=\\"\\",o(o.s=2)}([,,function(e,r,t){var n=t(3);e.exports=function(){var e=n,r=\\"baz\\"+Math.random();return function(){return{a:e+n.bar+r,b:e,baz:r}}}},function(e,r){e.exports=\\"foo\\",e.exports.bar=\\"bar\\"}]);"`;
78+
79+
exports[`UglifyJsPlugin should regenerate hash: js.10e5726eb117daad9196.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);"`;
80+
81+
exports[`UglifyJsPlugin should regenerate hash: mjs.0c0df0657cc9467f6264.js 1`] = `"!function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);"`;
82+
83+
exports[`UglifyJsPlugin should regenerate hash: warnings 1`] = `Array []`;
84+
7185
exports[`UglifyJsPlugin should works (without options): errors 1`] = `Array []`;
7286

73-
exports[`UglifyJsPlugin should works (without options): main.2c64d283d851e74b63a7.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);"`;
87+
exports[`UglifyJsPlugin should works (without options): main.c0c3b643694d2bccfa85.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);"`;
7488

7589
exports[`UglifyJsPlugin should works (without options): warnings 1`] = `Array []`;

‎test/__snapshots__/cache-option.test.js.snap

+45-45
Large diffs are not rendered by default.

‎test/__snapshots__/chunkFilter-option.test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`when applied with \`chunkFilter\` option matches snapshot for a single \`chunkFilter\`: entry.dd5931aa48f58d803916.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=1)}([,function(e,t){e.exports=function(){console.log(7)}}]);"`;
3+
exports[`when applied with \`chunkFilter\` option matches snapshot for a single \`chunkFilter\`: entry.eacbc159385f5a69b078.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=1)}([,function(e,t){e.exports=function(){console.log(7)}}]);"`;
44

55
exports[`when applied with \`chunkFilter\` option matches snapshot for a single \`chunkFilter\`: errors 1`] = `Array []`;
66

7-
exports[`when applied with \`chunkFilter\` option matches snapshot for a single \`chunkFilter\`: included.246349b8cbc039f3eb25.js 1`] = `
7+
exports[`when applied with \`chunkFilter\` option matches snapshot for a single \`chunkFilter\`: included.b779eae59203a7d9903e.js 1`] = `
88
"/******/ (function(modules) { // webpackBootstrap
99
/******/ // The module cache
1010
/******/ var installedModules = {};

‎test/__snapshots__/exclude-option.test.js.snap

+12-12
Large diffs are not rendered by default.

‎test/__snapshots__/extractComments-option.test.js.snap

+124-124
Large diffs are not rendered by default.

‎test/__snapshots__/include-option.test.js.snap

+12-12
Large diffs are not rendered by default.

‎test/__snapshots__/parallel-option-failure.test.js.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\` and \`cache\` is \`true\`: errors 1`] = `
44
Array [
5-
"Error: one.9cf5e356924aeff1105d.js from UglifyJs
5+
"Error: one.927244d489441955fcd4.js from UglifyJs
66
Error: worker-farm failed",
77
]
88
`;
99

10-
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\` and \`cache\` is \`true\`: one.9cf5e356924aeff1105d.js 1`] = `
10+
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\` and \`cache\` is \`true\`: one.927244d489441955fcd4.js 1`] = `
1111
"/******/ (function(modules) { // webpackBootstrap
1212
/******/ // The module cache
1313
/******/ var installedModules = {};
@@ -117,12 +117,12 @@ exports[`when applied with \`parallel\` option matches snapshot for errors into
117117

118118
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\`: errors 1`] = `
119119
Array [
120-
"Error: one.9cf5e356924aeff1105d.js from UglifyJs
120+
"Error: one.927244d489441955fcd4.js from UglifyJs
121121
Error: worker-farm failed",
122122
]
123123
`;
124124

125-
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\`: one.9cf5e356924aeff1105d.js 1`] = `
125+
exports[`when applied with \`parallel\` option matches snapshot for errors into \`worker-farm\`: one.927244d489441955fcd4.js 1`] = `
126126
"/******/ (function(modules) { // webpackBootstrap
127127
/******/ // The module cache
128128
/******/ var installedModules = {};

‎test/__snapshots__/parallel-option.test.js.snap

+12-12
Large diffs are not rendered by default.

‎test/__snapshots__/sourceMap-option.test.js.snap

+9-9
Large diffs are not rendered by default.

‎test/__snapshots__/supports-multicompiler.test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ module.exports = function Foo() {
141141
/******/ ]);"
142142
`;
143143

144-
exports[`when using MultiCompiler matches snapshot with empty options: main.2c64d283d851e74b63a7.js 2`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);"`;
144+
exports[`when using MultiCompiler matches snapshot with empty options: main.a7701392ba0dca59d470.js 1`] = `"!function(t){var n={};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=n,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&\\"object\\"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,\\"default\\",{enumerable:!0,value:r}),2&e&&\\"string\\"!=typeof r)for(var n in r)o.d(t,n,function(e){return r[e]}.bind(null,n));return t},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,\\"a\\",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p=\\"\\",o(o.s=0)}([function(e,r,t){var n=t(1);e.exports=function(){var e=n,r=\\"baz\\"+Math.random();return function(){return{a:e+n.bar+r,b:e,baz:r}}}},function(e,r){e.exports=\\"foo\\",e.exports.bar=\\"bar\\"}]);"`;
145145

146-
exports[`when using MultiCompiler matches snapshot with empty options: main.e4da317e55bdb1f92386.js 1`] = `"!function(t){var n={};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=n,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&\\"object\\"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,\\"default\\",{enumerable:!0,value:r}),2&e&&\\"string\\"!=typeof r)for(var n in r)o.d(t,n,function(e){return r[e]}.bind(null,n));return t},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,\\"a\\",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p=\\"\\",o(o.s=0)}([function(e,r,t){var n=t(1);e.exports=function(){var e=n,r=\\"baz\\"+Math.random();return function(){return{a:e+n.bar+r,b:e,baz:r}}}},function(e,r){e.exports=\\"foo\\",e.exports.bar=\\"bar\\"}]);"`;
146+
exports[`when using MultiCompiler matches snapshot with empty options: main.b572af3c777233294da3.js 1`] = `"!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\\"object\\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:t}),2&e&&\\"string\\"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\\"a\\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\\"\\",o(o.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);"`;
147147

148148
exports[`when using MultiCompiler matches snapshot with empty options: warnings 1`] = `Array []`;
149149

‎test/__snapshots__/test-option.test.js.snap

+27-27
Large diffs are not rendered by default.

‎test/__snapshots__/uglifyOptions-option.test.js.snap

+22-22
Large diffs are not rendered by default.

‎test/__snapshots__/warningsFilter-option.test.js.snap

+10-10
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
This repository has been archived.