From f0ecb66a01396e91dddaee6522b6ec7d76fe590f Mon Sep 17 00:00:00 2001 From: Mihail Bodrov Date: Sat, 20 Jan 2018 15:04:40 +0300 Subject: [PATCH 01/31] Simplify check hasDependencies, add unit tests --- lib/DependenciesBlockVariable.js | 5 ++-- test/DependenciesBlockVariable.unittest.js | 31 ++++++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/DependenciesBlockVariable.js b/lib/DependenciesBlockVariable.js index 6a6ff5e0d..9d2330b9a 100644 --- a/lib/DependenciesBlockVariable.js +++ b/lib/DependenciesBlockVariable.js @@ -40,11 +40,10 @@ class DependenciesBlockVariable { hasDependencies(filter) { if(filter) { - if(this.dependencies.some(filter)) return true; + return this.dependencies.some(filter); } else { - if(this.dependencies.length > 0) return true; + return this.dependencies.length > 0; } - return false; } } diff --git a/test/DependenciesBlockVariable.unittest.js b/test/DependenciesBlockVariable.unittest.js index 43d19cd1e..5b1bd009b 100644 --- a/test/DependenciesBlockVariable.unittest.js +++ b/test/DependenciesBlockVariable.unittest.js @@ -25,9 +25,36 @@ describe("DependenciesBlockVariable", () => { afterEach(() => sandbox.restore()); - describe("hasDependencies", () => + describe("hasDependencies", () => { it("returns `true` if has dependencies", () => - should(DependenciesBlockVariableInstance.hasDependencies()).be.true())); + should(DependenciesBlockVariableInstance.hasDependencies()).be.true() + ); + + it("returns `true` if has dependencies and passed filter", () => + should(DependenciesBlockVariableInstance.hasDependencies(() => true)).be.true() + ); + + it("returns `false` if has dependencies, but not passed filter", () => + should(DependenciesBlockVariableInstance.hasDependencies(() => false)).be.false() + ); + + it("returns `false` if has 0 dependencies", () => + should(new DependenciesBlockVariable("dependencies-name", "expression", []).hasDependencies()).be.false() + ); + + it("returns `false` if has 0 dependencies and truthy filter", () => + should(new DependenciesBlockVariable("dependencies-name", "expression", []).hasDependencies(() => true)).be.false() + ); + + it("returns `true` if has several dependencies and only 1 filter passed", () => + should( + new DependenciesBlockVariable( + "dependencies-name", "expression", [dependencyMock, Object.assign({}, dependencyMock), Object.assign({}, dependencyMock)] + ) + .hasDependencies((item, i) => i === 2) + ).be.true() + ); + }); describe("disconnect", () => it("trigger dependencies disconnection", () => { From abeb5d85481f97174cddf63989fd3d2af30663ad Mon Sep 17 00:00:00 2001 From: Mihail Bodrov Date: Sun, 21 Jan 2018 17:29:40 +0300 Subject: [PATCH 02/31] Omit else block --- lib/DependenciesBlockVariable.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/DependenciesBlockVariable.js b/lib/DependenciesBlockVariable.js index 9d2330b9a..ba8962c86 100644 --- a/lib/DependenciesBlockVariable.js +++ b/lib/DependenciesBlockVariable.js @@ -41,9 +41,8 @@ class DependenciesBlockVariable { hasDependencies(filter) { if(filter) { return this.dependencies.some(filter); - } else { - return this.dependencies.length > 0; } + return this.dependencies.length > 0; } } From 30d3be5a53209a67aecc06e0b73e4291cc63a3c0 Mon Sep 17 00:00:00 2001 From: Stephon Harris Date: Thu, 29 Mar 2018 09:28:03 -0400 Subject: [PATCH 03/31] Fixing grammar issues --- examples/dll-app-and-vendor/0-vendor/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dll-app-and-vendor/0-vendor/README.md b/examples/dll-app-and-vendor/0-vendor/README.md index be4fe8eeb..1f1cb1a13 100644 --- a/examples/dll-app-and-vendor/0-vendor/README.md +++ b/examples/dll-app-and-vendor/0-vendor/README.md @@ -1,10 +1,10 @@ This is the vendor build part. -It's built separately from the app part. The vendors dll is only built when vendors has changed and not while the normal development cycle. +It's built separately from the app part. The vendors dll is only built when the array of vendors has changed and not during the normal development cycle. The DllPlugin in combination with the `output.library` option exposes the internal require function as global variable in the target environment. -A manifest is creates which includes mappings from module names to internal ids. +A manifest is created which includes mappings from module names to internal ids. ### webpack.config.js From 68ce7db7a8e5fdaa209afaa25cefbc6849841eca Mon Sep 17 00:00:00 2001 From: Mihail Bodrov Date: Tue, 3 Apr 2018 02:27:56 +0300 Subject: [PATCH 04/31] Fix eslint --- test/DependenciesBlockVariable.unittest.js | 43 ++++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/test/DependenciesBlockVariable.unittest.js b/test/DependenciesBlockVariable.unittest.js index b5888dd8f..45be56aa5 100644 --- a/test/DependenciesBlockVariable.unittest.js +++ b/test/DependenciesBlockVariable.unittest.js @@ -27,33 +27,44 @@ describe("DependenciesBlockVariable", () => { describe("hasDependencies", () => { it("returns `true` if has dependencies", () => - should(DependenciesBlockVariableInstance.hasDependencies()).be.true() - ); + should(DependenciesBlockVariableInstance.hasDependencies()).be.true()); it("returns `true` if has dependencies and passed filter", () => - should(DependenciesBlockVariableInstance.hasDependencies(() => true)).be.true() - ); + should( + DependenciesBlockVariableInstance.hasDependencies(() => true) + ).be.true()); it("returns `false` if has dependencies, but not passed filter", () => - should(DependenciesBlockVariableInstance.hasDependencies(() => false)).be.false() - ); + should( + DependenciesBlockVariableInstance.hasDependencies(() => false) + ).be.false()); it("returns `false` if has 0 dependencies", () => - should(new DependenciesBlockVariable("dependencies-name", "expression", []).hasDependencies()).be.false() - ); + should( + new DependenciesBlockVariable( + "dependencies-name", + "expression", + [] + ).hasDependencies() + ).be.false()); it("returns `false` if has 0 dependencies and truthy filter", () => - should(new DependenciesBlockVariable("dependencies-name", "expression", []).hasDependencies(() => true)).be.false() - ); + should( + new DependenciesBlockVariable( + "dependencies-name", + "expression", + [] + ).hasDependencies(() => true) + ).be.false()); it("returns `true` if has several dependencies and only 1 filter passed", () => should( - new DependenciesBlockVariable( - "dependencies-name", "expression", [dependencyMock, Object.assign({}, dependencyMock), Object.assign({}, dependencyMock)] - ) - .hasDependencies((item, i) => i === 2) - ).be.true() - ); + new DependenciesBlockVariable("dependencies-name", "expression", [ + dependencyMock, + Object.assign({}, dependencyMock), + Object.assign({}, dependencyMock) + ]).hasDependencies((item, i) => i === 2) + ).be.true()); }); describe("disconnect", () => From 7daecaf8f004b742120111a49e08e416907da458 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Tue, 10 Apr 2018 17:25:56 -0700 Subject: [PATCH 05/31] Add script src check so crossorigin attributes only added when needed --- lib/web/JsonpMainTemplatePlugin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index c13216572..0006fe51b 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -121,15 +121,17 @@ class JsonpMainTemplatePlugin { : "", "script.charset = 'utf-8';", `script.timeout = ${chunkLoadTimeout / 1000};`, + `script.src = ${mainTemplate.requireFn}.p + ${scriptSrcPath};`, crossOriginLoading - ? `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ? `script.src.indexOf(window.location.origin) && script.crossOrigin = ${JSON.stringify( + crossOriginLoading + )};` : "", `if (${mainTemplate.requireFn}.nc) {`, Template.indent( `script.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` ), "}", - `script.src = ${mainTemplate.requireFn}.p + ${scriptSrcPath};`, "var timeout = setTimeout(function(){", Template.indent([ "onScriptComplete({ type: 'timeout', target: script });" From 3710932abdaac02b0002887ef50723c1bc2a51ad Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Tue, 10 Apr 2018 18:09:03 -0700 Subject: [PATCH 06/31] Add crossorigin attr test cases --- .../crossorigin/set-crossorigin/empty.js | 0 .../crossorigin/set-crossorigin/index.js | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/cases/crossorigin/set-crossorigin/empty.js create mode 100644 test/cases/crossorigin/set-crossorigin/index.js diff --git a/test/cases/crossorigin/set-crossorigin/empty.js b/test/cases/crossorigin/set-crossorigin/empty.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/cases/crossorigin/set-crossorigin/index.js b/test/cases/crossorigin/set-crossorigin/index.js new file mode 100644 index 000000000..cb992604f --- /dev/null +++ b/test/cases/crossorigin/set-crossorigin/index.js @@ -0,0 +1,27 @@ +it("should load script without crossorigin attribute", function(done) { + require.ensure([], function(require) { + require("./empty?a"); + }, "chunk-with-crossorigin-attr"); + // if in browser context, test that crossorigin attribute was not added. + if (typeof document !== 'undefined') { + var script = document.querySelector('script[src="js/chunk-with-crossorigin-attr.web.js"]'); + script.getAttribute('crossorigin').should.be.exactly(null); + } + done(); +}); + +it("should load script with crossorigin attribute 'anonymous'", function(done) { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = 'https://example.com/'; + require.ensure([], function(require) { + require("./empty?b"); + }, "chunk-with-crossorigin-attr"); + __webpack_public_path__ = originalValue; + // if in browser context, test that crossorigin attribute was added. + if (typeof document !== 'undefined') { + var script = document.querySelector('script[src="https://example.com/js/chunk-with-crossorigin-attr.web.js"]'); + script.getAttribute('crossorigin').should.be.exactly('anonymous'); + } + __webpack_public_path__ = originalValue; + done(); +}); From 9a87c20d1c5f463ddabd89b3d85e2086f5e0deb0 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Wed, 11 Apr 2018 11:32:00 -0700 Subject: [PATCH 07/31] Ensure script src is set last, except for crossorigin attribute --- lib/web/JsonpMainTemplatePlugin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index 0006fe51b..034c85e64 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -121,17 +121,17 @@ class JsonpMainTemplatePlugin { : "", "script.charset = 'utf-8';", `script.timeout = ${chunkLoadTimeout / 1000};`, - `script.src = ${mainTemplate.requireFn}.p + ${scriptSrcPath};`, - crossOriginLoading - ? `script.src.indexOf(window.location.origin) && script.crossOrigin = ${JSON.stringify( - crossOriginLoading - )};` - : "", `if (${mainTemplate.requireFn}.nc) {`, Template.indent( `script.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` ), "}", + `script.src = ${mainTemplate.requireFn}.p + ${scriptSrcPath};`, + crossOriginLoading + ? `if (script.src.indexOf(window.location.origin)) {${Template.indent( + `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + )}}` + : "", "var timeout = setTimeout(function(){", Template.indent([ "onScriptComplete({ type: 'timeout', target: script });" From ca9734ec5e78a5f4828ea1677f05fe069c1eedb2 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Wed, 11 Apr 2018 11:36:21 -0700 Subject: [PATCH 08/31] Convert crossorigin attribute tests to use dynamic imports --- test/cases/crossorigin/set-crossorigin/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/cases/crossorigin/set-crossorigin/index.js b/test/cases/crossorigin/set-crossorigin/index.js index cb992604f..07d57cc6f 100644 --- a/test/cases/crossorigin/set-crossorigin/index.js +++ b/test/cases/crossorigin/set-crossorigin/index.js @@ -1,7 +1,5 @@ it("should load script without crossorigin attribute", function(done) { - require.ensure([], function(require) { - require("./empty?a"); - }, "chunk-with-crossorigin-attr"); + import("./empty?a" /* webpackChunkName: "chunk-with-crossorigin-attr" */); // if in browser context, test that crossorigin attribute was not added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chunk-with-crossorigin-attr.web.js"]'); @@ -13,13 +11,11 @@ it("should load script without crossorigin attribute", function(done) { it("should load script with crossorigin attribute 'anonymous'", function(done) { var originalValue = __webpack_public_path__; __webpack_public_path__ = 'https://example.com/'; - require.ensure([], function(require) { - require("./empty?b"); - }, "chunk-with-crossorigin-attr"); + import("./empty?b" /* webpackChunkName: "chunk-without-crossorigin-attr" */); __webpack_public_path__ = originalValue; // if in browser context, test that crossorigin attribute was added. if (typeof document !== 'undefined') { - var script = document.querySelector('script[src="https://example.com/js/chunk-with-crossorigin-attr.web.js"]'); + var script = document.querySelector('script[src="https://example.com/js/chunk-without-crossorigin-attr.web.js"]'); script.getAttribute('crossorigin').should.be.exactly('anonymous'); } __webpack_public_path__ = originalValue; From ac479f1bfd8d4d81fa90972894349162d770f0f6 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Thu, 19 Apr 2018 17:13:13 -0700 Subject: [PATCH 09/31] Fix tests --- test/configCases/web/prefetch-preload/index.js | 2 ++ test/statsCases/preload/expected.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/configCases/web/prefetch-preload/index.js b/test/configCases/web/prefetch-preload/index.js index 361620e85..699196b32 100644 --- a/test/configCases/web/prefetch-preload/index.js +++ b/test/configCases/web/prefetch-preload/index.js @@ -8,10 +8,12 @@ beforeEach(() => { oldNonce = __webpack_nonce__; oldPublicPath = __webpack_public_path__; global.document = new FakeDocument(); + global.location = {origin: "https://example.com"}; }); afterEach(() => { delete global.document; + delete global.location; __webpack_nonce__ = oldNonce; __webpack_public_path__ = oldPublicPath; }) diff --git a/test/statsCases/preload/expected.txt b/test/statsCases/preload/expected.txt index 75bf0ae9f..ba3db08ae 100644 --- a/test/statsCases/preload/expected.txt +++ b/test/statsCases/preload/expected.txt @@ -3,7 +3,7 @@ normal.js 130 bytes 1 [emitted] normal preloaded2.js 127 bytes 2 [emitted] preloaded2 preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 9.81 KiB 4 [emitted] main + main.js 9.8 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) From 0b759d755808799bb0ad88630e5d1ae9568176b0 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 23 Apr 2018 21:56:18 +0200 Subject: [PATCH 10/31] reformat --- lib/web/JsonpMainTemplatePlugin.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index 4a7ebcaf0..18e15b357 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -161,9 +161,13 @@ class JsonpMainTemplatePlugin { "}", "script.src = jsonpScriptSrc(chunkId);", crossOriginLoading - ? `if (script.src.indexOf(window.location.origin)) {${Template.indent( - `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - )}}` + ? Template.asString([ + "if (script.src.indexOf(window.location.origin)) {", + Template.indent( + `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) : "", "var timeout = setTimeout(function(){", Template.indent([ @@ -219,9 +223,13 @@ class JsonpMainTemplatePlugin { 'link.as = "script";', "link.href = jsonpScriptSrc(chunkId);", crossOriginLoading - ? `if (link.href.indexOf(window.location.origin)) {${Template.indent( - `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - )}}` + ? Template.asString([ + "if (link.href.indexOf(window.location.origin)) {", + Template.indent( + `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) : "" ]); } From cc3fa5964508fa3f1b90d51816a123a680b67315 Mon Sep 17 00:00:00 2001 From: Ron Korving Date: Mon, 19 Mar 2018 12:20:44 +0900 Subject: [PATCH 11/31] [DefinePlugin] Add ability to use function return values This adds the following API to DefinePlugin: new webpack.DefinePlugin({ BUILT_AT: webpack.DefinePlugin.runtimeValue(() => Date.now(), [fileDep, ...]) }) --- lib/DefinePlugin.js | 109 +++++++++++------- test/statsCases/define-plugin/123.txt | 1 + test/statsCases/define-plugin/321.txt | 1 + test/statsCases/define-plugin/expected.txt | 10 +- .../define-plugin/webpack.config.js | 24 ++++ 5 files changed, 103 insertions(+), 42 deletions(-) create mode 100644 test/statsCases/define-plugin/123.txt create mode 100644 test/statsCases/define-plugin/321.txt diff --git a/lib/DefinePlugin.js b/lib/DefinePlugin.js index 6114b0518..7f618a8d0 100644 --- a/lib/DefinePlugin.js +++ b/lib/DefinePlugin.js @@ -9,26 +9,43 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression"); const ParserHelpers = require("./ParserHelpers"); const NullFactory = require("./NullFactory"); -const stringifyObj = obj => { +class RuntimeValue { + constructor(fn, fileDependencies) { + this.fn = fn; + this.fileDependencies = fileDependencies || []; + } + + exec(parser) { + for (const fileDependency of this.fileDependencies) { + parser.state.module.buildInfo.fileDependencies.add(fileDependency); + } + + return this.fn(); + } +} + +const stringifyObj = (obj, parser) => { return ( "Object({" + Object.keys(obj) .map(key => { const code = obj[key]; - return JSON.stringify(key) + ":" + toCode(code); + return JSON.stringify(key) + ":" + toCode(code, parser); }) .join(",") + "})" ); }; -const toCode = code => { +const toCode = (code, parser) => { if (code === null) return "null"; else if (code === undefined) return "undefined"; + else if (code instanceof RuntimeValue) + return toCode(code.exec(parser), parser); else if (code instanceof RegExp && code.toString) return code.toString(); else if (typeof code === "function" && code.toString) return "(" + code.toString() + ")"; - else if (typeof code === "object") return stringifyObj(code); + else if (typeof code === "object") return stringifyObj(code, parser); else return code + ""; }; @@ -37,6 +54,10 @@ class DefinePlugin { this.definitions = definitions; } + static runtimeValue(fn, fileDependencies) { + return new RuntimeValue(fn, fileDependencies); + } + apply(compiler) { const definitions = this.definitions; compiler.hooks.compilation.tap( @@ -55,6 +76,7 @@ class DefinePlugin { if ( code && typeof code === "object" && + !(code instanceof RuntimeValue) && !(code instanceof RegExp) ) { walkDefinitions(code, prefix + key + "."); @@ -81,7 +103,6 @@ class DefinePlugin { if (isTypeof) key = key.replace(/^typeof\s+/, ""); let recurse = false; let recurseTypeof = false; - code = toCode(code); if (!isTypeof) { parser.hooks.canRename .for(key) @@ -99,24 +120,25 @@ class DefinePlugin { */ if (recurse) return; recurse = true; - const res = parser.evaluate(code); + const res = parser.evaluate(toCode(code, parser)); recurse = false; res.setRange(expr.range); return res; }); - parser.hooks.expression - .for(key) - .tap( - "DefinePlugin", - /__webpack_require__/.test(code) - ? ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - code - ) - : ParserHelpers.toConstantDependency(parser, code) - ); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = toCode(code, parser); + if (/__webpack_require__/.test(strCode)) { + return ParserHelpers.toConstantDependencyWithWebpackRequire( + parser, + strCode + )(expr); + } else { + return ParserHelpers.toConstantDependency(parser, strCode)( + expr + ); + } + }); } - const typeofCode = isTypeof ? code : "typeof (" + code + ")"; parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { /** * this is needed in case there is a recursion in the DefinePlugin @@ -128,12 +150,18 @@ class DefinePlugin { */ if (recurseTypeof) return; recurseTypeof = true; + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; const res = parser.evaluate(typeofCode); recurseTypeof = false; res.setRange(expr.range); return res; }); parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; const res = parser.evaluate(typeofCode); if (!res.isString()) return; return ParserHelpers.toConstantDependency( @@ -144,7 +172,6 @@ class DefinePlugin { }; const applyObjectDefine = (key, obj) => { - const code = stringifyObj(obj); parser.hooks.canRename .for(key) .tap("DefinePlugin", ParserHelpers.approve); @@ -153,29 +180,29 @@ class DefinePlugin { .tap("DefinePlugin", expr => new BasicEvaluatedExpression().setTruthy().setRange(expr.range) ); - parser.hooks.evaluateTypeof - .for(key) - .tap("DefinePlugin", ParserHelpers.evaluateToString("object")); - parser.hooks.expression - .for(key) - .tap( - "DefinePlugin", - /__webpack_require__/.test(code) - ? ParserHelpers.toConstantDependencyWithWebpackRequire( - parser, - code - ) - : ParserHelpers.toConstantDependency(parser, code) - ); - parser.hooks.typeof - .for(key) - .tap( - "DefinePlugin", - ParserHelpers.toConstantDependency( + parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { + return ParserHelpers.evaluateToString("object")(expr); + }); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = stringifyObj(obj, parser); + + if (/__webpack_require__/.test(strCode)) { + return ParserHelpers.toConstantDependencyWithWebpackRequire( parser, - JSON.stringify("object") - ) - ); + strCode + )(expr); + } else { + return ParserHelpers.toConstantDependency(parser, strCode)( + expr + ); + } + }); + parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + return ParserHelpers.toConstantDependency( + parser, + JSON.stringify("object") + )(expr); + }); }; walkDefinitions(definitions, ""); diff --git a/test/statsCases/define-plugin/123.txt b/test/statsCases/define-plugin/123.txt new file mode 100644 index 000000000..190a18037 --- /dev/null +++ b/test/statsCases/define-plugin/123.txt @@ -0,0 +1 @@ +123 diff --git a/test/statsCases/define-plugin/321.txt b/test/statsCases/define-plugin/321.txt new file mode 100644 index 000000000..3ae0b938f --- /dev/null +++ b/test/statsCases/define-plugin/321.txt @@ -0,0 +1 @@ +321 diff --git a/test/statsCases/define-plugin/expected.txt b/test/statsCases/define-plugin/expected.txt index 09dbcefb9..aadf36064 100644 --- a/test/statsCases/define-plugin/expected.txt +++ b/test/statsCases/define-plugin/expected.txt @@ -1,4 +1,4 @@ -Hash: 189d0d15eb46be80d1f9eaead63561588b554cc6 +Hash: 189d0d15eb46be80d1f9eaead63561588b554cc6932fcbff1d88af84338a Child Hash: 189d0d15eb46be80d1f9 Time: Xms @@ -13,5 +13,13 @@ Child Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names main.js 2.63 KiB 0 [emitted] main + Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built] +Child + Hash: 932fcbff1d88af84338a + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 2.64 KiB 0 [emitted] main Entrypoint main = main.js [0] ./index.js 24 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/define-plugin/webpack.config.js b/test/statsCases/define-plugin/webpack.config.js index 999dc282d..32d87e4f8 100644 --- a/test/statsCases/define-plugin/webpack.config.js +++ b/test/statsCases/define-plugin/webpack.config.js @@ -1,4 +1,11 @@ var webpack = require("../../../"); +var fs = require("fs"); +var join = require("path").join; + +function read(path) { + return JSON.stringify(fs.readFileSync(join(__dirname, path), "utf8")); +} + module.exports = [ { mode: "production", @@ -18,5 +25,22 @@ module.exports = [ VALUE: "321" }) ] + }, + + { + mode: "production", + entry: "./index", + plugins: [ + new webpack.DefinePlugin({ + VALUE: webpack.DefinePlugin.runtimeValue(() => read("123.txt"), [ + "./123.txt" + ]) + }), + new webpack.DefinePlugin({ + VALUE: webpack.DefinePlugin.runtimeValue(() => read("321.txt"), [ + "./321.txt" + ]) + }) + ] } ]; From 98ffc28e55c1067379d52bc8359b87459bab9086 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 30 Apr 2018 10:58:41 +0200 Subject: [PATCH 12/31] fix timestamp issue in WatchTestCases --- test/WatchTestCases.test.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test/WatchTestCases.test.js b/test/WatchTestCases.test.js index ea4a3c6f5..c549c35f2 100644 --- a/test/WatchTestCases.test.js +++ b/test/WatchTestCases.test.js @@ -11,7 +11,7 @@ const checkArrayExpectation = require("./checkArrayExpectation"); const Stats = require("../lib/Stats"); const webpack = require("../lib/webpack"); -function copyDiff(src, dest) { +function copyDiff(src, dest, initial) { if (!fs.existsSync(dest)) fs.mkdirSync(dest); const files = fs.readdirSync(src); files.forEach(filename => { @@ -19,12 +19,22 @@ function copyDiff(src, dest) { const destFile = path.join(dest, filename); const directory = fs.statSync(srcFile).isDirectory(); if (directory) { - copyDiff(srcFile, destFile); + copyDiff(srcFile, destFile, initial); } else { var content = fs.readFileSync(srcFile); - if (/^DELETE\s*$/.test(content.toString("utf-8"))) + if (/^DELETE\s*$/.test(content.toString("utf-8"))) { fs.unlinkSync(destFile); - else fs.writeFileSync(destFile, content); + } else { + fs.writeFileSync(destFile, content); + if (initial) { + const longTimeAgo = Date.now() - 1000 * 60 * 60 * 24; + fs.utimesSync( + destFile, + Date.now() - longTimeAgo, + Date.now() - longTimeAgo + ); + } + } } }); } @@ -135,7 +145,7 @@ describe("WatchTestCases", () => { let lastHash = ""; const currentWatchStepModule = require("./helpers/currentWatchStep"); currentWatchStepModule.step = run.name; - copyDiff(path.join(testDirectory, run.name), tempDirectory); + copyDiff(path.join(testDirectory, run.name), tempDirectory, true); setTimeout(() => { const compiler = webpack(options); @@ -304,7 +314,8 @@ describe("WatchTestCases", () => { currentWatchStepModule.step = run.name; copyDiff( path.join(testDirectory, run.name), - tempDirectory + tempDirectory, + false ); }, 1500); } else { From 345c501a95d9771380d3812df304a5771db4565c Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 30 Apr 2018 11:51:57 +0200 Subject: [PATCH 13/31] add test case for #6793 --- .../plugins/define-plugin/0/index.js | 15 +++++++++++++ .../plugins/define-plugin/0/module.js | 2 ++ .../plugins/define-plugin/0/module2.js | 2 ++ .../plugins/define-plugin/0/value.txt | 1 + .../plugins/define-plugin/1/value.txt | 1 + .../plugins/define-plugin/webpack.config.js | 22 +++++++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 test/watchCases/plugins/define-plugin/0/index.js create mode 100644 test/watchCases/plugins/define-plugin/0/module.js create mode 100644 test/watchCases/plugins/define-plugin/0/module2.js create mode 100644 test/watchCases/plugins/define-plugin/0/value.txt create mode 100644 test/watchCases/plugins/define-plugin/1/value.txt create mode 100644 test/watchCases/plugins/define-plugin/webpack.config.js diff --git a/test/watchCases/plugins/define-plugin/0/index.js b/test/watchCases/plugins/define-plugin/0/index.js new file mode 100644 index 000000000..f0b05c51d --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/index.js @@ -0,0 +1,15 @@ +it("should be able to use dynamic defines in watch mode", function() { + const module = require("./module"); + module.should.be.eql({ + default: WATCH_STEP, + type: "string" + }); +}); + +it("should not update a define when dependencies list is missing", function() { + const module2 = require("./module2"); + module2.should.be.eql({ + default: "0", + type: "string" + }); +}); diff --git a/test/watchCases/plugins/define-plugin/0/module.js b/test/watchCases/plugins/define-plugin/0/module.js new file mode 100644 index 000000000..272cd4dea --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/module.js @@ -0,0 +1,2 @@ +export default TEST_VALUE; +export const type = typeof TEST_VALUE; diff --git a/test/watchCases/plugins/define-plugin/0/module2.js b/test/watchCases/plugins/define-plugin/0/module2.js new file mode 100644 index 000000000..4bac84778 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/module2.js @@ -0,0 +1,2 @@ +export default TEST_VALUE2; +export const type = typeof TEST_VALUE2; diff --git a/test/watchCases/plugins/define-plugin/0/value.txt b/test/watchCases/plugins/define-plugin/0/value.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/value.txt @@ -0,0 +1 @@ +0 diff --git a/test/watchCases/plugins/define-plugin/1/value.txt b/test/watchCases/plugins/define-plugin/1/value.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/1/value.txt @@ -0,0 +1 @@ +1 diff --git a/test/watchCases/plugins/define-plugin/webpack.config.js b/test/watchCases/plugins/define-plugin/webpack.config.js new file mode 100644 index 000000000..113eb10e5 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/webpack.config.js @@ -0,0 +1,22 @@ +const path = require("path"); +const fs = require("fs"); +const webpack = require("../../../../"); +const valueFile = path.resolve( + __dirname, + "../../../js/watch-src/plugins/define-plugin/value.txt" +); +module.exports = { + plugins: [ + new webpack.DefinePlugin({ + TEST_VALUE: webpack.DefinePlugin.runtimeValue( + () => { + return JSON.stringify(fs.readFileSync(valueFile, "utf-8").trim()); + }, + [valueFile] + ), + TEST_VALUE2: webpack.DefinePlugin.runtimeValue(() => { + return JSON.stringify(fs.readFileSync(valueFile, "utf-8").trim()); + }, []) + }) + ] +}; From 309250a8d0d9001274516055dae7e5941ad68dde Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Thu, 17 May 2018 21:08:50 -0700 Subject: [PATCH 14/31] Fix stats snapshot --- test/__snapshots__/StatsTestCases.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index 74b351dd2..301df8fdf 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -1705,7 +1705,7 @@ exports[`StatsTestCases should print correct stats for preload 1`] = ` normal.js 130 bytes 1 [emitted] normal preloaded2.js 127 bytes 2 [emitted] preloaded2 preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 9.81 KiB 4 [emitted] main + main.js 9.8 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) From 9f5a5e729352fade350554dc420e48b20eda35c8 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Thu, 17 May 2018 21:11:15 -0700 Subject: [PATCH 15/31] Remove old fixture --- test/statsCases/preload/expected.txt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 test/statsCases/preload/expected.txt diff --git a/test/statsCases/preload/expected.txt b/test/statsCases/preload/expected.txt deleted file mode 100644 index ba3db08ae..000000000 --- a/test/statsCases/preload/expected.txt +++ /dev/null @@ -1,16 +0,0 @@ - Asset Size Chunks Chunk Names - preloaded.js 1.03 KiB 0 [emitted] preloaded - normal.js 130 bytes 1 [emitted] normal -preloaded2.js 127 bytes 2 [emitted] preloaded2 -preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 9.8 KiB 4 [emitted] main - inner.js 136 bytes 5 [emitted] inner - inner2.js 201 bytes 6 [emitted] inner2 -Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) -chunk {0} preloaded.js (preloaded) 226 bytes <{4}> >{5}< >{6}< (preload: {6} {5}) [rendered] -chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] -chunk {2} preloaded2.js (preloaded2) 0 bytes <{4}> [rendered] -chunk {3} preloaded3.js (preloaded3) 0 bytes <{4}> [rendered] -chunk {4} main.js (main) 424 bytes >{0}< >{1}< >{2}< >{3}< (preload: {2} {0} {3}) [entry] [rendered] -chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] -chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered] \ No newline at end of file From c222a6f33b23764c4816e89d9bb802d589302ed3 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 25 May 2018 16:41:20 +0300 Subject: [PATCH 16/31] feat: implement option for `HashedModuleIdes` plugin --- lib/WebpackOptionsApply.js | 3 +++ lib/WebpackOptionsDefaulter.js | 2 ++ schemas/WebpackOptions.json | 4 ++++ test/TestCases.template.js | 1 + .../optimization/hashed-module-ids/files/file1.js | 1 + .../optimization/hashed-module-ids/files/file2.js | 1 + .../optimization/hashed-module-ids/files/file3.js | 1 + .../optimization/hashed-module-ids/files/file4.js | 1 + .../optimization/hashed-module-ids/files/file5.js | 1 + .../optimization/hashed-module-ids/index.js | 10 ++++++++++ .../optimization/hashed-module-ids/webpack.config.js | 5 +++++ .../optimization/named-modules/files/file1.js | 1 + .../optimization/named-modules/files/file2.js | 1 + .../optimization/named-modules/files/file3.js | 1 + .../optimization/named-modules/files/file4.js | 1 + .../optimization/named-modules/files/file5.js | 1 + test/configCases/optimization/named-modules/index.js | 10 ++++++++++ .../optimization/named-modules/webpack.config.js | 5 +++++ 18 files changed, 50 insertions(+) create mode 100644 test/configCases/optimization/hashed-module-ids/files/file1.js create mode 100644 test/configCases/optimization/hashed-module-ids/files/file2.js create mode 100644 test/configCases/optimization/hashed-module-ids/files/file3.js create mode 100644 test/configCases/optimization/hashed-module-ids/files/file4.js create mode 100644 test/configCases/optimization/hashed-module-ids/files/file5.js create mode 100644 test/configCases/optimization/hashed-module-ids/index.js create mode 100644 test/configCases/optimization/hashed-module-ids/webpack.config.js create mode 100644 test/configCases/optimization/named-modules/files/file1.js create mode 100644 test/configCases/optimization/named-modules/files/file2.js create mode 100644 test/configCases/optimization/named-modules/files/file3.js create mode 100644 test/configCases/optimization/named-modules/files/file4.js create mode 100644 test/configCases/optimization/named-modules/files/file5.js create mode 100644 test/configCases/optimization/named-modules/index.js create mode 100644 test/configCases/optimization/named-modules/webpack.config.js diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index 0b9ba6c80..2fd511e4b 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -56,6 +56,7 @@ const RuntimeChunkPlugin = require("./optimize/RuntimeChunkPlugin"); const NoEmitOnErrorsPlugin = require("./NoEmitOnErrorsPlugin"); const NamedModulesPlugin = require("./NamedModulesPlugin"); const NamedChunksPlugin = require("./NamedChunksPlugin"); +const HashedModuleIdsPlugin = require("./HashedModuleIdsPlugin"); const DefinePlugin = require("./DefinePlugin"); const SizeLimitsPlugin = require("./performance/SizeLimitsPlugin"); @@ -328,6 +329,8 @@ class WebpackOptionsApply extends OptionsApply { new NoEmitOnErrorsPlugin().apply(compiler); if (options.optimization.namedModules) new NamedModulesPlugin().apply(compiler); + if (options.optimization.hashedModuleIds) + new HashedModuleIdsPlugin().apply(compiler); if (options.optimization.namedChunks) new NamedChunksPlugin().apply(compiler); if (options.optimization.nodeEnv) { diff --git a/lib/WebpackOptionsDefaulter.js b/lib/WebpackOptionsDefaulter.js index d947e6a97..a315efd1e 100644 --- a/lib/WebpackOptionsDefaulter.js +++ b/lib/WebpackOptionsDefaulter.js @@ -258,6 +258,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { "make", options => options.mode === "development" ); + // TODO enable for production mode in webpack 5 + this.set("optimization.hashedModuleIds", false); this.set( "optimization.namedChunks", "make", diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index f8d94d683..a392b3d03 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1546,6 +1546,10 @@ "description": "Use readable module identifiers for better debugging", "type": "boolean" }, + "hashedModuleIds": { + "description": "Use hashed module id instead module identifiers for better long term caching", + "type": "boolean" + }, "namedChunks": { "description": "Use readable chunk identifiers for better debugging", "type": "boolean" diff --git a/test/TestCases.template.js b/test/TestCases.template.js index 8168b8ee5..4c9825a27 100644 --- a/test/TestCases.template.js +++ b/test/TestCases.template.js @@ -29,6 +29,7 @@ const DEFAULT_OPTIMIZATIONS = { noEmitOnErrors: false, concatenateModules: false, namedModules: false, + hashedModuleIds: false, minimizer: [uglifyJsForTesting] }; diff --git a/test/configCases/optimization/hashed-module-ids/files/file1.js b/test/configCases/optimization/hashed-module-ids/files/file1.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file1.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file2.js b/test/configCases/optimization/hashed-module-ids/files/file2.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file2.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file3.js b/test/configCases/optimization/hashed-module-ids/files/file3.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file3.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file4.js b/test/configCases/optimization/hashed-module-ids/files/file4.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file4.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file5.js b/test/configCases/optimization/hashed-module-ids/files/file5.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file5.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/index.js b/test/configCases/optimization/hashed-module-ids/index.js new file mode 100644 index 000000000..8741cc817 --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/index.js @@ -0,0 +1,10 @@ +var path = require("path"); + +it("should have named modules ids", function() { + for (var i = 1; i <= 5; i++) { + var expectedModuleId = "file" + i + ".js"; + var moduleId = require("./files/file" + i + ".js"); + + expect(path.basename(moduleId)).not.toBe(expectedModuleId); + } +}); diff --git a/test/configCases/optimization/hashed-module-ids/webpack.config.js b/test/configCases/optimization/hashed-module-ids/webpack.config.js new file mode 100644 index 000000000..19d544d1d --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + optimization: { + hashedModuleIds: true + } +}; diff --git a/test/configCases/optimization/named-modules/files/file1.js b/test/configCases/optimization/named-modules/files/file1.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file1.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file2.js b/test/configCases/optimization/named-modules/files/file2.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file2.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file3.js b/test/configCases/optimization/named-modules/files/file3.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file3.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file4.js b/test/configCases/optimization/named-modules/files/file4.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file4.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file5.js b/test/configCases/optimization/named-modules/files/file5.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file5.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/index.js b/test/configCases/optimization/named-modules/index.js new file mode 100644 index 000000000..082bc1bda --- /dev/null +++ b/test/configCases/optimization/named-modules/index.js @@ -0,0 +1,10 @@ +var path = require("path"); + +it("should have named modules ids", function() { + for (var i = 1; i <= 5; i++) { + var expectedModuleId = "file" + i + ".js"; + var moduleId = require("./files/file" + i + ".js"); + + expect(path.basename(moduleId)).toBe(expectedModuleId); + } +}); diff --git a/test/configCases/optimization/named-modules/webpack.config.js b/test/configCases/optimization/named-modules/webpack.config.js new file mode 100644 index 000000000..10572c1da --- /dev/null +++ b/test/configCases/optimization/named-modules/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + optimization: { + namedModules: true + } +}; From 0933c0c5fcb3051f8d35a1a9a52610f501423f4f Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Thu, 31 May 2018 16:53:11 -0700 Subject: [PATCH 17/31] Update StatsTestCases snapshots --- .../__snapshots__/StatsTestCases.test.js.snap | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index cdd63b243..ac4e4fdb4 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -8,7 +8,7 @@ Child fitting: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] - f2e891598128a57b072c.js 11 KiB 1 [emitted] + f2e891598128a57b072c.js 11.2 KiB 1 [emitted] d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js f2e891598128a57b072c.js @@ -34,7 +34,7 @@ Child content-change: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] - f2e891598128a57b072c.js 11 KiB 1 [emitted] + f2e891598128a57b072c.js 11.2 KiB 1 [emitted] d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js f2e891598128a57b072c.js @@ -71,7 +71,7 @@ d6418937dfae4b3ee922.js 1 KiB 1 [emitted] 685acdc95ff4af957f47.js 1 KiB 7 [emitted] 606f48c13070850338b1.js 1.94 KiB 8 [emitted] c5a8eae840969538f450.js 1.94 KiB 9 [emitted] -c69b2f79fdf6e98907c4.js 9.68 KiB 10 [emitted] main +c69b2f79fdf6e98907c4.js 9.88 KiB 10 [emitted] main fcdf398c8972e4dcf788.js 1.94 KiB 11 [emitted] Entrypoint main = c69b2f79fdf6e98907c4.js chunk {0} fd868baa40dab4fc30fd.js 1.76 KiB <{10}> ={1}= ={2}= ={3}= ={7}= ={9}= [recorded] aggressive splitted @@ -498,7 +498,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.bundle.js 152 bytes 0 [emitted] 1.bundle.js 289 bytes 1 [emitted] - bundle.js 8.27 KiB 2 [emitted] main + bundle.js 8.47 KiB 2 [emitted] main 3.bundle.js 227 bytes 3 [emitted] Entrypoint main = bundle.js chunk {0} 0.bundle.js 22 bytes <{2}> [rendered] @@ -537,7 +537,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT 0.bundle.js 433 bytes 0 [emitted] 1.bundle.js 297 bytes 1 [emitted] 2.bundle.js 588 bytes 2 [emitted] - bundle.js 8.65 KiB main [emitted] main + bundle.js 8.85 KiB main [emitted] main Entrypoint main = bundle.js chunk {main} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] > ./index main @@ -985,7 +985,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT 0.js 305 bytes 0 [emitted] 1.js 314 bytes 1 [emitted] 2.js 308 bytes 2 [emitted] -entry.js 9.06 KiB 3 [emitted] entry +entry.js 9.27 KiB 3 [emitted] entry Entrypoint entry = entry.js [0] ./templates/bar.js 38 bytes {0} [optional] [built] [1] ./templates/baz.js 38 bytes {1} [optional] [built] @@ -1000,7 +1000,7 @@ Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 149 bytes 0 [emitted] -entry.js 8.51 KiB 1 [emitted] entry +entry.js 8.71 KiB 1 [emitted] entry Entrypoint entry = entry.js [0] ./modules/b.js 22 bytes {0} [built] [1] ./entry.js 120 bytes {1} [built] @@ -1029,7 +1029,7 @@ Child 2 chunks: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.bundle.js 632 bytes 0 [emitted] - bundle.js 8.26 KiB 1 [emitted] main + bundle.js 8.47 KiB 1 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 118 bytes <{0}> <{1}> >{0}< [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1046,7 +1046,7 @@ Child 3 chunks: Asset Size Chunks Chunk Names 0.bundle.js 494 bytes 0 [emitted] 1.bundle.js 245 bytes 1 [emitted] - bundle.js 8.26 KiB 2 [emitted] main + bundle.js 8.47 KiB 2 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 74 bytes <{0}> <{2}> >{0}< >{1}< [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1065,7 +1065,7 @@ Child 4 chunks: 0.bundle.js 236 bytes 0 [emitted] 1.bundle.js 245 bytes 1 [emitted] 2.bundle.js 323 bytes 2 [emitted] - bundle.js 8.26 KiB 3 [emitted] main + bundle.js 8.47 KiB 3 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 44 bytes <{2}> <{3}> [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1157,9 +1157,9 @@ exports[`StatsTestCases should print correct stats for module-deduplication 1`] 3.js 661 bytes 3 [emitted] 4.js 661 bytes 4 [emitted] 5.js 661 bytes 5 [emitted] -e1.js 9.4 KiB 6 [emitted] e1 -e2.js 9.43 KiB 7 [emitted] e2 -e3.js 9.45 KiB 8 [emitted] e3 +e1.js 9.61 KiB 6 [emitted] e1 +e2.js 9.63 KiB 7 [emitted] e2 +e3.js 9.65 KiB 8 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js @@ -1203,9 +1203,9 @@ exports[`StatsTestCases should print correct stats for module-deduplication-name async3.js 818 bytes 0 [emitted] async3 async1.js 818 bytes 1 [emitted] async1 async2.js 818 bytes 2 [emitted] async2 - e1.js 9.29 KiB 3 [emitted] e1 - e2.js 9.31 KiB 4 [emitted] e2 - e3.js 9.33 KiB 5 [emitted] e3 + e1.js 9.5 KiB 3 [emitted] e1 + e2.js 9.52 KiB 4 [emitted] e2 + e3.js 9.54 KiB 5 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js @@ -1337,7 +1337,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names chunk-containing-__a_js.js 313 bytes chunk-containing-__a_js [emitted] chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted] - entry.js 8.17 KiB entry [emitted] entry + entry.js 8.37 KiB entry [emitted] entry Entrypoint entry = entry.js [0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built] [1] ./modules/a.js 37 bytes {chunk-containing-__a_js} [built] @@ -1375,7 +1375,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT ab.js 183 bytes 1 [emitted] ab abd.js 277 bytes 2, 1 [emitted] abd cir2.js 299 bytes 3 [emitted] cir2 - main.js 9.07 KiB 4 [emitted] main + main.js 9.27 KiB 4 [emitted] main cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 chunk.js 190 bytes 6, 7 [emitted] chunk ac in ab.js 130 bytes 7 [emitted] ac in ab @@ -1672,7 +1672,7 @@ exports[`StatsTestCases should print correct stats for prefetch 1`] = ` normal.js 130 bytes 1 [emitted] normal prefetched2.js 127 bytes 2 [emitted] prefetched2 prefetched3.js 130 bytes 3 [emitted] prefetched3 - main.js 9.73 KiB 4 [emitted] main + main.js 9.93 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) @@ -1705,7 +1705,7 @@ exports[`StatsTestCases should print correct stats for preload 1`] = ` normal.js 130 bytes 1 [emitted] normal preloaded2.js 127 bytes 2 [emitted] preloaded2 preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 9.85 KiB 4 [emitted] main + main.js 10 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) @@ -1725,7 +1725,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.28 KiB 2 [emitted] main +main.js 8.48 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js chunk {0} 0.js 22 bytes <{2}> [rendered] @@ -1784,7 +1784,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.28 KiB 2 [emitted] main +main.js 8.48 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js [0] ./d.js 22 bytes {3} [built] @@ -1862,7 +1862,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.28 KiB 2 [emitted] main +main.js 8.48 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js chunk {0} 0.js 22 bytes <{2}> [rendered] @@ -1953,7 +1953,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration Asset Size Chunks Chunk Names 0.js 719 bytes 0 [emitted] main1.js 542 bytes 1 [emitted] main1 - runtime.js 8.73 KiB 2 [emitted] runtime + runtime.js 8.94 KiB 2 [emitted] runtime Entrypoint main1 = runtime.js main1.js [0] ./b.js 20 bytes {0} [built] [1] ./c.js 20 bytes {0} [built] @@ -1962,7 +1962,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration Child manifest is named entry: Asset Size Chunks Chunk Names 0.js 719 bytes 0 [emitted] - manifest.js 9.04 KiB 1 [emitted] manifest + manifest.js 9.24 KiB 1 [emitted] manifest main1.js 542 bytes 2 [emitted] main1 Entrypoint main1 = manifest.js main1.js Entrypoint manifest = manifest.js @@ -2068,7 +2068,7 @@ Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 481 bytes 0 [emitted] -main.js 9.31 KiB 1 [emitted] main +main.js 9.51 KiB 1 [emitted] main Entrypoint main = main.js [0] ./components/src/CompAB/utils.js 97 bytes {1} [built] harmony side effect evaluation ./utils [1] ./main.js + 1 modules 1:0-30 From 39d0bcb5951b4ceabb177c8ac2fafab879678fd7 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 7 Jun 2018 14:22:35 +0200 Subject: [PATCH 18/31] spacings --- lib/WebpackOptionsApply.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index 17562c3c7..f22ca8c30 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -354,10 +354,10 @@ class WebpackOptionsApply extends OptionsApply { } if (options.optimization.namedModules) { new NamedModulesPlugin().apply(compiler); - } + } if (options.optimization.hashedModuleIds) { new HashedModuleIdsPlugin().apply(compiler); - } + } if (options.optimization.namedChunks) { new NamedChunksPlugin().apply(compiler); } From 1943804f22ee58a91f2dbb2959fbb0a00b9514c9 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Tue, 12 Jun 2018 14:18:34 -0700 Subject: [PATCH 19/31] Fix tests --- .../__snapshots__/StatsTestCases.test.js.snap | 2742 +++++++++++++++++ .../configCases/web/prefetch-preload/index.js | 4 +- 2 files changed, 2745 insertions(+), 1 deletion(-) create mode 100644 test/__snapshots__/StatsTestCases.test.js.snap diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap new file mode 100644 index 000000000..a43663f00 --- /dev/null +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -0,0 +1,2742 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = ` +"Hash: 4aa5beb3bbe987f505a74aa5beb3bbe987f505a7 +Child fitting: + Hash: 4aa5beb3bbe987f505a7 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] + 2b4c8b62a524452d2de1.js 11.3 KiB 1 [emitted] + d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] + 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] + Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js 2b4c8b62a524452d2de1.js + chunk {0} 9ac13fb7087e9ff1b93e.js 916 bytes <{1}> <{2}> <{3}> + > ./g [4] ./index.js 7:0-13 + [7] ./g.js 916 bytes {0} [built] + chunk {1} 2b4c8b62a524452d2de1.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] + > ./index main + [3] ./e.js 899 bytes {1} [built] + [4] ./index.js 111 bytes {1} [built] + [6] ./f.js 900 bytes {1} [built] + chunk {2} d1ba53816ff760e185b0.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [0] ./b.js 899 bytes {2} [built] + [5] ./a.js 899 bytes {2} [built] + chunk {3} 7b5b0a943e9362bc88c6.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [1] ./c.js 899 bytes {3} [built] + [2] ./d.js 899 bytes {3} [built] +Child content-change: + Hash: 4aa5beb3bbe987f505a7 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] + 2b4c8b62a524452d2de1.js 11.3 KiB 1 [emitted] + d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] + 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] + Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js 2b4c8b62a524452d2de1.js + chunk {0} 9ac13fb7087e9ff1b93e.js 916 bytes <{1}> <{2}> <{3}> + > ./g [4] ./index.js 7:0-13 + [7] ./g.js 916 bytes {0} [built] + chunk {1} 2b4c8b62a524452d2de1.js 1.87 KiB ={2}= ={3}= >{0}< [entry] [rendered] + > ./index main + [3] ./e.js 899 bytes {1} [built] + [4] ./index.js 111 bytes {1} [built] + [6] ./f.js 900 bytes {1} [built] + chunk {2} d1ba53816ff760e185b0.js 1.76 KiB ={1}= ={3}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [0] ./b.js 899 bytes {2} [built] + [5] ./a.js 899 bytes {2} [built] + chunk {3} 7b5b0a943e9362bc88c6.js 1.76 KiB ={1}= ={2}= >{0}< [initial] [rendered] [recorded] aggressive splitted + > ./index main + [1] ./c.js 899 bytes {3} [built] + [2] ./d.js 899 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = ` +"Hash: 2e21ab9d4836a0caedb1 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +cf8697fa2c994f39a5d4.js 1.94 KiB 6, 7 [emitted] +fd868baa40dab4fc30fd.js 1.93 KiB 0 [emitted] +79c527bb5bf9cba1dc12.js 1.96 KiB 2 [emitted] +e9d82e81fefd7353e8df.js 1.94 KiB 3, 1 [emitted] +ae76098eeb55b9c448f2.js 1.01 KiB 4 [emitted] +05d92aaacfbffa4b7e56.js 1.94 KiB 5 [emitted] +d6418937dfae4b3ee922.js 1 KiB 1 [emitted] +685acdc95ff4af957f47.js 1 KiB 7 [emitted] +606f48c13070850338b1.js 1.94 KiB 8 [emitted] +c5a8eae840969538f450.js 1.94 KiB 9 [emitted] +7bf22146f3e40919bde5.js 9.9 KiB 10 [emitted] main +fcdf398c8972e4dcf788.js 1.94 KiB 11 [emitted] +Entrypoint main = 7bf22146f3e40919bde5.js +chunk {0} fd868baa40dab4fc30fd.js 1.76 KiB <{10}> ={1}= ={2}= ={3}= ={7}= ={9}= [recorded] aggressive splitted + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [0] ./b.js 899 bytes {0} {5} [built] + [1] ./d.js 899 bytes {0} {8} [built] +chunk {1} d6418937dfae4b3ee922.js 899 bytes <{10}> ={0}= ={2}= ={8}= + > ./c ./d ./e [11] ./index.js 3:0-30 + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + [2] ./e.js 899 bytes {1} {3} [built] +chunk {2} 79c527bb5bf9cba1dc12.js 1.76 KiB <{10}> ={0}= ={1}= ={11}= ={3}= ={6}= ={7}= ={9}= [recorded] aggressive splitted + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + > ./b ./d ./e ./f ./g [11] ./index.js 5:0-44 + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [3] ./f.js 899 bytes {2} [built] + [4] ./g.js 901 bytes {2} [built] +chunk {3} e9d82e81fefd7353e8df.js 1.76 KiB <{10}> ={0}= ={2}= ={7}= ={9}= [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [2] ./e.js 899 bytes {1} {3} [built] + [6] ./h.js 899 bytes {3} {11} [built] +chunk {4} ae76098eeb55b9c448f2.js 899 bytes <{10}> + > ./a [11] ./index.js 1:0-16 + [10] ./a.js 899 bytes {4} [built] +chunk {5} 05d92aaacfbffa4b7e56.js 1.76 KiB <{10}> + > ./b ./c [11] ./index.js 2:0-23 + [0] ./b.js 899 bytes {0} {5} [built] + [5] ./c.js 899 bytes {5} {8} [built] +chunk {6} cf8697fa2c994f39a5d4.js 1.76 KiB <{10}> ={11}= ={2}= + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + [8] ./j.js 901 bytes {6} {9} [built] + [9] ./k.js 899 bytes {6} {7} [built] +chunk {7} 685acdc95ff4af957f47.js 899 bytes <{10}> ={0}= ={2}= ={3}= ={9}= + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [9] ./k.js 899 bytes {6} {7} [built] +chunk {8} 606f48c13070850338b1.js 1.76 KiB <{10}> ={1}= [recorded] aggressive splitted + > ./c ./d ./e [11] ./index.js 3:0-30 + [1] ./d.js 899 bytes {0} {8} [built] + [5] ./c.js 899 bytes {5} {8} [built] +chunk {9} c5a8eae840969538f450.js 1.76 KiB <{10}> ={0}= ={2}= ={3}= ={7}= [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./h ./i ./j ./k [11] ./index.js 6:0-72 + [7] ./i.js 899 bytes {9} {11} [built] + [8] ./j.js 901 bytes {6} {9} [built] +chunk {10} 7bf22146f3e40919bde5.js (main) 248 bytes >{0}< >{1}< >{11}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< >{8}< >{9}< [entry] [rendered] + > ./index main + [11] ./index.js 248 bytes {10} [built] +chunk {11} fcdf398c8972e4dcf788.js 1.76 KiB <{10}> ={2}= ={6}= [rendered] [recorded] aggressive splitted + > ./f ./g ./h ./i ./j ./k [11] ./index.js 4:0-51 + [6] ./h.js 899 bytes {3} {11} [built] + [7] ./i.js 899 bytes {9} {11} [built]" +`; + +exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = ` +"Entrypoint main = main.js +chunk {0} 0.js 21 bytes <{3}> ={1}= ={2}= [rendered] reused as split chunk (cache group: default) + > [3] ./index.js 17:1-21:3 + > [3] ./index.js 2:1-5:3 + > ./a ./b [3] ./index.js 9:1-13:3 + [0] ./a.js 21 bytes {0} [built] +chunk {1} 1.js 21 bytes <{3}> ={0}= [rendered] + > ./a ./b [3] ./index.js 9:1-13:3 + [1] ./b.js 21 bytes {1} [built] +chunk {2} 2.js 21 bytes <{3}> ={0}= [rendered] + > [3] ./index.js 17:1-21:3 + [2] ./c.js 21 bytes {2} [built] +chunk {3} main.js (main) 515 bytes >{0}< >{1}< >{2}< [entry] [rendered] + > ./ main + [3] ./index.js 515 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for async-commons-chunk-auto 1`] = ` +"Child disabled: + Entrypoint main = disabled/main.js + Entrypoint a = disabled/a.js + Entrypoint b = disabled/b.js + Entrypoint c = disabled/c.js + chunk {0} disabled/async-g.js (async-g) 54 bytes <{1}> <{5}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [8] ./g.js 34 bytes {0} [built] + chunk {1} disabled/async-a.js (async-a) 216 bytes <{4}> >{0}< [rendered] + > ./a [7] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] + > ./b [7] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [4] ./b.js 72 bytes {2} {6} [built] + chunk {3} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] + > ./c [7] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] + chunk {4} disabled/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [7] ./index.js 147 bytes {4} [built] + chunk {5} disabled/a.js (a) 216 bytes >{0}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} disabled/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] + [4] ./b.js 72 bytes {2} {6} [built] + chunk {7} disabled/c.js (c) 167 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] + [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] +Child default: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/b.js + Entrypoint c = default/c.js + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {4} [built] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [5] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + > ./c [8] ./index.js 3:0-47 + [6] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + > ./c [8] ./index.js 3:0-47 + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [5] ./b.js 72 bytes {6} {11} [built] + chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + [6] ./c.js 72 bytes {7} {12} [built] +Child vendors: + Entrypoint main = vendors/main.js + Entrypoint a = vendors/vendors.js vendors/a.js + Entrypoint b = vendors/vendors.js vendors/b.js + Entrypoint c = vendors/vendors.js vendors/c.js + chunk {0} vendors/async-g.js (async-g) 54 bytes <{1}> <{4}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [9] ./g.js 34 bytes {0} [built] + chunk {1} vendors/async-a.js (async-a) 216 bytes <{5}> >{0}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [5] ./b.js 72 bytes {2} {7} [built] + chunk {3} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [4] ./node_modules/z.js 20 bytes {3} {4} [built] + [6] ./c.js 72 bytes {3} {8} [built] + chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{0}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./a a + > ./b b + > ./c c + [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] + [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] + [4] ./node_modules/z.js 20 bytes {3} {4} [built] + chunk {5} vendors/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} vendors/a.js (a) 176 bytes ={4}= >{0}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} vendors/b.js (b) 112 bytes ={4}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [5] ./b.js 72 bytes {2} {7} [built] + chunk {8} vendors/c.js (c) 112 bytes ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] + [6] ./c.js 72 bytes {3} {8} [built] +Child multiple-vendors: + Entrypoint main = multiple-vendors/main.js + Entrypoint a = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a.js + Entrypoint b = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/b.js + Entrypoint c = multiple-vendors/libs-x.js multiple-vendors/vendors~async-c~c.js multiple-vendors/c.js + chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} multiple-vendors/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} multiple-vendors/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} multiple-vendors/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} multiple-vendors/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child all: + Entrypoint main = all/main.js + Entrypoint a = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a.js + Entrypoint b = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/b.js + Entrypoint c = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~async-c~c.js all/c.js + chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} all/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} all/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} all/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} all/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built]" +`; + +exports[`StatsTestCases should print correct stats for chunk-module-id-range 1`] = ` +"Hash: 7d8eb8b4418c6ae6a262 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main2.js 4.85 KiB 0 [emitted] main2 +main1.js 4.86 KiB 1 [emitted] main1 +Entrypoint main1 = main1.js +Entrypoint main2 = main2.js +chunk {0} main2.js (main2) 136 bytes [entry] [rendered] + > ./main2 main2 + [0] ./e.js 20 bytes {0} [built] + [1] ./f.js 20 bytes {0} [built] + [2] ./main2.js 56 bytes {0} [built] + [100] ./d.js 20 bytes {0} {1} [built] + [101] ./a.js 20 bytes {0} {1} [built] +chunk {1} main1.js (main1) 136 bytes [entry] [rendered] + > ./main1 main1 + [3] ./b.js 20 bytes {1} [built] + [4] ./main1.js 56 bytes {1} [built] + [100] ./d.js 20 bytes {0} {1} [built] + [101] ./a.js 20 bytes {0} {1} [built] + [102] ./c.js 20 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for chunks 1`] = ` +"Hash: 7762656cf5adce7c4f04 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +0.bundle.js 152 bytes 0 [emitted] +1.bundle.js 289 bytes 1 [emitted] + bundle.js 8.49 KiB 2 [emitted] main +3.bundle.js 227 bytes 3 [emitted] +Entrypoint main = bundle.js +chunk {0} 0.bundle.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 + [2] ./b.js 22 bytes {0} [built] + amd require ./b [4] ./index.js 2:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.bundle.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 + [3] ./c.js 54 bytes {1} [built] + amd require ./c [4] ./index.js 3:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [4] ./index.js 51 bytes {2} [built] + single entry ./index main + factory:Xms building:Xms = Xms + [5] ./a.js 22 bytes {2} [built] + cjs require ./a [4] ./index.js 1:0-14 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {3} 3.bundle.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 + [0] ./d.js 22 bytes {3} [built] + require.ensure item ./d [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms + [1] ./e.js 22 bytes {3} [built] + require.ensure item ./e [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for chunks-development 1`] = ` +"Hash: e9e5a35c80318dd22050 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +0.bundle.js 433 bytes 0 [emitted] +1.bundle.js 297 bytes 1 [emitted] +2.bundle.js 588 bytes 2 [emitted] + bundle.js 8.87 KiB main [emitted] main +Entrypoint main = bundle.js +chunk {main} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [./a.js] 22 bytes {main} [built] + cjs require ./a [./index.js] 1:0-14 + cjs require ./a [./e.js] 1:0-14 + [./index.js] Xms -> factory:Xms building:Xms = Xms + [./index.js] 51 bytes {main} [built] + single entry ./index main + factory:Xms building:Xms = Xms +chunk {0} 0.bundle.js 54 bytes <{main}> >{2}< [rendered] + > ./c [./index.js] ./index.js 3:0-16 + [./c.js] 54 bytes {0} [built] + amd require ./c [./index.js] 3:0-16 + [./index.js] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.bundle.js 22 bytes <{main}> [rendered] + > ./b [./index.js] ./index.js 2:0-16 + [./b.js] 22 bytes {1} [built] + amd require ./b [./index.js] 2:0-16 + [./index.js] Xms -> factory:Xms building:Xms = Xms +chunk {2} 2.bundle.js 60 bytes <{0}> [rendered] + > [./c.js] ./c.js 1:0-52 + [./d.js] 22 bytes {2} [built] + require.ensure item ./d [./c.js] 1:0-52 + [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms + [./e.js] 38 bytes {2} [built] + require.ensure item ./e [./c.js] 1:0-52 + [./index.js] Xms -> [./c.js] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for circular-correctness 1`] = ` +"Entrypoint main = bundle.js +chunk {0} 0.bundle.js (a) 49 bytes <{2}> <{3}> >{3}< [rendered] + [1] ./module-a.js 49 bytes {0} [built] +chunk {1} 1.bundle.js (b) 49 bytes <{2}> <{3}> >{3}< [rendered] + [2] ./module-b.js 49 bytes {1} [built] +chunk {2} bundle.js (main) 98 bytes >{0}< >{1}< [entry] [rendered] + [3] ./index.js 98 bytes {2} [built] +chunk {3} 3.bundle.js (c) 98 bytes <{0}> <{1}> >{0}< >{1}< [rendered] + [0] ./module-c.js 98 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-disabled 1`] = ` +"Hash: c5ad40363e9aee54c089 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.57 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-enabled 1`] = ` +"Hash: c5ad40363e9aee54c089 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.57 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for color-enabled-custom 1`] = ` +"Hash: c5ad40363e9aee54c089 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.57 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-chunk-min-size-0 1`] = ` +"Hash: bace8077f1ed02050b2f +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry-1.js 6.6 KiB 0 [emitted] entry-1 +vendor-1~entry-1.js 314 bytes 1 [emitted] vendor-1~entry-1 +Entrypoint entry-1 = vendor-1~entry-1.js entry-1.js +[0] ./entry-1.js 145 bytes {0} [built] +[1] ./modules/a.js 22 bytes {1} [built] +[2] ./modules/b.js 22 bytes {1} [built] +[3] ./modules/c.js 22 bytes {1} [built] +[4] ./modules/d.js 22 bytes {0} [built] +[5] ./modules/e.js 22 bytes {0} [built] +[6] ./modules/f.js 22 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-chunk-min-size-Infinity 1`] = ` +"Hash: cb8c4bb6c365b0a67d67 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry-1.js 6.6 KiB 0 [emitted] entry-1 +vendor-1.js 314 bytes 1 [emitted] vendor-1 +Entrypoint entry-1 = vendor-1.js entry-1.js +[0] ./entry-1.js 145 bytes {0} [built] +[1] ./modules/a.js 22 bytes {1} [built] +[2] ./modules/b.js 22 bytes {1} [built] +[3] ./modules/c.js 22 bytes {1} [built] +[4] ./modules/d.js 22 bytes {0} [built] +[5] ./modules/e.js 22 bytes {0} [built] +[6] ./modules/f.js 22 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = ` +"Hash: 707868320b2a03412b3fe3b00ef4ecd794b284d6 +Child + Hash: 707868320b2a03412b3f + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + app.js 6.69 KiB 0 [emitted] app + vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor + Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js + [./constants.js] 87 bytes {1} [built] + [./entry-1.js] ./entry-1.js + 2 modules 190 bytes {0} [built] + | ./entry-1.js 67 bytes [built] + | ./submodule-a.js 59 bytes [built] + | ./submodule-b.js 59 bytes [built] +Child + Hash: e3b00ef4ecd794b284d6 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + app.js 6.7 KiB 0 [emitted] app + vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor + Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js + [./constants.js] 87 bytes {1} [built] + [./entry-2.js] ./entry-2.js + 2 modules 197 bytes {0} [built] + | ./entry-2.js 67 bytes [built] + | ./submodule-a.js 59 bytes [built] + | ./submodule-c.js 66 bytes [built]" +`; + +exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1`] = ` +"[0] ./index.js + 2 modules 119 bytes {0} [built] + | ./index.js 46 bytes [built] + | ModuleConcatenation bailout: Module is an entry point + | ./node_modules/pmodule/a.js 49 bytes [built] + | ./node_modules/pmodule/aa.js 24 bytes [built] +[1] ./node_modules/pmodule/index.js 63 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[2] ./node_modules/pmodule/b.js 49 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[3] ./node_modules/pmodule/bb.js 24 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[4] ./node_modules/pmodule/c.js 49 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk +[5] ./node_modules/pmodule/cc.js 24 bytes [built] + ModuleConcatenation bailout: Module is not in any chunk" +`; + +exports[`StatsTestCases should print correct stats for define-plugin 1`] = ` +"Hash: cfe08d4450db77f81610f4228fcb997ec81e2aa6 +Child + Hash: cfe08d4450db77f81610 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 3.6 KiB 0 [emitted] main + Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built] +Child + Hash: f4228fcb997ec81e2aa6 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 3.6 KiB 0 [emitted] main + Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for exclude-with-loader 1`] = ` +"Hash: 52eadc5de721f000106b +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 4.01 KiB 0 [emitted] main + + 1 hidden asset +Entrypoint main = bundle.js +[0] ./index.js 77 bytes {0} [built] +[1] ./a.txt 43 bytes {0} [built] + + 2 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for external 1`] = ` +"Hash: 7a4bb5500ee0eddeee44 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.71 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./index.js 17 bytes {0} [built] +[1] external \\"test\\" 42 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for filter-warnings 1`] = ` +"Hash: 4269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b44269d427a8c1110386b4 +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0] +Child + Hash: 4269d427a8c1110386b4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 2.89 KiB 0 [emitted] main + Entrypoint main = bundle.js + + WARNING in bundle.js from UglifyJs + Dropping side-effect-free statement [./index.js:6,0] + Dropping unused function someUnUsedFunction1 [./index.js:8,0] + Dropping unused function someUnUsedFunction2 [./index.js:9,0] + Dropping unused function someUnUsedFunction3 [./index.js:10,0] + Dropping unused function someUnUsedFunction4 [./index.js:11,0] + Dropping unused function someUnUsedFunction5 [./index.js:12,0] + Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] + Dropping unused function someRemoteUnUsedFunction2 [./a.js:4,0] + Dropping unused function someRemoteUnUsedFunction3 [./a.js:5,0] + Dropping unused function someRemoteUnUsedFunction4 [./a.js:6,0] + Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]" +`; + +exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` +"Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +chunk {0} c.js (c) 49 bytes <{3}> <{4}> >{1}< [rendered] + [1] ./module-c.js 49 bytes {0} [built] + import() ./module-c [2] ./module-b.js 1:0-47 + import() ./module-c [4] ./e2.js 1:0-47 +chunk {1} a.js (a) 49 bytes <{0}> <{2}> >{4}< [rendered] + [0] ./module-a.js 49 bytes {1} [built] + import() ./module-a [1] ./module-c.js 1:0-47 + import() ./module-a [3] ./e1.js 1:0-47 +chunk {2} e1.js (e1) 49 bytes >{1}< [entry] [rendered] + [3] ./e1.js 49 bytes {2} [built] + single entry ./e1 e1 +chunk {3} e2.js (e2) 49 bytes >{0}< [entry] [rendered] + [4] ./e2.js 49 bytes {3} [built] + single entry ./e2 e2 +chunk {4} b.js (b) 49 bytes <{1}> >{0}< [rendered] + [2] ./module-b.js 49 bytes {4} [built] + import() ./module-b [0] ./module-a.js 1:0-47" +`; + +exports[`StatsTestCases should print correct stats for graph-correctness-modules 1`] = ` +"Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +chunk {0} y.js (y) 0 bytes <{3}> <{4}> [rendered] + [3] ./module-y.js 0 bytes {0} [built] + import() ./module-y [0] ./module-x.js 1:0-47 +chunk {1} c.js (c) 49 bytes <{4}> <{5}> >{2}< [rendered] + [2] ./module-c.js 49 bytes {1} [built] + import() ./module-c [4] ./module-b.js 1:0-47 + import() ./module-c [6] ./e2.js 2:0-47 +chunk {2} a.js (a) 49 bytes <{1}> <{3}> >{5}< [rendered] + [1] ./module-a.js 49 bytes {2} [built] + import() ./module-a [2] ./module-c.js 1:0-47 + import() ./module-a [5] ./e1.js 2:0-47 +chunk {3} e1.js (e1) 119 bytes >{0}< >{2}< [entry] [rendered] + [0] ./module-x.js 49 bytes {3} {4} [built] + import() ./module-x [4] ./module-b.js 2:0-20 + harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 + harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 + [5] ./e1.js 70 bytes {3} [built] + single entry ./e1 e1 +chunk {4} e2.js (e2) 119 bytes >{0}< >{1}< [entry] [rendered] + [0] ./module-x.js 49 bytes {3} {4} [built] + import() ./module-x [4] ./module-b.js 2:0-20 + harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 + harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 + [6] ./e2.js 70 bytes {4} [built] + single entry ./e2 e2 +chunk {5} b.js (b) 179 bytes <{2}> >{1}< [rendered] + [4] ./module-b.js 179 bytes {5} [built] + import() ./module-b [1] ./module-a.js 1:0-47" +`; + +exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` +"Hash: 2a0d654db3e185182232 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 305 bytes 0 [emitted] + 1.js 314 bytes 1 [emitted] + 2.js 308 bytes 2 [emitted] +entry.js 9.28 KiB 3 [emitted] entry +Entrypoint entry = entry.js +[0] ./templates/bar.js 38 bytes {0} [optional] [built] +[1] ./templates/baz.js 38 bytes {1} [optional] [built] +[2] ./templates/foo.js 38 bytes {2} [optional] [built] +[3] ./entry.js 450 bytes {3} [built] +[4] ./templates lazy ^\\\\.\\\\/.*$ include: \\\\.js$ exclude: \\\\.noimport\\\\.js$ namespace object 160 bytes {3} [optional] [built]" +`; + +exports[`StatsTestCases should print correct stats for import-weak 1`] = ` +"Hash: 34cdd6c85db0facc427a +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 149 bytes 0 [emitted] +entry.js 8.73 KiB 1 [emitted] entry +Entrypoint entry = entry.js +[0] ./modules/b.js 22 bytes {0} [built] +[1] ./entry.js 120 bytes {1} [built] +[2] ./modules/a.js 37 bytes [built]" +`; + +exports[`StatsTestCases should print correct stats for import-with-invalid-options-comments 1`] = ` +"Built at: Thu Jan 01 1970 00:00:00 GMT +[0] ./chunk-a.js 27 bytes {2} [built] +[1] ./chunk-b.js 27 bytes {3} [built] +[2] ./chunk-c.js 27 bytes {4} [built] +[3] ./chunk-d.js 27 bytes {5} [built] +[4] ./chunk.js 401 bytes {0} [built] [3 warnings] +[5] ./index.js 50 bytes {1} [built] + +WARNING in ./chunk.js 4:11-77 +Compilation error while processing magic comment(-s): /* webpack Prefetch: 0, webpackChunkName: \\"notGoingToCompile-c\\" */: Unexpected identifier + @ ./index.js 1:0-49 + +WARNING in ./chunk.js 5:11-38 +Compilation error while processing magic comment(-s): /* webpackPrefetch: nope */: nope is not defined + @ ./index.js 1:0-49 + +WARNING in ./chunk.js 2:11-84 +Compilation error while processing magic comment(-s): /* webpackPrefetch: true, webpackChunkName: notGoingToCompileChunkName */: notGoingToCompileChunkName is not defined + @ ./index.js 1:0-49" +`; + +exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` +"Hash: 3f682d19df3a78cc355b84831557db9bd7a90e1a059dbb5576e98cee97e4f44eff82b7d35dbb5021 +Child 1 chunks: + Hash: 3f682d19df3a78cc355b + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + bundle.js 6.39 KiB 0 [emitted] main + Entrypoint main = bundle.js + chunk {0} bundle.js (main) 191 bytes <{0}> >{0}< [entry] [rendered] + [0] ./index.js 73 bytes {0} [built] + [1] ./a.js 22 bytes {0} [built] + [2] ./b.js 22 bytes {0} [built] + [3] ./c.js 30 bytes {0} [built] + [4] ./d.js 22 bytes {0} [built] + [5] ./e.js 22 bytes {0} [built] +Child 2 chunks: + Hash: 84831557db9bd7a90e1a + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 632 bytes 0 [emitted] + bundle.js 8.49 KiB 1 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 118 bytes <{0}> <{1}> >{0}< [rendered] + [0] ./d.js 22 bytes {0} [built] + [1] ./e.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + [3] ./b.js 22 bytes {0} [built] + [4] ./c.js 30 bytes {0} [built] + chunk {1} bundle.js (main) 73 bytes >{0}< [entry] [rendered] + [5] ./index.js 73 bytes {1} [built] +Child 3 chunks: + Hash: 059dbb5576e98cee97e4 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 494 bytes 0 [emitted] + 1.bundle.js 245 bytes 1 [emitted] + bundle.js 8.49 KiB 2 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 74 bytes <{0}> <{2}> >{0}< >{1}< [rendered] + [0] ./d.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + [4] ./c.js 30 bytes {0} [built] + chunk {1} 1.bundle.js 44 bytes <{0}> <{2}> [rendered] + [1] ./e.js 22 bytes {1} [built] + [3] ./b.js 22 bytes {1} [built] + chunk {2} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + [5] ./index.js 73 bytes {2} [built] +Child 4 chunks: + Hash: f44eff82b7d35dbb5021 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.bundle.js 236 bytes 0 [emitted] + 1.bundle.js 245 bytes 1 [emitted] + 2.bundle.js 323 bytes 2 [emitted] + bundle.js 8.49 KiB 3 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 44 bytes <{2}> <{3}> [rendered] + [0] ./d.js 22 bytes {0} [built] + [2] ./a.js 22 bytes {0} [built] + chunk {1} 1.bundle.js 44 bytes <{2}> <{3}> [rendered] + [1] ./e.js 22 bytes {1} [built] + [3] ./b.js 22 bytes {1} [built] + chunk {2} 2.bundle.js 30 bytes <{3}> >{0}< >{1}< [rendered] + [4] ./c.js 30 bytes {2} [built] + chunk {3} bundle.js (main) 73 bytes >{0}< >{1}< >{2}< [entry] [rendered] + [5] ./index.js 73 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for max-modules 1`] = ` +"Hash: 8e1f6d7b7886c5f4617d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 6.81 KiB 0 [emitted] main +Entrypoint main = main.js + [0] ./a.js?1 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[15] ./c.js?3 33 bytes {0} [built] +[17] ./c.js?4 33 bytes {0} [built] +[19] ./c.js?5 33 bytes {0} [built] +[23] ./c.js?7 33 bytes {0} [built] +[25] ./c.js?8 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[29] ./c.js?10 33 bytes {0} [built] + + 11 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for max-modules-default 1`] = ` +"Hash: 8e1f6d7b7886c5f4617d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 6.81 KiB 0 [emitted] main +Entrypoint main = main.js + [0] ./a.js?1 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[29] ./c.js?10 33 bytes {0} [built] + + 16 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for module-assets 1`] = ` +"Hash: e1ecf80df7148b69327b +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT +Entrypoint main = main.js +chunk {0} 0.js 68 bytes <{1}> [rendered] + [0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] + [1] ./node_modules/a/index.js 17 bytes {0} [built] +chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] + [2] ./index.js 12 bytes {1} [built] +[0] ./node_modules/a/1.png 51 bytes {0} [built] [1 asset] +[1] ./node_modules/a/index.js 17 bytes {0} [built] +[2] ./index.js 12 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` +"Asset Size Chunks Chunk Names + 0.js 730 bytes 0, 5 [emitted] + 1.js 730 bytes 1, 4 [emitted] + 2.js 730 bytes 2, 3 [emitted] + 3.js 661 bytes 3 [emitted] + 4.js 661 bytes 4 [emitted] + 5.js 661 bytes 5 [emitted] +e1.js 9.63 KiB 6 [emitted] e1 +e2.js 9.65 KiB 7 [emitted] e2 +e3.js 9.67 KiB 8 [emitted] e3 +Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +Entrypoint e3 = e3.js +chunk {0} 0.js 37 bytes <{7}> <{8}> [rendered] + [2] ./d.js 9 bytes {0} {6} [built] + [5] ./async1.js 28 bytes {0} {5} [built] +chunk {1} 1.js 37 bytes <{6}> <{8}> [rendered] + [3] ./f.js 9 bytes {1} {7} [built] + [6] ./async2.js 28 bytes {1} {4} [built] +chunk {2} 2.js 37 bytes <{6}> <{7}> [rendered] + [4] ./h.js 9 bytes {2} {8} [built] + [7] ./async3.js 28 bytes {2} {3} [built] +chunk {3} 3.js 28 bytes <{8}> [rendered] + [7] ./async3.js 28 bytes {2} {3} [built] +chunk {4} 4.js 28 bytes <{7}> [rendered] + [6] ./async2.js 28 bytes {1} {4} [built] +chunk {5} 5.js 28 bytes <{6}> [rendered] + [5] ./async1.js 28 bytes {0} {5} [built] +chunk {6} e1.js (e1) 152 bytes >{1}< >{2}< >{5}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [2] ./d.js 9 bytes {0} {6} [built] + [8] ./e1.js 116 bytes {6} [built] + [9] ./c.js 9 bytes {6} [built] +chunk {7} e2.js (e2) 152 bytes >{0}< >{2}< >{4}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [3] ./f.js 9 bytes {1} {7} [built] + [10] ./e2.js 116 bytes {7} [built] + [11] ./e.js 9 bytes {7} [built] +chunk {8} e3.js (e3) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] + [0] ./b.js 9 bytes {6} {7} {8} [built] + [1] ./a.js 9 bytes {6} {7} {8} [built] + [4] ./h.js 9 bytes {2} {8} [built] + [12] ./e3.js 116 bytes {8} [built] + [13] ./g.js 9 bytes {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` +" Asset Size Chunks Chunk Names +async3.js 818 bytes 0 [emitted] async3 +async1.js 818 bytes 1 [emitted] async1 +async2.js 818 bytes 2 [emitted] async2 + e1.js 9.51 KiB 3 [emitted] e1 + e2.js 9.53 KiB 4 [emitted] e2 + e3.js 9.55 KiB 5 [emitted] e3 +Entrypoint e1 = e1.js +Entrypoint e2 = e2.js +Entrypoint e3 = e3.js +chunk {0} async3.js (async3) 89 bytes <{2}> <{5}> >{1}< [rendered] + [4] ./h.js 9 bytes {0} {5} [built] + [7] ./async3.js 80 bytes {0} [built] +chunk {1} async1.js (async1) 89 bytes <{0}> <{3}> >{2}< [rendered] + [2] ./d.js 9 bytes {1} {3} [built] + [5] ./async1.js 80 bytes {1} [built] +chunk {2} async2.js (async2) 89 bytes <{1}> <{4}> >{0}< [rendered] + [3] ./f.js 9 bytes {2} {4} [built] + [6] ./async2.js 80 bytes {2} [built] +chunk {3} e1.js (e1) 144 bytes >{1}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [2] ./d.js 9 bytes {1} {3} [built] + [8] ./e1.js 108 bytes {3} [built] + [9] ./c.js 9 bytes {3} [built] +chunk {4} e2.js (e2) 144 bytes >{2}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [3] ./f.js 9 bytes {2} {4} [built] + [10] ./e2.js 108 bytes {4} [built] + [11] ./e.js 9 bytes {4} [built] +chunk {5} e3.js (e3) 144 bytes >{0}< [entry] [rendered] + [0] ./b.js 9 bytes {3} {4} {5} [built] + [1] ./a.js 9 bytes {3} {4} {5} [built] + [4] ./h.js 9 bytes {0} {5} [built] + [12] ./e3.js 108 bytes {5} [built] + [13] ./g.js 9 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for module-trace-disabled-in-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.75 KiB 0 main +Entrypoint main = main.js +[0] ./index.js 25 bytes {0} [built] + +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-disabled-in-error'" +`; + +exports[`StatsTestCases should print correct stats for module-trace-enabled-in-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.75 KiB 0 main +Entrypoint main = main.js +[0] ./index.js 25 bytes {0} [built] + +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-enabled-in-error' + @ ./index.js 1:0-25" +`; + +exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = ` +"Child + Chunk Group main = main.js + Chunk Group async-a = async-a~async-b.js async-a.js + Chunk Group async-b = async-a~async-b.js async-b.js + Chunk Group async-c = vendors.js async-c.js + chunk {0} async-a~async-b.js (async-a~async-b) 133 bytes <{5}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [6] ./index.js 1:0-47 + > ./b [6] ./index.js 2:0-47 + [0] ./shared.js 133 bytes {0} [built] + chunk {1} async-a.js (async-a) 40 bytes <{5}> ={0}= [rendered] + > ./a [6] ./index.js 1:0-47 + [3] ./a.js 40 bytes {1} [built] + chunk {2} async-b.js (async-b) 40 bytes <{5}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [4] ./b.js 40 bytes {2} [built] + chunk {3} async-c.js (async-c) 45 bytes <{5}> ={4}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 45 bytes {3} [built] + chunk {4} vendors.js (vendors) 40 bytes <{5}> ={3}= [rendered] split chunk (cache group: vendors) (name: vendors) + > ./c [6] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {4} [built] + [2] ./node_modules/y.js 20 bytes {4} [built] + chunk {5} main.js (main) 146 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [6] ./index.js 146 bytes {5} [built] +Child + Entrypoint main = main.js + Chunk Group async-a = async-a~async-b.js async-a.js + Chunk Group async-b = async-a~async-b.js async-b.js + Chunk Group async-c = vendors.js async-c.js + chunk {0} async-a~async-b.js (async-a~async-b) 133 bytes <{5}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [6] ./index.js 1:0-47 + > ./b [6] ./index.js 2:0-47 + [0] ./shared.js 133 bytes {0} [built] + chunk {1} async-a.js (async-a) 40 bytes <{5}> ={0}= [rendered] + > ./a [6] ./index.js 1:0-47 + [3] ./a.js 40 bytes {1} [built] + chunk {2} async-b.js (async-b) 40 bytes <{5}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [4] ./b.js 40 bytes {2} [built] + chunk {3} async-c.js (async-c) 45 bytes <{5}> ={4}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 45 bytes {3} [built] + chunk {4} vendors.js (vendors) 40 bytes <{5}> ={3}= [rendered] split chunk (cache group: vendors) (name: vendors) + > ./c [6] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {4} [built] + [2] ./node_modules/y.js 20 bytes {4} [built] + chunk {5} main.js (main) 146 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [6] ./index.js 146 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for named-chunks-plugin 1`] = ` +"Hash: ae58e4539a3d3b521cc7 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + entry.js 6.45 KiB entry [emitted] entry +vendor.js 269 bytes vendor [emitted] vendor +Entrypoint entry = vendor.js entry.js +[./entry.js] 72 bytes {entry} [built] +[./modules/a.js] 22 bytes {vendor} [built] +[./modules/b.js] 22 bytes {vendor} [built] +[./modules/c.js] 22 bytes {entry} [built]" +`; + +exports[`StatsTestCases should print correct stats for named-chunks-plugin-async 1`] = ` +"Hash: b6aa15eeabc33e889828 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +chunk-containing-__a_js.js 313 bytes chunk-containing-__a_js [emitted] +chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted] + entry.js 8.39 KiB entry [emitted] entry +Entrypoint entry = entry.js +[0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built] +[1] ./modules/a.js 37 bytes {chunk-containing-__a_js} [built] +[2] ./entry.js 47 bytes {entry} [built]" +`; + +exports[`StatsTestCases should print correct stats for no-emit-on-errors-plugin-with-child-error 1`] = ` +"Hash: 6a246e5dec75240f30bf +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + child.js 3.57 KiB +bundle.js 3.57 KiB 0 main +Entrypoint main = bundle.js +[0] ./index.js 0 bytes {0} [built] + +WARNING in configuration +The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. +You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ +Child child: + Asset Size Chunks Chunk Names + child.js 3.57 KiB 0 child + Entrypoint child = child.js + [0] ./index.js 0 bytes {0} [built] + + ERROR in forced error" +`; + +exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` +"Hash: c52867ded6f77bcf50cc +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + cir1.js 299 bytes 0 [emitted] cir1 + ab.js 183 bytes 1 [emitted] ab + abd.js 277 bytes 2, 1 [emitted] abd + cir2.js 299 bytes 3 [emitted] cir2 + main.js 9.29 KiB 4 [emitted] main +cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 + chunk.js 190 bytes 6, 7 [emitted] chunk + ac in ab.js 130 bytes 7 [emitted] ac in ab +Entrypoint main = main.js +chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> >{5}< [rendered] + > [3] ./circular2.js 1:0-79 + > [3] ./circular2.js 1:0-79 + > [8] ./index.js 13:0-54 + [2] ./circular1.js 81 bytes {0} [built] +chunk {1} ab.js (ab) 0 bytes <{4}> >{7}< [rendered] + > [8] ./index.js 1:0-6:8 + [0] ./modules/a.js 0 bytes {1} {2} [built] + [1] ./modules/b.js 0 bytes {1} {2} [built] +chunk {2} abd.js (abd) 0 bytes <{4}> >{6}< [rendered] + > [8] ./index.js 8:0-11:9 + [0] ./modules/a.js 0 bytes {1} {2} [built] + [1] ./modules/b.js 0 bytes {1} {2} [built] + [6] ./modules/d.js 0 bytes {2} {6} [built] +chunk {3} cir2.js (cir2) 81 bytes <{4}> >{0}< [rendered] + > [8] ./index.js 14:0-54 + [3] ./circular2.js 81 bytes {3} {5} [built] +chunk {4} main.js (main) 523 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./index main + [4] ./modules/f.js 0 bytes {4} [built] + [8] ./index.js 523 bytes {4} [built] +chunk {5} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> [rendered] + > [2] ./circular1.js 1:0-79 + > [2] ./circular1.js 1:0-79 + [3] ./circular2.js 81 bytes {3} {5} [built] + [7] ./modules/e.js 0 bytes {5} [built] +chunk {6} chunk.js (chunk) 0 bytes <{2}> <{7}> [rendered] + > [8] ./index.js 3:2-4:13 + > [8] ./index.js 9:1-10:12 + [5] ./modules/c.js 0 bytes {6} {7} [built] + [6] ./modules/d.js 0 bytes {2} {6} [built] +chunk {7} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] + > [8] ./index.js 2:1-5:15 + [5] ./modules/c.js 0 bytes {6} {7} [built]" +`; + +exports[`StatsTestCases should print correct stats for parse-error 1`] = ` +" Asset Size Chunks Chunk Names +main.js 4.01 KiB 0 main +Entrypoint main = main.js +[0] ./b.js 169 bytes {0} [built] [failed] [1 error] +[1] ./index.js + 1 modules 35 bytes {0} [built] + | ./index.js 15 bytes [built] + | ./a.js 15 bytes [built] + +ERROR in ./b.js 6:7 +Module parse failed: Unexpected token (6:7) +You may need an appropriate loader to handle this file type. +| includes +| a +> parser ) +| error +| in + @ ./a.js 2:0-13 + @ ./index.js" +`; + +exports[`StatsTestCases should print correct stats for performance-different-mode-and-target 1`] = ` +"Hash: b27a7019f90a13ead012bb84b396eb1e98365d94fb930f6aa3329ab03a278deb0030bfebe86abb37a1cddcae25eb52f3112b62c8b61bc84829d26b13ae06efe5f0099a11af36 +Child + Hash: b27a7019f90a13ead012 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-web.js 297 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-web.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-web.js (297 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (297 KiB) + warning.pro-web.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/ +Child + Hash: bb84b396eb1e98365d94 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-webworker.js 297 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-webworker.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-webworker.js (297 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (297 KiB) + warning.pro-webworker.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/ +Child + Hash: fb930f6aa3329ab03a27 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.pro-node.js 297 KiB 0 [emitted] main + Entrypoint main = no-warning.pro-node.js + [0] ./index.js 293 KiB {0} [built] +Child + Hash: 8deb0030bfebe86abb37 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-web.js 1.72 MiB main [emitted] main + Entrypoint main = no-warning.dev-web.js + [./index.js] 293 KiB {main} [built] +Child + Hash: a1cddcae25eb52f3112b + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-node.js 1.72 MiB main [emitted] main + Entrypoint main = no-warning.dev-node.js + [./index.js] 293 KiB {main} [built] +Child + Hash: 62c8b61bc84829d26b13 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + no-warning.dev-web-with-limit-set.js 1.72 MiB main [emitted] [big] main + Entrypoint main [big] = no-warning.dev-web-with-limit-set.js + [./index.js] 293 KiB {main} [built] +Child + Hash: ae06efe5f0099a11af36 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + warning.pro-node-with-hints-set.js 297 KiB 0 [emitted] [big] main + Entrypoint main [big] = warning.pro-node-with-hints-set.js + [0] ./index.js 293 KiB {0} [built] + + WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). + This can impact web performance. + Assets: + warning.pro-node-with-hints-set.js (297 KiB) + + WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. + Entrypoints: + main (297 KiB) + warning.pro-node-with-hints-set.js + + + WARNING in webpack performance recommendations: + You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. + For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for performance-disabled 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 301 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for performance-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 301 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (301 KiB) + +ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (301 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for performance-no-async-chunks-shown 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 297 KiB 0 [emitted] [big] main + sec.js 3.91 KiB 1 [emitted] sec +Entrypoint main [big] = main.js +Entrypoint sec = sec.js +[0] ./b.js 22 bytes {0} {1} [built] +[1] ./index.js 32 bytes {0} [built] +[2] ./a.js 293 KiB {0} [built] +[3] ./index2.js 48 bytes {1} [built] +[4] ./c.js 22 bytes {1} [built] +[5] ./d.js 22 bytes {1} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (297 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (297 KiB) + main.js + + +WARNING in webpack performance recommendations: +You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. +For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for performance-no-hints 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 301 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for performance-oversize-limit-error 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 297 KiB 0 [emitted] [big] main + sec.js 297 KiB 1 [emitted] [big] sec +Entrypoint main [big] = main.js +Entrypoint sec [big] = sec.js +[0] ./a.js 293 KiB {0} {1} [built] +[1] ./index.js 16 bytes {0} [built] +[2] ./index2.js 16 bytes {1} [built] + +ERROR in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (297 KiB) + sec.js (297 KiB) + +ERROR in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (297 KiB) + main.js + sec (297 KiB) + sec.js + + +ERROR in webpack performance recommendations: +You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. +For more info visit https://webpack.js.org/guides/code-splitting/" +`; + +exports[`StatsTestCases should print correct stats for prefetch 1`] = ` +" Asset Size Chunks Chunk Names + prefetched.js 475 bytes 0 [emitted] prefetched + normal.js 130 bytes 1 [emitted] normal +prefetched2.js 127 bytes 2 [emitted] prefetched2 +prefetched3.js 130 bytes 3 [emitted] prefetched3 + main.js 9.86 KiB 4 [emitted] main + inner.js 136 bytes 5 [emitted] inner + inner2.js 201 bytes 6 [emitted] inner2 +Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) +chunk {0} prefetched.js (prefetched) 228 bytes <{4}> >{5}< >{6}< (prefetch: {6} {5}) [rendered] +chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] +chunk {2} prefetched2.js (prefetched2) 0 bytes <{4}> [rendered] +chunk {3} prefetched3.js (prefetched3) 0 bytes <{4}> [rendered] +chunk {4} main.js (main) 436 bytes >{0}< >{1}< >{2}< >{3}< (prefetch: {2} {0} {3}) [entry] [rendered] +chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] +chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` +"chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] +chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] +chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] +chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] +chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] +chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] +chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] +chunk {7} b2.js (b2) 0 bytes <{1}> [rendered] +chunk {8} b3.js (b3) 0 bytes <{1}> [rendered] +chunk {9} a1.js (a1) 0 bytes <{0}> [rendered] +chunk {10} a2.js (a2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for preload 1`] = ` +" Asset Size Chunks Chunk Names + preloaded.js 467 bytes 0 [emitted] preloaded + normal.js 130 bytes 1 [emitted] normal +preloaded2.js 127 bytes 2 [emitted] preloaded2 +preloaded3.js 130 bytes 3 [emitted] preloaded3 + main.js 10.1 KiB 4 [emitted] main + inner.js 136 bytes 5 [emitted] inner + inner2.js 201 bytes 6 [emitted] inner2 +Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) +chunk {0} preloaded.js (preloaded) 226 bytes <{4}> >{5}< >{6}< (preload: {6} {5}) [rendered] +chunk {1} normal.js (normal) 0 bytes <{4}> [rendered] +chunk {2} preloaded2.js (preloaded2) 0 bytes <{4}> [rendered] +chunk {3} preloaded3.js (preloaded3) 0 bytes <{4}> [rendered] +chunk {4} main.js (main) 424 bytes >{0}< >{1}< >{2}< >{3}< (preload: {2} {0} {3}) [entry] [rendered] +chunk {5} inner.js (inner) 0 bytes <{0}> [rendered] +chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" +`; + +exports[`StatsTestCases should print correct stats for preset-detailed 1`] = ` +"Hash: 2eb3274d0272da6a7a14 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 8.5 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +chunk {0} 0.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 +chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 +chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main +chunk {3} 3.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 +[0] ./d.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[1] ./e.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[2] ./b.js 22 bytes {0} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[3] ./c.js 54 bytes {1} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[4] ./index.js 51 bytes {2} [depth 0] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[5] ./a.js 22 bytes {2} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module" +`; + +exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-errors-only-error 1`] = ` +" +ERROR in ./index.js +Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/preset-errors-only-error' + @ ./index.js 1:0-25" +`; + +exports[`StatsTestCases should print correct stats for preset-minimal 1`] = `" 6 modules"`; + +exports[`StatsTestCases should print correct stats for preset-minimal-simple 1`] = `" 1 module"`; + +exports[`StatsTestCases should print correct stats for preset-mixed-array 1`] = ` +"Child minimal: + 1 module +Child verbose: + Entrypoint main = main.js + [0] ./index.js 8 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for preset-none 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-none-array 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-none-error 1`] = `""`; + +exports[`StatsTestCases should print correct stats for preset-normal 1`] = ` +"Hash: 2eb3274d0272da6a7a14 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 8.5 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 51 bytes {2} [built] +[5] ./a.js 22 bytes {2} [built]" +`; + +exports[`StatsTestCases should print correct stats for preset-normal-performance 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 301 KiB 2 [emitted] [big] main + 3.js 227 bytes 3 [emitted] +Entrypoint main [big] = main.js +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (301 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (301 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for preset-normal-performance-ensure-filter-sourcemaps 1`] = ` +"Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 182 bytes 0 [emitted] + 1.js 319 bytes 1 [emitted] + main.js 301 KiB 2 [emitted] [big] main + 3.js 257 bytes 3 [emitted] + 0.js.map 156 bytes 0 [emitted] + 1.js.map 197 bytes 1 [emitted] +main.js.map 1.72 MiB 2 [emitted] main + 3.js.map 214 bytes 3 [emitted] +Entrypoint main [big] = main.js main.js.map +[0] ./d.js 22 bytes {3} [built] +[1] ./e.js 22 bytes {3} [built] +[2] ./b.js 22 bytes {0} [built] +[3] ./c.js 54 bytes {1} [built] +[4] ./index.js 52 bytes {2} [built] +[5] ./a.js 293 KiB {2} [built] + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + main.js (301 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (301 KiB) + main.js +" +`; + +exports[`StatsTestCases should print correct stats for preset-verbose 1`] = ` +"Hash: 2eb3274d0272da6a7a14 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 152 bytes 0 [emitted] + 1.js 289 bytes 1 [emitted] +main.js 8.5 KiB 2 [emitted] main + 3.js 227 bytes 3 [emitted] +Entrypoint main = main.js +chunk {0} 0.js 22 bytes <{2}> [rendered] + > ./b [4] ./index.js 2:0-16 + [2] ./b.js 22 bytes {0} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + amd require ./b [4] ./index.js 2:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {1} 1.js 54 bytes <{2}> >{3}< [rendered] + > ./c [4] ./index.js 3:0-16 + [3] ./c.js 54 bytes {1} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + amd require ./c [4] ./index.js 3:0-16 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {2} main.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] + > ./index main + [4] ./index.js 51 bytes {2} [depth 0] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + single entry ./index main + factory:Xms building:Xms = Xms + [5] ./a.js 22 bytes {2} [depth 1] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + cjs require ./a [4] ./index.js 1:0-14 + [4] Xms -> factory:Xms building:Xms = Xms +chunk {3} 3.js 44 bytes <{1}> [rendered] + > [3] ./c.js 1:0-52 + [0] ./d.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + require.ensure item ./d [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms + [1] ./e.js 22 bytes {3} [depth 2] [built] + ModuleConcatenation bailout: Module is not an ECMAScript module + require.ensure item ./e [3] ./c.js 1:0-52 + [4] Xms -> [3] Xms -> factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for resolve-plugin-context 1`] = ` +"Hash: f866085f4874b382c7c6 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 3.97 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./node_modules/xyz/index.js 0 bytes {0} [built] +[1] ./index.js 48 bytes {0} [built] +[2] ./node_modules/abc/index.js 16 bytes {0} [built] +[3] ./node_modules/def/index.js 16 bytes {0} [built] +[4] ./node_modules/def/node_modules/xyz/index.js 0 bytes {0} [built]" +`; + +exports[`StatsTestCases should print correct stats for reverse-sort-modules 1`] = ` +"Hash: 8e1f6d7b7886c5f4617d +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 6.81 KiB 0 [emitted] main +Entrypoint main = main.js +[29] ./c.js?10 33 bytes {0} [built] +[27] ./c.js?9 33 bytes {0} [built] +[25] ./c.js?8 33 bytes {0} [built] +[23] ./c.js?7 33 bytes {0} [built] +[19] ./c.js?5 33 bytes {0} [built] +[17] ./c.js?4 33 bytes {0} [built] +[15] ./c.js?3 33 bytes {0} [built] +[13] ./c.js?2 33 bytes {0} [built] +[11] ./c.js?1 33 bytes {0} [built] +[10] ./index.js 181 bytes {0} [built] + [9] ./a.js?10 33 bytes {0} [built] + [8] ./a.js?9 33 bytes {0} [built] + [7] ./a.js?8 33 bytes {0} [built] + [6] ./a.js?7 33 bytes {0} [built] + [5] ./a.js?6 33 bytes {0} [built] + [4] ./a.js?5 33 bytes {0} [built] + [3] ./a.js?4 33 bytes {0} [built] + [2] ./a.js?3 33 bytes {0} [built] + [1] ./a.js?2 33 bytes {0} [built] + [0] ./a.js?1 33 bytes {0} [built] + + 11 hidden modules" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk 1`] = ` +"Entrypoint e1 = runtime~e1.js e1.js +Entrypoint e2 = runtime~e2.js e2.js" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk-integration 1`] = ` +"Child base: + Asset Size Chunks Chunk Names + 0.js 719 bytes 0 [emitted] + main1.js 542 bytes 1 [emitted] main1 + runtime.js 8.95 KiB 2 [emitted] runtime + Entrypoint main1 = runtime.js main1.js + [0] ./b.js 20 bytes {0} [built] + [1] ./c.js 20 bytes {0} [built] + [2] ./d.js 20 bytes {0} [built] + [3] ./main1.js 66 bytes {1} [built] +Child manifest is named entry: + Asset Size Chunks Chunk Names + 0.js 719 bytes 0 [emitted] + manifest.js 9.26 KiB 1 [emitted] manifest + main1.js 542 bytes 2 [emitted] main1 + Entrypoint main1 = manifest.js main1.js + Entrypoint manifest = manifest.js + [0] ./b.js 20 bytes {0} [built] + [1] ./c.js 20 bytes {0} [built] + [2] ./d.js 20 bytes {0} [built] + [3] ./main1.js 66 bytes {2} [built] + [4] ./f.js 20 bytes {1} [built]" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk-issue-7382 1`] = ` +"Entrypoint e1 = runtime.js all.js e1.js +Entrypoint e2 = runtime.js all.js e2.js" +`; + +exports[`StatsTestCases should print correct stats for runtime-chunk-single 1`] = ` +"Entrypoint e1 = runtime.js e1.js +Entrypoint e2 = runtime.js e2.js" +`; + +exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1`] = ` +"Hash: df49e15bdf57c432360e +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT +Entrypoint index = index.js +Entrypoint entry = entry.js +[0] ./entry.js 32 bytes {1} {2} [built] + ModuleConcatenation bailout: Module is an entry point +[1] ./ref-from-cjs.js 45 bytes {1} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./cjs.js (referenced with cjs require) +[2] external \\"external\\" 42 bytes {1} [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[3] ./concatenated.js + 2 modules 116 bytes {0} [built] + ModuleConcatenation bailout: Cannot concat with external \\"external\\" (<- Module is not an ECMAScript module) + | ./concatenated.js 26 bytes [built] + | ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./index.js (referenced with import()) + | ./concatenated1.js 37 bytes [built] + | ./concatenated2.js 48 bytes [built] +[4] ./index.js 176 bytes {1} [built] + ModuleConcatenation bailout: Module is an entry point +[5] ./cjs.js 59 bytes {1} [built] + ModuleConcatenation bailout: Module is not an ECMAScript module +[6] ./eval.js 35 bytes {1} [built] + ModuleConcatenation bailout: Module uses eval() +[7] ./injected-vars.js 40 bytes {1} [built] + ModuleConcatenation bailout: Module uses injected variables (__dirname, __filename) +[8] ./module-id.js 26 bytes {1} [built] + ModuleConcatenation bailout: Module uses module.id +[9] ./module-loaded.js 30 bytes {1} [built] + ModuleConcatenation bailout: Module uses module.loaded" +`; + +exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` +"Hash: f47bea8ea571296b32b82a4cd6b69820dd6e8c36 +Child + Hash: f47bea8ea571296b32b8 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Entrypoint first = vendor.js first.js + Entrypoint second = vendor.js second.js + [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] + [1] ./common2.js 25 bytes {4} {5} [built] + [2] ./common_lazy.js 25 bytes {1} {2} [built] + [3] ./common.js 37 bytes {4} {5} [built] + [4] ./lazy_shared.js 31 bytes {0} [built] + [5] ./vendor.js 25 bytes {3} [built] + [6] ./lazy_first.js 55 bytes {2} [built] + [7] ./lazy_second.js 55 bytes {1} [built] + [8] ./first.js 207 bytes {4} [built] + [9] ./module_first.js 31 bytes {4} [built] + [10] ./second.js 177 bytes {5} [built] +Child + Hash: 2a4cd6b69820dd6e8c36 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Entrypoint first = vendor.js first.js + Entrypoint second = vendor.js second.js + [0] ./common_lazy_shared.js 25 bytes {0} {1} {2} [built] + [1] ./common_lazy.js 25 bytes {1} {2} [built] + [2] ./common.js + 1 modules 62 bytes {4} {5} [built] + | ./common.js 37 bytes [built] + | ./common2.js 25 bytes [built] + [3] ./vendor.js 25 bytes {3} [built] + [4] ./lazy_shared.js 31 bytes {0} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()), ./second.js (referenced with import()) + [5] ./lazy_second.js 55 bytes {1} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) + [6] ./second.js 177 bytes {5} [built] + ModuleConcatenation bailout: Module is an entry point + [7] ./first.js + 1 modules 248 bytes {4} [built] + ModuleConcatenation bailout: Cannot concat with ./common.js + ModuleConcatenation bailout: Cannot concat with ./vendor.js + | ./first.js 207 bytes [built] + | ModuleConcatenation bailout: Module is an entry point + | ./module_first.js 31 bytes [built] + [8] ./lazy_first.js 55 bytes {2} [built] + ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import())" +`; + +exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = ` +"Hash: b1ef68bcfacb3ad18417 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + 0.js 481 bytes 0 [emitted] +main.js 9.53 KiB 1 [emitted] main +Entrypoint main = main.js +[0] ./components/src/CompAB/utils.js 97 bytes {1} [built] + harmony side effect evaluation ./utils [1] ./main.js + 1 modules 1:0-30 + harmony import specifier ./utils [1] ./main.js + 1 modules 5:2-5 + harmony side effect evaluation ./utils [4] ./components/src/CompAB/CompA.js 1:0-35 + harmony import specifier ./utils [4] ./components/src/CompAB/CompA.js 5:5-12 +[1] ./main.js + 1 modules 231 bytes {1} [built] + single entry ./main.js main + | ./main.js 144 bytes [built] + | single entry ./main.js main + | ./components/src/CompAB/CompB.js 77 bytes [built] + | [only some exports used: default] + | harmony import specifier ./components ./main.js 4:15-20 (skipped side-effect-free modules) + | harmony side effect evaluation ./CompB [7] ./components/src/CompAB/index.js 2:0-43 + | harmony export imported specifier ./CompB [7] ./components/src/CompAB/index.js 2:0-43 +[2] ./components/src/index.js 84 bytes [built] + [no exports used] + harmony side effect evaluation ./components [1] ./main.js + 1 modules 1:0-44 + harmony side effect evaluation ./components [3] ./foo.js 1:0-37 +[3] ./foo.js 101 bytes {0} [built] + import() ./foo ./main.js 6:0-15 +[4] ./components/src/CompAB/CompA.js 89 bytes {1} [built] + [only some exports used: default] + harmony import specifier ./components ./main.js 3:15-20 (skipped side-effect-free modules) + harmony import specifier ./components [3] ./foo.js 3:20-25 (skipped side-effect-free modules) + harmony side effect evaluation ./CompA [7] ./components/src/CompAB/index.js 1:0-43 + harmony export imported specifier ./CompA [7] ./components/src/CompAB/index.js 1:0-43 +[5] ./components/src/CompC/CompC.js 33 bytes [built] + [no exports used] + harmony side effect evaluation ./CompC [6] ./components/src/CompC/index.js 1:0-34 + harmony export imported specifier ./CompC [6] ./components/src/CompC/index.js 1:0-34 +[6] ./components/src/CompC/index.js 34 bytes [built] + [no exports used] + harmony side effect evaluation ./CompC [2] ./components/src/index.js 2:0-43 + harmony export imported specifier ./CompC [2] ./components/src/index.js 2:0-43 +[7] ./components/src/CompAB/index.js 87 bytes [built] + [no exports used] + harmony side effect evaluation ./CompAB [2] ./components/src/index.js 1:0-40 + harmony export imported specifier ./CompAB [2] ./components/src/index.js 1:0-40 + harmony export imported specifier ./CompAB [2] ./components/src/index.js 1:0-40" +`; + +exports[`StatsTestCases should print correct stats for side-effects-simple-unused 1`] = ` +"Hash: 98f9f698f299e2fa69de +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +main.js 3.9 KiB 0 [emitted] main +Entrypoint main = main.js +[0] ./node_modules/pmodule/b.js 69 bytes [built] + [no exports used] +[1] ./node_modules/pmodule/a.js 60 bytes [built] + [no exports used] +[2] ./index.js + 2 modules 158 bytes {0} [built] + | ./index.js 55 bytes [built] + | ./node_modules/pmodule/index.js 75 bytes [built] + | [only some exports used: default] + | ./node_modules/pmodule/c.js 28 bytes [built] + | [only some exports used: z]" +`; + +exports[`StatsTestCases should print correct stats for simple 1`] = ` +"Hash: 06cc914b885215f96c5a +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 3.75 KiB main [emitted] main +Entrypoint main = bundle.js +[./index.js] 0 bytes {main} [built]" +`; + +exports[`StatsTestCases should print correct stats for simple-more-info 1`] = ` +"Hash: c8c226a954f967e61630 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 3.57 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./index.js 0 bytes {0} [built] + single entry ./index main + factory:Xms building:Xms = Xms" +`; + +exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` +"Child default: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/b.js + Entrypoint c = default/c.js + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {4} [built] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [5] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + > ./c [8] ./index.js 3:0-47 + [6] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + > ./c [8] ./index.js 3:0-47 + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [5] ./b.js 72 bytes {6} {11} [built] + chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + [6] ./c.js 72 bytes {7} {12} [built] +Child all-chunks: + Entrypoint main = default/main.js + Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a.js + Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/b.js + Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js + chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child manual: + Entrypoint main = default/main.js + Entrypoint a = default/vendors.js default/a.js + Entrypoint b = default/vendors.js default/b.js + Entrypoint c = default/vendors.js default/c.js + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + [3] ./node_modules/y.js 20 bytes {0} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [10] multi x y z 52 bytes {0} [built] + chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [9] ./g.js 34 bytes {1} [built] + chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] +Child name-too-long: + Entrypoint main = main.js + Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js + Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js + Entrypoint cccccccccccccccccccccccccccccc = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~async-c~cccccccccccccccccccccccccccccc.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js cccccccccccccccccccccccccccccc.js + chunk {0} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={7}= ={8}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={7}= ={8}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [1] ./d.js 20 bytes {1} [built] + chunk {2} async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc.js (async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={11}= ={12}= ={3}= ={4}= ={6}= ={7}= ={8}= [initial] [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccccccccccccccccccc) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + > ./b [7] ./index.js 2:0-47 + > ./c [7] ./index.js 3:0-47 + [0] ./f.js 20 bytes {2} [built] + chunk {3} vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={7}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./a [7] ./index.js 1:0-47 + > ./b [7] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} vendors~async-c~cccccccccccccccccccccccccccccc.js (vendors~async-c~cccccccccccccccccccccccccccccc) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~cccccccccccccccccccccccccccccc) + > ./c cccccccccccccccccccccccccccccc + > ./c [7] ./index.js 3:0-47 + [6] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) 156 bytes <{9}> ={0}= ={1}= ={10}= ={3}= >{2}< >{6}< [initial] [rendered] split chunk (cache group: default) (name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a) + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./a [7] ./index.js 1:0-47 + [8] ./a.js + 1 modules 156 bytes {5} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {6} async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {6} [built] + chunk {7} async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [7] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [7] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{7}< >{8}< [entry] [rendered] + > ./ main + [7] ./index.js 147 bytes {9} [built] + chunk {10} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 0 bytes ={0}= ={1}= ={3}= ={5}= >{2}< >{6}< [entry] [rendered] + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + chunk {11} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 72 bytes ={0}= ={1}= ={2}= ={3}= [entry] [rendered] + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 72 bytes ={0}= ={1}= ={2}= ={4}= [entry] [rendered] + > ./c cccccccccccccccccccccccccccccc + [5] ./c.js 72 bytes {8} {12} [built] +Child custom-chunks-filter: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-a~async-b~b.js default/b.js + Entrypoint c = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js + chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c~b~c) + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} {10} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~b) + > ./b b + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} [built] + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {5} [built] + chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + > ./a [8] ./index.js 1:0-47 + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [4] ./b.js 72 bytes {7} {11} [built] + chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + > ./c [8] ./index.js 3:0-47 + [5] ./c.js 72 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{5}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [2] ./node_modules/x.js 20 bytes {0} {10} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} [built] + [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {7} {11} [built] + chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {8} {12} [built] +Child custom-chunks-filter-in-cache-groups: + Entrypoint main = default/main.js + Entrypoint a = default/a.js + Entrypoint b = default/vendors.js default/b.js + Entrypoint c = default/vendors.js default/c.js + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [10] multi x y z 52 bytes {0} [built] + chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [9] ./g.js 34 bytes {1} [built] + chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 216 bytes >{1}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {3} {7} [built] + chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] + [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {4} {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` +"Entrypoint main = main.js +chunk {0} async-a~async-b.js (async-a~async-b) 134 bytes <{8}> ={1}= ={2}= [rendered] split chunk (cache group: default) (name: async-a~async-b) + > ./a [9] ./index.js 1:0-47 + > ./b [9] ./index.js 2:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [1] ./y.js 67 bytes {0} [built] +chunk {1} async-a.js (async-a) 48 bytes <{8}> ={0}= [rendered] + > ./a [9] ./index.js 1:0-47 + [2] ./a.js 48 bytes {1} [built] +chunk {2} async-b.js (async-b) 48 bytes <{8}> ={0}= [rendered] + > ./b [9] ./index.js 2:0-47 + [3] ./b.js 48 bytes {2} [built] +chunk {3} async-c.js (async-c) 101 bytes <{8}> [rendered] + > ./c [9] ./index.js 3:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [4] ./c.js 34 bytes {3} [built] +chunk {4} async-d.js (async-d) 101 bytes <{8}> [rendered] + > ./d [9] ./index.js 4:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [5] ./d.js 34 bytes {4} [built] +chunk {5} async-e.js (async-e) 101 bytes <{8}> [rendered] + > ./e [9] ./index.js 5:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [6] ./e.js 34 bytes {5} [built] +chunk {6} async-f.js (async-f) 101 bytes <{8}> [rendered] + > ./f [9] ./index.js 6:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [7] ./f.js 34 bytes {6} [built] +chunk {7} async-g.js (async-g) 101 bytes <{8}> [rendered] + > ./g [9] ./index.js 7:0-47 + [0] ./x.js 67 bytes {0} {3} {4} {5} {6} {7} [built] + [8] ./g.js 34 bytes {7} [built] +chunk {8} main.js (main) 343 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] + > ./ main + [9] ./index.js 343 bytes {8} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` +"Entrypoint main = main.js +chunk {0} vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{5}> ={1}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + > ./a [5] ./index.js 1:0-47 + > ./b [5] ./index.js 2:0-47 + > ./c [5] ./index.js 3:0-47 + [1] ./node_modules/x.js 20 bytes {0} [built] +chunk {1} async-a~async-b~async-c.js (async-a~async-b~async-c) 11 bytes <{5}> ={0}= ={2}= ={3}= ={4}= [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [5] ./index.js 1:0-47 + > ./b [5] ./index.js 2:0-47 + > ./c [5] ./index.js 3:0-47 + [0] ./common.js 11 bytes {1} [built] +chunk {2} async-a.js (async-a) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./a [5] ./index.js 1:0-47 + [2] ./a.js 19 bytes {2} [built] +chunk {3} async-b.js (async-b) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./b [5] ./index.js 2:0-47 + [3] ./b.js 19 bytes {3} [built] +chunk {4} async-c.js (async-c) 19 bytes <{5}> ={0}= ={1}= [rendered] + > ./c [5] ./index.js 3:0-47 + [4] ./c.js 19 bytes {4} [built] +chunk {5} main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [rendered] + > ./ main + [5] ./index.js 147 bytes {5} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` +"Entrypoint main = vendors.js main.js +chunk {0} async-a.js (async-a) 32 bytes <{2}> <{3}> [rendered] + > ./a [3] ./index.js 2:0-47 + [0] ./node_modules/x.js 20 bytes {0} {1} [built] + [1] ./a.js 12 bytes {0} [built] +chunk {1} async-b.js (async-b) 32 bytes <{2}> <{3}> [rendered] + > ./b [3] ./index.js 3:0-47 + [0] ./node_modules/x.js 20 bytes {0} {1} [built] + [2] ./b.js 12 bytes {1} [built] +chunk {2} main.js (main) 110 bytes ={3}= >{0}< >{1}< [entry] [rendered] + > ./ main + [3] ./index.js 110 bytes {2} [built] +chunk {3} vendors.js (vendors) 20 bytes ={2}= >{0}< >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./ main + [4] ./node_modules/y.js 20 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1`] = ` +"Entrypoint a = vendors~a~c.js a.js +Entrypoint b = b.js +Chunk Group c = vendors~a~c.js c.js +chunk {0} vendors~a~c.js (vendors~a~c) 20 bytes <{3}> ={1}= ={2}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~c) + > ./a a + > ./c [3] ./b.js 1:0-41 + [0] ./node_modules/x.js 20 bytes {0} [built] +chunk {1} c.js (c) 12 bytes <{3}> ={0}= [rendered] + > ./c [3] ./b.js 1:0-41 + [1] ./c.js 12 bytes {1} [built] +chunk {2} a.js (a) 12 bytes ={0}= [entry] [rendered] + > ./a a + [2] ./a.js 12 bytes {2} [built] +chunk {3} b.js (b) 43 bytes >{0}< >{1}< [entry] [rendered] + > ./b b + [3] ./b.js 43 bytes {3} [built]" +`; + +exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = ` +"Entrypoint main = default/main.js +chunk {0} default/async-b~async-c.js (async-b~async-c) 110 bytes <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) (name: async-b~async-c) + > ./b [6] ./index.js 2:0-47 + > ./c [6] ./index.js 3:0-47 + [0] ./d.js 43 bytes {0} {1} [built] + [2] ./f.js 67 bytes {0} [built] +chunk {1} default/async-a.js (async-a) 134 bytes <{4}> [rendered] + > ./a [6] ./index.js 1:0-47 + [0] ./d.js 43 bytes {0} {1} [built] + [1] ./e.js 43 bytes {1} {2} [built] + [3] ./a.js 48 bytes {1} [built] +chunk {2} default/async-b.js (async-b) 105 bytes <{4}> ={0}= [rendered] + > ./b [6] ./index.js 2:0-47 + [1] ./e.js 43 bytes {1} {2} [built] + [4] ./b.js 62 bytes {2} [built] +chunk {3} default/async-c.js (async-c) 48 bytes <{4}> ={0}= [rendered] + > ./c [6] ./index.js 3:0-47 + [5] ./c.js 48 bytes {3} [built] +chunk {4} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [6] ./index.js 147 bytes {4} [built]" +`; + +exports[`StatsTestCases should print correct stats for tree-shaking 1`] = ` +"Hash: 7664ceef8f3f695c9688 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 8.23 KiB 0 [emitted] main +Entrypoint main = bundle.js + [0] ./a.js 13 bytes {0} [built] + [exports: a] + [all exports used] + [1] ./b.js 13 bytes {0} [built] + [exports: b] + [no exports used] + [2] ./unknown.js 0 bytes {0} [built] + [only some exports used: c] + [3] ./unknown2.js 0 bytes {0} [built] + [only some exports used: y] + [4] ./index.js 315 bytes {0} [built] + [no exports] + [5] ./require.include.js 36 bytes {0} [built] + [exports: a, default] + [no exports used] + [6] ./reexport-known.js 49 bytes {0} [built] + [exports: a, b] + [only some exports used: a] + [7] ./reexport-star-known.js 41 bytes {0} [built] + [exports: a, b] + [only some exports used: a] + [8] ./edge.js 45 bytes {0} [built] + [only some exports used: y] + [9] ./reexport-unknown.js 83 bytes {0} [built] + [exports: a, b, c, d] + [only some exports used: a, c] +[10] ./reexport-star-unknown.js 68 bytes {0} [built] + [only some exports used: a, c]" +`; + +exports[`StatsTestCases should print correct stats for warnings-uglifyjs 1`] = ` +"Hash: 1325fb5a846745d7ae89 +Time: Xms +Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names +bundle.js 2.89 KiB 0 [emitted] main +Entrypoint main = bundle.js +[0] ./index.js 299 bytes {0} [built] +[1] ./a.js 249 bytes {0} [built] +[2] (webpack)/buildin/module.js 497 bytes {0} [built] + +WARNING in bundle.js from UglifyJs +Dropping unused function someUnRemoteUsedFunction1 [./a.js:3,0] +Dropping unused function someUnRemoteUsedFunction2 [./a.js:4,0] +Dropping unused function someUnRemoteUsedFunction3 [./a.js:5,0] +Dropping unused function someUnRemoteUsedFunction4 [./a.js:6,0] +Dropping unused function someUnRemoteUsedFunction5 [./a.js:7,0]" +`; diff --git a/test/configCases/web/prefetch-preload/index.js b/test/configCases/web/prefetch-preload/index.js index 2d393f55a..9c0086c7a 100644 --- a/test/configCases/web/prefetch-preload/index.js +++ b/test/configCases/web/prefetch-preload/index.js @@ -5,12 +5,14 @@ let oldPublicPath; beforeEach(() => { oldNonce = __webpack_nonce__; oldPublicPath = __webpack_public_path__; + global.location = {origin: "https://example.com"}; }); afterEach(() => { __webpack_nonce__ = oldNonce; __webpack_public_path__ = oldPublicPath; -}) + delete global.location; +}); it("should prefetch and preload child chunks on chunk load", () => { __webpack_nonce__ = "nonce"; From 2755a0e82bf41ca068d5f1bdca7bff459993ca94 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Tue, 12 Jun 2018 14:34:23 -0700 Subject: [PATCH 20/31] Remove redundant code after merge --- lib/web/JsonpMainTemplatePlugin.js | 6 --- .../__snapshots__/StatsTestCases.test.js.snap | 52 +++++++++---------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index 1f7a71142..2890f44af 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -169,12 +169,6 @@ class JsonpMainTemplatePlugin { "}" ]) : "", - "var timeout = setTimeout(function(){", - Template.indent([ - "onScriptComplete({ type: 'timeout', target: script });" - ]), - `}, ${chunkLoadTimeout});`, - "script.onerror = script.onload = onScriptComplete;", "onScriptComplete = function (event) {", Template.indent([ "// avoid mem leaks in IE.", diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index a43663f00..b3b1a41b6 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -8,7 +8,7 @@ Child fitting: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] - 2b4c8b62a524452d2de1.js 11.3 KiB 1 [emitted] + 2b4c8b62a524452d2de1.js 11.1 KiB 1 [emitted] d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js 2b4c8b62a524452d2de1.js @@ -34,7 +34,7 @@ Child content-change: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 9ac13fb7087e9ff1b93e.js 1.05 KiB 0 [emitted] - 2b4c8b62a524452d2de1.js 11.3 KiB 1 [emitted] + 2b4c8b62a524452d2de1.js 11.1 KiB 1 [emitted] d1ba53816ff760e185b0.js 1.94 KiB 2 [emitted] 7b5b0a943e9362bc88c6.js 1.94 KiB 3 [emitted] Entrypoint main = d1ba53816ff760e185b0.js 7b5b0a943e9362bc88c6.js 2b4c8b62a524452d2de1.js @@ -71,7 +71,7 @@ d6418937dfae4b3ee922.js 1 KiB 1 [emitted] 685acdc95ff4af957f47.js 1 KiB 7 [emitted] 606f48c13070850338b1.js 1.94 KiB 8 [emitted] c5a8eae840969538f450.js 1.94 KiB 9 [emitted] -7bf22146f3e40919bde5.js 9.9 KiB 10 [emitted] main +7bf22146f3e40919bde5.js 9.7 KiB 10 [emitted] main fcdf398c8972e4dcf788.js 1.94 KiB 11 [emitted] Entrypoint main = 7bf22146f3e40919bde5.js chunk {0} fd868baa40dab4fc30fd.js 1.76 KiB <{10}> ={1}= ={2}= ={3}= ={7}= ={9}= [recorded] aggressive splitted @@ -498,7 +498,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.bundle.js 152 bytes 0 [emitted] 1.bundle.js 289 bytes 1 [emitted] - bundle.js 8.49 KiB 2 [emitted] main + bundle.js 8.29 KiB 2 [emitted] main 3.bundle.js 227 bytes 3 [emitted] Entrypoint main = bundle.js chunk {0} 0.bundle.js 22 bytes <{2}> [rendered] @@ -537,7 +537,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT 0.bundle.js 433 bytes 0 [emitted] 1.bundle.js 297 bytes 1 [emitted] 2.bundle.js 588 bytes 2 [emitted] - bundle.js 8.87 KiB main [emitted] main + bundle.js 8.67 KiB main [emitted] main Entrypoint main = bundle.js chunk {main} bundle.js (main) 73 bytes >{0}< >{1}< [entry] [rendered] > ./index main @@ -985,7 +985,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT 0.js 305 bytes 0 [emitted] 1.js 314 bytes 1 [emitted] 2.js 308 bytes 2 [emitted] -entry.js 9.28 KiB 3 [emitted] entry +entry.js 9.08 KiB 3 [emitted] entry Entrypoint entry = entry.js [0] ./templates/bar.js 38 bytes {0} [optional] [built] [1] ./templates/baz.js 38 bytes {1} [optional] [built] @@ -1000,7 +1000,7 @@ Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 149 bytes 0 [emitted] -entry.js 8.73 KiB 1 [emitted] entry +entry.js 8.53 KiB 1 [emitted] entry Entrypoint entry = entry.js [0] ./modules/b.js 22 bytes {0} [built] [1] ./entry.js 120 bytes {1} [built] @@ -1051,7 +1051,7 @@ Child 2 chunks: Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.bundle.js 632 bytes 0 [emitted] - bundle.js 8.49 KiB 1 [emitted] main + bundle.js 8.28 KiB 1 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 118 bytes <{0}> <{1}> >{0}< [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1068,7 +1068,7 @@ Child 3 chunks: Asset Size Chunks Chunk Names 0.bundle.js 494 bytes 0 [emitted] 1.bundle.js 245 bytes 1 [emitted] - bundle.js 8.49 KiB 2 [emitted] main + bundle.js 8.28 KiB 2 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 74 bytes <{0}> <{2}> >{0}< >{1}< [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1087,7 +1087,7 @@ Child 4 chunks: 0.bundle.js 236 bytes 0 [emitted] 1.bundle.js 245 bytes 1 [emitted] 2.bundle.js 323 bytes 2 [emitted] - bundle.js 8.49 KiB 3 [emitted] main + bundle.js 8.28 KiB 3 [emitted] main Entrypoint main = bundle.js chunk {0} 0.bundle.js 44 bytes <{2}> <{3}> [rendered] [0] ./d.js 22 bytes {0} [built] @@ -1179,9 +1179,9 @@ exports[`StatsTestCases should print correct stats for module-deduplication 1`] 3.js 661 bytes 3 [emitted] 4.js 661 bytes 4 [emitted] 5.js 661 bytes 5 [emitted] -e1.js 9.63 KiB 6 [emitted] e1 -e2.js 9.65 KiB 7 [emitted] e2 -e3.js 9.67 KiB 8 [emitted] e3 +e1.js 9.42 KiB 6 [emitted] e1 +e2.js 9.44 KiB 7 [emitted] e2 +e3.js 9.46 KiB 8 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js @@ -1225,9 +1225,9 @@ exports[`StatsTestCases should print correct stats for module-deduplication-name async3.js 818 bytes 0 [emitted] async3 async1.js 818 bytes 1 [emitted] async1 async2.js 818 bytes 2 [emitted] async2 - e1.js 9.51 KiB 3 [emitted] e1 - e2.js 9.53 KiB 4 [emitted] e2 - e3.js 9.55 KiB 5 [emitted] e3 + e1.js 9.31 KiB 3 [emitted] e1 + e2.js 9.33 KiB 4 [emitted] e2 + e3.js 9.35 KiB 5 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js @@ -1359,7 +1359,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names chunk-containing-__a_js.js 313 bytes chunk-containing-__a_js [emitted] chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted] - entry.js 8.39 KiB entry [emitted] entry + entry.js 8.18 KiB entry [emitted] entry Entrypoint entry = entry.js [0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built] [1] ./modules/a.js 37 bytes {chunk-containing-__a_js} [built] @@ -1397,7 +1397,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT ab.js 183 bytes 1 [emitted] ab abd.js 277 bytes 2, 1 [emitted] abd cir2.js 299 bytes 3 [emitted] cir2 - main.js 9.29 KiB 4 [emitted] main + main.js 9.09 KiB 4 [emitted] main cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 chunk.js 190 bytes 6, 7 [emitted] chunk ac in ab.js 130 bytes 7 [emitted] ac in ab @@ -1694,7 +1694,7 @@ exports[`StatsTestCases should print correct stats for prefetch 1`] = ` normal.js 130 bytes 1 [emitted] normal prefetched2.js 127 bytes 2 [emitted] prefetched2 prefetched3.js 130 bytes 3 [emitted] prefetched3 - main.js 9.86 KiB 4 [emitted] main + main.js 9.66 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) @@ -1727,7 +1727,7 @@ exports[`StatsTestCases should print correct stats for preload 1`] = ` normal.js 130 bytes 1 [emitted] normal preloaded2.js 127 bytes 2 [emitted] preloaded2 preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 10.1 KiB 4 [emitted] main + main.js 9.86 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) @@ -1747,7 +1747,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.5 KiB 2 [emitted] main +main.js 8.29 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js chunk {0} 0.js 22 bytes <{2}> [rendered] @@ -1806,7 +1806,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.5 KiB 2 [emitted] main +main.js 8.29 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js [0] ./d.js 22 bytes {3} [built] @@ -1884,7 +1884,7 @@ Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 152 bytes 0 [emitted] 1.js 289 bytes 1 [emitted] -main.js 8.5 KiB 2 [emitted] main +main.js 8.29 KiB 2 [emitted] main 3.js 227 bytes 3 [emitted] Entrypoint main = main.js chunk {0} 0.js 22 bytes <{2}> [rendered] @@ -1975,7 +1975,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration Asset Size Chunks Chunk Names 0.js 719 bytes 0 [emitted] main1.js 542 bytes 1 [emitted] main1 - runtime.js 8.95 KiB 2 [emitted] runtime + runtime.js 8.75 KiB 2 [emitted] runtime Entrypoint main1 = runtime.js main1.js [0] ./b.js 20 bytes {0} [built] [1] ./c.js 20 bytes {0} [built] @@ -1984,7 +1984,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration Child manifest is named entry: Asset Size Chunks Chunk Names 0.js 719 bytes 0 [emitted] - manifest.js 9.26 KiB 1 [emitted] manifest + manifest.js 9.06 KiB 1 [emitted] manifest main1.js 542 bytes 2 [emitted] main1 Entrypoint main1 = manifest.js main1.js Entrypoint manifest = manifest.js @@ -2090,7 +2090,7 @@ Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names 0.js 481 bytes 0 [emitted] -main.js 9.53 KiB 1 [emitted] main +main.js 9.32 KiB 1 [emitted] main Entrypoint main = main.js [0] ./components/src/CompAB/utils.js 97 bytes {1} [built] harmony side effect evaluation ./utils [1] ./main.js + 1 modules 1:0-30 From 07a50001f03e0d50b098d2a51b5efee06da94f18 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 15 Jun 2018 18:55:25 +0300 Subject: [PATCH 21/31] remove comment --- lib/WebpackOptionsDefaulter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/WebpackOptionsDefaulter.js b/lib/WebpackOptionsDefaulter.js index 264e6f01a..f0d3f8922 100644 --- a/lib/WebpackOptionsDefaulter.js +++ b/lib/WebpackOptionsDefaulter.js @@ -263,7 +263,6 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { "make", options => options.mode === "development" ); - // TODO enable for production mode in webpack 5 this.set("optimization.hashedModuleIds", false); this.set( "optimization.namedChunks", From 2b4ed3d9429183062b688f3eafd4ba65fc2123b3 Mon Sep 17 00:00:00 2001 From: Spencer Elliott Date: Thu, 14 Jun 2018 11:39:42 -0700 Subject: [PATCH 22/31] require() webpack-cli/webpack-command's bin module Rather than require()-ing the "main" module in webpack-cli/ webpack-command, require() the "bin" module. This avoids the issue described in https://github.com/webpack-contrib/webpack-command/pull/30 where installing packages in this order results in no output from ./node_modules/.bin/webpack: $ npm install webpack-command $ npm install webpack $ ./node_modules/.bin/webpack # exit 0 with no output --- bin/webpack.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/webpack.js b/bin/webpack.js index 389bc9527..a34fba26b 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -47,6 +47,7 @@ const isInstalled = packageName => { * @typedef {Object} CliOption * @property {string} name display name * @property {string} package npm package name + * @property {string} binName name of the executable file * @property {string} alias shortcut for choice * @property {boolean} installed currently installed? * @property {string} url homepage @@ -58,6 +59,7 @@ const CLIs = [ { name: "webpack-cli", package: "webpack-cli", + binName: "webpack-cli", alias: "cli", installed: isInstalled("webpack-cli"), url: "https://github.com/webpack/webpack-cli", @@ -66,6 +68,7 @@ const CLIs = [ { name: "webpack-command", package: "webpack-command", + binName: "webpack-command", alias: "command", installed: isInstalled("webpack-command"), url: "https://github.com/webpack-contrib/webpack-command", @@ -154,7 +157,10 @@ if (installedClis.length === 0) { }); }); } else if (installedClis.length === 1) { - require(installedClis[0].package); // eslint-disable-line + const path = require("path"); + const pkgPath = require.resolve(`${installedClis[0].package}/package.json`); + const pkg = require(pkgPath); // eslint-disable-line + require(path.resolve(path.dirname(pkgPath), pkg.bin[installedClis[0].binName])); // eslint-disable-line } else { console.warn( `You have installed ${installedClis From 0f587763e138017afb11592070c81fdab5ca047d Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 11 May 2018 18:12:30 +0200 Subject: [PATCH 23/31] add per chunk index and index2 refactor index generation --- lib/ChunkGroup.js | 44 + lib/Compilation.js | 253 +++--- lib/util/Queue.js | 2 +- .../__snapshots__/StatsTestCases.test.js.snap | 838 +++++++++--------- .../chunk-index/order-multiple-entries/a.js | 1 + .../order-multiple-entries/async.js | 0 .../chunk-index/order-multiple-entries/b.js | 1 + .../chunk-index/order-multiple-entries/c.js | 0 .../order-multiple-entries/entry1.js | 6 + .../order-multiple-entries/entry2.js | 6 + .../order-multiple-entries/shared.js | 0 .../order-multiple-entries/test.config.js | 5 + .../order-multiple-entries/webpack.config.js | 95 ++ 13 files changed, 732 insertions(+), 519 deletions(-) create mode 100644 test/configCases/chunk-index/order-multiple-entries/a.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/async.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/b.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/c.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/entry1.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/entry2.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/shared.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/test.config.js create mode 100644 test/configCases/chunk-index/order-multiple-entries/webpack.config.js diff --git a/lib/ChunkGroup.js b/lib/ChunkGroup.js index 482800b7e..764ca9b17 100644 --- a/lib/ChunkGroup.js +++ b/lib/ChunkGroup.js @@ -70,6 +70,12 @@ class ChunkGroup { this.chunks = []; /** @type {OriginRecord[]} */ this.origins = []; + /** Indicies in top-down order */ + /** @private @type {Map} */ + this._moduleIndicies = new Map(); + /** Indicies in bottom-up order */ + /** @private @type {Map} */ + this._moduleIndicies2 = new Map(); } /** @@ -447,6 +453,44 @@ class ChunkGroup { return result; } + /** + * Sets the top-down index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex(module, index) { + this._moduleIndicies.set(module, index); + } + + /** + * Gets the top-down index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex(module) { + return this._moduleIndicies.get(module); + } + + /** + * Sets the bottom-up index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex2(module, index) { + this._moduleIndicies2.set(module, index); + } + + /** + * Gets the bottom-up index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex2(module) { + return this._moduleIndicies2.get(module); + } + checkConstraints() { const chunk = this; for (const child of chunk._children) { diff --git a/lib/Compilation.js b/lib/Compilation.js index 1fd02ed4f..ea2d08d22 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -36,6 +36,10 @@ const Queue = require("./util/Queue"); const SortableSet = require("./util/SortableSet"); const GraphHelpers = require("./GraphHelpers"); +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ + const byId = (a, b) => { if (a.id < b.id) return -1; if (a.id > b.id) return 1; @@ -247,8 +251,6 @@ class Compilation extends Tapable { this._modules = new Map(); this.cache = null; this.records = null; - this.nextFreeModuleIndex = undefined; - this.nextFreeModuleIndex2 = undefined; this.additionalChunkAssets = []; this.assets = {}; this.errors = []; @@ -858,8 +860,6 @@ class Compilation extends Tapable { } this.hooks.afterOptimizeDependencies.call(this.modules); - this.nextFreeModuleIndex = 0; - this.nextFreeModuleIndex2 = 0; for (const preparedEntrypoint of this._preparedEntrypoints) { const module = preparedEntrypoint.module; const name = preparedEntrypoint.name; @@ -877,7 +877,6 @@ class Compilation extends Tapable { chunk.entryModule = module; chunk.name = name; - this.assignIndex(module); this.assignDepth(module); } this.processDependenciesBlocksForChunkGroups(this.chunkGroups.slice()); @@ -1026,6 +1025,13 @@ class Compilation extends Tapable { } } + /** + * @param {TODO} groupOptions options for the chunk group + * @param {Module} module the module the references the chunk group + * @param {TODO} loc the location from with the chunk group is reference (inside of module) + * @param {string} request the request from which the the chunk group is referenced + * @returns {ChunkGroup} the new or existing chunk group + */ addChunkInGroup(groupOptions, module, loc, request) { if (typeof groupOptions === "string") { groupOptions = { name: groupOptions }; @@ -1069,70 +1075,6 @@ class Compilation extends Tapable { return chunk; } - assignIndex(module) { - const assignIndexToModule = module => { - // enter module - if (typeof module.index !== "number") { - module.index = this.nextFreeModuleIndex++; - - // leave module - queue.push(() => (module.index2 = this.nextFreeModuleIndex2++)); - - // enter it as block - assignIndexToDependencyBlock(module); - } - }; - - const assignIndexToDependency = dependency => { - if (dependency.module) { - queue.push(() => assignIndexToModule(dependency.module)); - } - }; - - const assignIndexToDependencyBlock = block => { - let allDependencies = []; - - const iteratorDependency = d => allDependencies.push(d); - - const iteratorBlock = b => - queue.push(() => assignIndexToDependencyBlock(b)); - - if (block.variables) { - iterationBlockVariable(block.variables, iteratorDependency); - } - - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, iteratorDependency); - } - if (block.blocks) { - const blocks = block.blocks; - let indexBlock = blocks.length; - while (indexBlock--) { - iteratorBlock(blocks[indexBlock]); - } - } - - let indexAll = allDependencies.length; - while (indexAll--) { - iteratorAllDependencies(allDependencies[indexAll]); - } - }; - - const queue = [ - () => { - assignIndexToModule(module); - } - ]; - - const iteratorAllDependencies = d => { - queue.push(() => assignIndexToDependency(d)); - }; - - while (queue.length) { - queue.pop()(); - } - } - assignDepth(module) { const queue = new Set([module]); let depth; @@ -1175,7 +1117,12 @@ class Compilation extends Tapable { } } - // This method creates the Chunk graph from the Module graph + /** + * This method creates the Chunk graph from the Module graph + * @private + * @param {TODO[]} inputChunkGroups chunk groups which are processed + * @returns {void} + */ processDependenciesBlocksForChunkGroups(inputChunkGroups) { // Process is splitting into two parts: // Part one traverse the module graph and builds a very basic chunks graph @@ -1185,10 +1132,12 @@ class Compilation extends Tapable { // eachother and Blocks with Chunks. It stops traversing when all modules // for a chunk are already available. So it doesn't connect unneeded chunks. - const chunkDependencies = new Map(); // Map> + /** @type {Map} */ + const chunkDependencies = new Map(); const allCreatedChunkGroups = new Set(); // PREPARE + /** @type {Map} */ const blockInfoMap = new Map(); const iteratorDependency = d => { @@ -1215,7 +1164,15 @@ class Compilation extends Tapable { blockQueue.push(b); }; - let block, blockQueue, blockInfoModules, blockInfoBlocks; + /** @type {DependenciesBlock} */ + let block; + /** @type {TODO} */ + let blockQueue; + /** @type {Set} */ + let blockInfoModules; + /** @type {TODO[]} */ + let blockInfoBlocks; + for (const module of this.modules) { blockQueue = [module]; while (blockQueue.length > 0) { @@ -1236,7 +1193,7 @@ class Compilation extends Tapable { } const blockInfo = { - modules: blockInfoModules, + modules: Array.from(blockInfoModules), blocks: blockInfoBlocks }; blockInfoMap.set(block, blockInfo); @@ -1245,15 +1202,49 @@ class Compilation extends Tapable { // PART ONE + /** @type {Map} */ + const chunkGroupCounters = new Map(); + for (const chunkGroup of inputChunkGroups) { + chunkGroupCounters.set(chunkGroup, { index: 0, index2: 0 }); + } + + let nextFreeModuleIndex = 0; + let nextFreeModuleIndex2 = 0; + + /** @type {Map} */ const blockChunkGroups = new Map(); - // Start with the provided modules/chunks - const queue = inputChunkGroups.map(chunkGroup => ({ + const ADD_AND_ENTER_MODULE = 0; + const ENTER_MODULE = 1; + const PROCESS_BLOCK = 2; + const LEAVE_MODULE = 3; + + /** + * @typedef {Object} QueueItem + * @property {number} action + * @property {DependenciesBlock} block + * @property {Module} module + * @property {Chunk} chunk + * @property {ChunkGroup} chunkGroup + */ + + /** + * @param {ChunkGroup} chunkGroup chunk group + * @returns {QueueItem} queue item + */ + const chunkGroupToQueueItem = chunkGroup => ({ + action: ENTER_MODULE, block: chunkGroup.chunks[0].entryModule, module: chunkGroup.chunks[0].entryModule, chunk: chunkGroup.chunks[0], chunkGroup - })); + }); + + // Start with the provided modules/chunks + /** @type {QueueItem[]} */ + let queue = inputChunkGroups.map(chunkGroupToQueueItem).reverse(); + /** @type {QueueItem[]} */ + let queueDelayed = []; let module, chunk, chunkGroup; @@ -1276,6 +1267,7 @@ class Compilation extends Tapable { b.loc, b.request ); + chunkGroupCounters.set(c, { index: 0, index2: 0 }); blockChunkGroups.set(b, c); allCreatedChunkGroups.add(c); } @@ -1294,7 +1286,8 @@ class Compilation extends Tapable { }); // 3. We enqueue the DependenciesBlock for traversal - queue.push({ + queueDelayed.push({ + action: PROCESS_BLOCK, block: b, module: module, chunk: c.chunks[0], @@ -1305,33 +1298,95 @@ class Compilation extends Tapable { // Iterative traversal of the Module graph // Recursive would be simpler to write but could result in Stack Overflows while (queue.length) { - const queueItem = queue.pop(); - module = queueItem.module; - block = queueItem.block; - chunk = queueItem.chunk; - chunkGroup = queueItem.chunkGroup; + while (queue.length) { + const queueItem = queue.pop(); + module = queueItem.module; + block = queueItem.block; + chunk = queueItem.chunk; + chunkGroup = queueItem.chunkGroup; - // get prepared block info - const blockInfo = blockInfoMap.get(block); + switch (queueItem.action) { + case ADD_AND_ENTER_MODULE: { + // We connect Module and Chunk when not already done + if (chunk.addModule(module)) { + module.addChunk(chunk); + } else { + // already connected, skip it + break; + } + } + // fallthrough + case ENTER_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex(module); + if (index === undefined) { + chunkGroup.setModuleIndex( + module, + chunkGroupCounters.get(chunkGroup).index++ + ); + } + } - // Traverse all referenced modules - for (const refModule of blockInfo.modules) { - // We connect Module and Chunk when not already done - if (chunk.addModule(refModule)) { - refModule.addChunk(chunk); + if (module.index === null) { + module.index = nextFreeModuleIndex++; + } - // And enqueue the Module for traversal - queue.push({ - block: refModule, - module: refModule, - chunk, - chunkGroup - }); + queue.push({ + action: LEAVE_MODULE, + block, + module, + chunk, + chunkGroup + }); + } + // fallthrough + case PROCESS_BLOCK: { + // get prepared block info + const blockInfo = blockInfoMap.get(block); + + // Traverse all referenced modules + for (let i = blockInfo.modules.length - 1; i >= 0; i--) { + const refModule = blockInfo.modules[i]; + if (chunk.containsModule(refModule)) { + // skip early if already connected + continue; + } + // enqueue the add and enter to enter in the correct order + // this is relevant with circular dependencies + queue.push({ + action: ADD_AND_ENTER_MODULE, + block: refModule, + module: refModule, + chunk, + chunkGroup + }); + } + + // Traverse all Blocks + iterationOfArrayCallback(blockInfo.blocks, iteratorBlock); + break; + } + case LEAVE_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex2(module); + if (index === undefined) { + chunkGroup.setModuleIndex2( + module, + chunkGroupCounters.get(chunkGroup).index2++ + ); + } + } + + if (module.index2 === null) { + module.index2 = nextFreeModuleIndex2++; + } + break; + } } } - - // Traverse all Blocks - iterationOfArrayCallback(blockInfo.blocks, iteratorBlock); + const tempQueue = queue; + queue = queueDelayed.reverse(); + queueDelayed = tempQueue; } // PART TWO diff --git a/lib/util/Queue.js b/lib/util/Queue.js index 385b3a9bf..6615e9f77 100644 --- a/lib/util/Queue.js +++ b/lib/util/Queue.js @@ -5,7 +5,7 @@ */ class Queue { /** - * @param {IterableIterator=} items The initial elements. + * @param {Iterable=} items The initial elements. */ constructor(items) { /** @private @type {Set} */ diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index 1fe3e7358..86ee71aa8 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -148,58 +148,58 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto Entrypoint a = disabled/a.js Entrypoint b = disabled/b.js Entrypoint c = disabled/c.js - chunk {0} disabled/async-g.js (async-g) 54 bytes <{1}> <{5}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [8] ./g.js 34 bytes {0} [built] - chunk {1} disabled/async-a.js (async-a) 216 bytes <{4}> >{0}< [rendered] + chunk {0} disabled/async-a.js (async-a) 216 bytes <{4}> >{3}< [rendered] > ./a [7] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {0} {5} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {2} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] + chunk {1} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] > ./b [7] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] - chunk {3} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [4] ./b.js 72 bytes {1} {6} [built] + chunk {2} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] > ./c [7] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {2} {7} [built] | ./c.js 72 bytes [built] | ./node_modules/z.js 20 bytes [built] - chunk {4} disabled/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + chunk {3} disabled/async-g.js (async-g) 54 bytes <{0}> <{5}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [8] ./g.js 34 bytes {3} [built] + chunk {4} disabled/main.js (main) 147 bytes >{0}< >{1}< >{2}< [entry] [rendered] > ./ main [7] ./index.js 147 bytes {4} [built] - chunk {5} disabled/a.js (a) 216 bytes >{0}< [entry] [rendered] + chunk {5} disabled/a.js (a) 216 bytes >{3}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {0} {5} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {6} disabled/b.js (b) 152 bytes [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [4] ./b.js 72 bytes {1} {6} [built] chunk {7} disabled/c.js (c) 167 bytes [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {2} {7} [built] | ./c.js 72 bytes [built] | ./node_modules/z.js 20 bytes [built] Child default: @@ -207,53 +207,53 @@ Child default: Entrypoint a = default/a.js Entrypoint b = default/b.js Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{4}> <{9}> ={0}= ={1}= ={3}= ={5}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={4}= ={5}= >{2}< >{7}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + chunk {4} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{7}< [rendered] > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {5} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + [5] ./b.js 72 bytes {5} {11} [built] + chunk {6} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + [6] ./c.js 72 bytes {6} {12} [built] + chunk {7} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{4}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {7} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={6}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) > ./c [8] ./index.js 3:0-47 [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{8}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + chunk {10} default/a.js (a) 216 bytes >{2}< >{7}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 152 bytes [entry] [rendered] @@ -262,78 +262,78 @@ Child default: [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] + [5] ./b.js 72 bytes {5} {11} [built] chunk {12} default/c.js (c) 152 bytes [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] + [6] ./c.js 72 bytes {6} {12} [built] Child vendors: Entrypoint main = vendors/main.js Entrypoint a = vendors/vendors.js vendors/a.js Entrypoint b = vendors/vendors.js vendors/b.js Entrypoint c = vendors/vendors.js vendors/c.js - chunk {0} vendors/async-g.js (async-g) 54 bytes <{1}> <{4}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [9] ./g.js 34 bytes {0} [built] - chunk {1} vendors/async-a.js (async-a) 216 bytes <{5}> >{0}< [rendered] + chunk {0} vendors/async-a.js (async-a) 216 bytes <{5}> >{3}< [rendered] > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [7] ./a.js + 1 modules 156 bytes {0} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {2} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] + chunk {1} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [5] ./b.js 72 bytes {2} {7} [built] - chunk {3} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [5] ./b.js 72 bytes {1} {7} [built] + chunk {2} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - [6] ./c.js 72 bytes {3} {8} [built] - chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{0}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [4] ./node_modules/z.js 20 bytes {2} {4} [built] + [6] ./c.js 72 bytes {2} {8} [built] + chunk {3} vendors/async-g.js (async-g) 54 bytes <{0}> <{4}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [9] ./g.js 34 bytes {3} [built] + chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{3}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a a > ./b b > ./c c - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - chunk {5} vendors/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [4] ./node_modules/z.js 20 bytes {2} {4} [built] + chunk {5} vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {5} [built] - chunk {6} vendors/a.js (a) 176 bytes ={4}= >{0}< [entry] [rendered] + chunk {6} vendors/a.js (a) 176 bytes ={4}= >{3}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {0} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} vendors/b.js (b) 112 bytes ={4}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [5] ./b.js 72 bytes {2} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [5] ./b.js 72 bytes {1} {7} [built] chunk {8} vendors/c.js (c) 112 bytes ={4}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [6] ./c.js 72 bytes {3} {8} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [6] ./c.js 72 bytes {2} {8} [built] Child multiple-vendors: Entrypoint main = multiple-vendors/main.js Entrypoint a = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a.js Entrypoint b = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/b.js Entrypoint c = multiple-vendors/libs-x.js multiple-vendors/vendors~async-c~c.js multiple-vendors/c.js - chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) + chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) > ./a a > ./b b > ./c c @@ -341,67 +341,67 @@ Child multiple-vendors: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} multiple-vendors/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} multiple-vendors/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) > ./a a > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} multiple-vendors/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + chunk {10} multiple-vendors/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} multiple-vendors/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] > ./b b [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} multiple-vendors/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] Child all: Entrypoint main = all/main.js Entrypoint a = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a.js Entrypoint b = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/b.js Entrypoint c = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~async-c~c.js all/c.js - chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -409,61 +409,61 @@ Child all: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} all/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} all/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) > ./a a > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} all/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] + chunk {10} all/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} all/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] > ./b b [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} all/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built]" + [5] ./c.js 72 bytes {7} {12} [built]" `; exports[`StatsTestCases should print correct stats for chunk-module-id-range 1`] = ` @@ -925,21 +925,21 @@ Child exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` "Entrypoint e1 = e1.js Entrypoint e2 = e2.js -chunk {0} c.js (c) 49 bytes <{3}> <{4}> >{1}< [rendered] - [1] ./module-c.js 49 bytes {0} [built] - import() ./module-c [2] ./module-b.js 1:0-47 - import() ./module-c [4] ./e2.js 1:0-47 -chunk {1} a.js (a) 49 bytes <{0}> <{2}> >{4}< [rendered] - [0] ./module-a.js 49 bytes {1} [built] +chunk {0} a.js (a) 49 bytes <{1}> <{2}> >{4}< [rendered] + [0] ./module-a.js 49 bytes {0} [built] import() ./module-a [1] ./module-c.js 1:0-47 import() ./module-a [3] ./e1.js 1:0-47 -chunk {2} e1.js (e1) 49 bytes >{1}< [entry] [rendered] +chunk {1} c.js (c) 49 bytes <{3}> <{4}> >{0}< [rendered] + [1] ./module-c.js 49 bytes {1} [built] + import() ./module-c [2] ./module-b.js 1:0-47 + import() ./module-c [4] ./e2.js 1:0-47 +chunk {2} e1.js (e1) 49 bytes >{0}< [entry] [rendered] [3] ./e1.js 49 bytes {2} [built] single entry ./e1 e1 -chunk {3} e2.js (e2) 49 bytes >{0}< [entry] [rendered] +chunk {3} e2.js (e2) 49 bytes >{1}< [entry] [rendered] [4] ./e2.js 49 bytes {3} [built] single entry ./e2 e2 -chunk {4} b.js (b) 49 bytes <{1}> >{0}< [rendered] +chunk {4} b.js (b) 49 bytes <{0}> >{1}< [rendered] [2] ./module-b.js 49 bytes {4} [built] import() ./module-b [0] ./module-a.js 1:0-47" `; @@ -950,29 +950,29 @@ Entrypoint e2 = e2.js chunk {0} y.js (y) 0 bytes <{3}> <{4}> [rendered] [3] ./module-y.js 0 bytes {0} [built] import() ./module-y [0] ./module-x.js 1:0-47 -chunk {1} c.js (c) 49 bytes <{4}> <{5}> >{2}< [rendered] - [2] ./module-c.js 49 bytes {1} [built] - import() ./module-c [4] ./module-b.js 1:0-47 - import() ./module-c [6] ./e2.js 2:0-47 -chunk {2} a.js (a) 49 bytes <{1}> <{3}> >{5}< [rendered] - [1] ./module-a.js 49 bytes {2} [built] +chunk {1} a.js (a) 49 bytes <{2}> <{3}> >{5}< [rendered] + [1] ./module-a.js 49 bytes {1} [built] import() ./module-a [2] ./module-c.js 1:0-47 import() ./module-a [5] ./e1.js 2:0-47 -chunk {3} e1.js (e1) 119 bytes >{0}< >{2}< [entry] [rendered] +chunk {2} c.js (c) 49 bytes <{4}> <{5}> >{1}< [rendered] + [2] ./module-c.js 49 bytes {2} [built] + import() ./module-c [4] ./module-b.js 1:0-47 + import() ./module-c [6] ./e2.js 2:0-47 +chunk {3} e1.js (e1) 119 bytes >{0}< >{1}< [entry] [rendered] [0] ./module-x.js 49 bytes {3} {4} [built] import() ./module-x [4] ./module-b.js 2:0-20 harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 [5] ./e1.js 70 bytes {3} [built] single entry ./e1 e1 -chunk {4} e2.js (e2) 119 bytes >{0}< >{1}< [entry] [rendered] +chunk {4} e2.js (e2) 119 bytes >{0}< >{2}< [entry] [rendered] [0] ./module-x.js 49 bytes {3} {4} [built] import() ./module-x [4] ./module-b.js 2:0-20 harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 [6] ./e2.js 70 bytes {4} [built] single entry ./e2 e2 -chunk {5} b.js (b) 179 bytes <{2}> >{1}< [rendered] +chunk {5} b.js (b) 179 bytes <{1}> >{2}< [rendered] [4] ./module-b.js 179 bytes {5} [built] import() ./module-b [1] ./module-a.js 1:0-47" `; @@ -1173,8 +1173,8 @@ chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` "Asset Size Chunks Chunk Names - 0.js 730 bytes 0, 5 [emitted] - 1.js 730 bytes 1, 4 [emitted] + 0.js 730 bytes 0, 4 [emitted] + 1.js 730 bytes 1, 5 [emitted] 2.js 730 bytes 2, 3 [emitted] 3.js 661 bytes 3 [emitted] 4.js 661 bytes 4 [emitted] @@ -1185,77 +1185,77 @@ e3.js 9.46 KiB 8 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js -chunk {0} 0.js 37 bytes <{7}> <{8}> [rendered] - [2] ./d.js 9 bytes {0} {6} [built] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {1} 1.js 37 bytes <{6}> <{8}> [rendered] - [3] ./f.js 9 bytes {1} {7} [built] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {2} 2.js 37 bytes <{6}> <{7}> [rendered] - [4] ./h.js 9 bytes {2} {8} [built] - [7] ./async3.js 28 bytes {2} {3} [built] -chunk {3} 3.js 28 bytes <{8}> [rendered] - [7] ./async3.js 28 bytes {2} {3} [built] +chunk {0} 0.js 37 bytes <{6}> <{8}> [rendered] + [3] ./f.js 9 bytes {0} {7} [built] + [6] ./async2.js 28 bytes {0} {4} [built] +chunk {1} 1.js 37 bytes <{6}> <{7}> [rendered] + [4] ./h.js 9 bytes {1} {8} [built] + [7] ./async3.js 28 bytes {1} {5} [built] +chunk {2} 2.js 37 bytes <{7}> <{8}> [rendered] + [2] ./d.js 9 bytes {2} {6} [built] + [5] ./async1.js 28 bytes {2} {3} [built] +chunk {3} 3.js 28 bytes <{6}> [rendered] + [5] ./async1.js 28 bytes {2} {3} [built] chunk {4} 4.js 28 bytes <{7}> [rendered] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {5} 5.js 28 bytes <{6}> [rendered] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {6} e1.js (e1) 152 bytes >{1}< >{2}< >{5}< [entry] [rendered] + [6] ./async2.js 28 bytes {0} {4} [built] +chunk {5} 5.js 28 bytes <{8}> [rendered] + [7] ./async3.js 28 bytes {1} {5} [built] +chunk {6} e1.js (e1) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [2] ./d.js 9 bytes {0} {6} [built] + [2] ./d.js 9 bytes {2} {6} [built] [8] ./e1.js 116 bytes {6} [built] [9] ./c.js 9 bytes {6} [built] -chunk {7} e2.js (e2) 152 bytes >{0}< >{2}< >{4}< [entry] [rendered] +chunk {7} e2.js (e2) 152 bytes >{1}< >{2}< >{4}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [3] ./f.js 9 bytes {1} {7} [built] + [3] ./f.js 9 bytes {0} {7} [built] [10] ./e2.js 116 bytes {7} [built] [11] ./e.js 9 bytes {7} [built] -chunk {8} e3.js (e3) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] +chunk {8} e3.js (e3) 152 bytes >{0}< >{2}< >{5}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [4] ./h.js 9 bytes {2} {8} [built] + [4] ./h.js 9 bytes {1} {8} [built] [12] ./e3.js 116 bytes {8} [built] [13] ./g.js 9 bytes {8} [built]" `; exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` " Asset Size Chunks Chunk Names -async3.js 818 bytes 0 [emitted] async3 -async1.js 818 bytes 1 [emitted] async1 -async2.js 818 bytes 2 [emitted] async2 +async1.js 818 bytes 0 [emitted] async1 +async2.js 818 bytes 1 [emitted] async2 +async3.js 818 bytes 2 [emitted] async3 e1.js 9.31 KiB 3 [emitted] e1 e2.js 9.33 KiB 4 [emitted] e2 e3.js 9.35 KiB 5 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js -chunk {0} async3.js (async3) 89 bytes <{2}> <{5}> >{1}< [rendered] - [4] ./h.js 9 bytes {0} {5} [built] - [7] ./async3.js 80 bytes {0} [built] -chunk {1} async1.js (async1) 89 bytes <{0}> <{3}> >{2}< [rendered] - [2] ./d.js 9 bytes {1} {3} [built] - [5] ./async1.js 80 bytes {1} [built] -chunk {2} async2.js (async2) 89 bytes <{1}> <{4}> >{0}< [rendered] - [3] ./f.js 9 bytes {2} {4} [built] - [6] ./async2.js 80 bytes {2} [built] -chunk {3} e1.js (e1) 144 bytes >{1}< [entry] [rendered] +chunk {0} async1.js (async1) 89 bytes <{2}> <{3}> >{1}< [rendered] + [2] ./d.js 9 bytes {0} {3} [built] + [5] ./async1.js 80 bytes {0} [built] +chunk {1} async2.js (async2) 89 bytes <{0}> <{4}> >{2}< [rendered] + [3] ./f.js 9 bytes {1} {4} [built] + [6] ./async2.js 80 bytes {1} [built] +chunk {2} async3.js (async3) 89 bytes <{1}> <{5}> >{0}< [rendered] + [4] ./h.js 9 bytes {2} {5} [built] + [7] ./async3.js 80 bytes {2} [built] +chunk {3} e1.js (e1) 144 bytes >{0}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [2] ./d.js 9 bytes {1} {3} [built] + [2] ./d.js 9 bytes {0} {3} [built] [8] ./e1.js 108 bytes {3} [built] [9] ./c.js 9 bytes {3} [built] -chunk {4} e2.js (e2) 144 bytes >{2}< [entry] [rendered] +chunk {4} e2.js (e2) 144 bytes >{1}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [3] ./f.js 9 bytes {2} {4} [built] + [3] ./f.js 9 bytes {1} {4} [built] [10] ./e2.js 108 bytes {4} [built] [11] ./e.js 9 bytes {4} [built] -chunk {5} e3.js (e3) 144 bytes >{0}< [entry] [rendered] +chunk {5} e3.js (e3) 144 bytes >{2}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [4] ./h.js 9 bytes {0} {5} [built] + [4] ./h.js 9 bytes {2} {5} [built] [12] ./e3.js 108 bytes {5} [built] [13] ./g.js 9 bytes {5} [built]" `; @@ -1389,25 +1389,25 @@ Child child: `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"Hash: c52867ded6f77bcf50cc +"Hash: 1d0e2ce94b197ef0ad5d Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names cir1.js 299 bytes 0 [emitted] cir1 ab.js 183 bytes 1 [emitted] ab - abd.js 277 bytes 2, 1 [emitted] abd + abd.js 268 bytes 2, 1 [emitted] abd cir2.js 299 bytes 3 [emitted] cir2 main.js 9.09 KiB 4 [emitted] main -cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 - chunk.js 190 bytes 6, 7 [emitted] chunk - ac in ab.js 130 bytes 7 [emitted] ac in ab + ac in ab.js 130 bytes 5 [emitted] ac in ab + chunk.js 190 bytes 6, 5 [emitted] chunk +cir2 from cir1.js 359 bytes 7, 3 [emitted] cir2 from cir1 Entrypoint main = main.js -chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> >{5}< [rendered] +chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> >{7}< [rendered] > [3] ./circular2.js 1:0-79 > [3] ./circular2.js 1:0-79 > [8] ./index.js 13:0-54 [2] ./circular1.js 81 bytes {0} [built] -chunk {1} ab.js (ab) 0 bytes <{4}> >{7}< [rendered] +chunk {1} ab.js (ab) 0 bytes <{4}> >{5}< [rendered] > [8] ./index.js 1:0-6:8 [0] ./modules/a.js 0 bytes {1} {2} [built] [1] ./modules/b.js 0 bytes {1} {2} [built] @@ -1415,27 +1415,27 @@ chunk {2} abd.js (abd) 0 bytes <{4}> >{6}< [rendered] > [8] ./index.js 8:0-11:9 [0] ./modules/a.js 0 bytes {1} {2} [built] [1] ./modules/b.js 0 bytes {1} {2} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] + [5] ./modules/d.js 0 bytes {2} {6} [built] chunk {3} cir2.js (cir2) 81 bytes <{4}> >{0}< [rendered] > [8] ./index.js 14:0-54 - [3] ./circular2.js 81 bytes {3} {5} [built] + [3] ./circular2.js 81 bytes {3} {7} [built] chunk {4} main.js (main) 523 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] > ./index main [4] ./modules/f.js 0 bytes {4} [built] [8] ./index.js 523 bytes {4} [built] -chunk {5} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> [rendered] - > [2] ./circular1.js 1:0-79 - > [2] ./circular1.js 1:0-79 - [3] ./circular2.js 81 bytes {3} {5} [built] - [7] ./modules/e.js 0 bytes {5} [built] -chunk {6} chunk.js (chunk) 0 bytes <{2}> <{7}> [rendered] +chunk {5} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] + > [8] ./index.js 2:1-5:15 + [6] ./modules/c.js 0 bytes {5} {6} [built] +chunk {6} chunk.js (chunk) 0 bytes <{2}> <{5}> [rendered] > [8] ./index.js 3:2-4:13 > [8] ./index.js 9:1-10:12 - [5] ./modules/c.js 0 bytes {6} {7} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] -chunk {7} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] - > [8] ./index.js 2:1-5:15 - [5] ./modules/c.js 0 bytes {6} {7} [built]" + [5] ./modules/d.js 0 bytes {2} {6} [built] + [6] ./modules/c.js 0 bytes {5} {6} [built] +chunk {7} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> [rendered] + > [2] ./circular1.js 1:0-79 + > [2] ./circular1.js 1:0-79 + [3] ./circular2.js 81 bytes {3} {7} [built] + [7] ./modules/e.js 0 bytes {7} [built]" `; exports[`StatsTestCases should print correct stats for parse-error 1`] = ` @@ -1708,17 +1708,17 @@ chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" `; exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` -"chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] +"chunk {0} a.js (a) 136 bytes <{3}> >{4}< >{5}< (prefetch: {4} {5}) [rendered] chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] -chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] +chunk {2} c.js (c) 134 bytes <{3}> >{10}< >{9}< (preload: {9} {10}) [rendered] chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] -chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] -chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] +chunk {4} a1.js (a1) 0 bytes <{0}> [rendered] +chunk {5} a2.js (a2) 0 bytes <{0}> [rendered] chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] chunk {7} b2.js (b2) 0 bytes <{1}> [rendered] chunk {8} b3.js (b3) 0 bytes <{1}> [rendered] -chunk {9} a1.js (a1) 0 bytes <{0}> [rendered] -chunk {10} a2.js (a2) 0 bytes <{0}> [rendered]" +chunk {9} c1.js (c1) 0 bytes <{2}> [rendered] +chunk {10} c2.js (c2) 0 bytes <{2}> [rendered]" `; exports[`StatsTestCases should print correct stats for preload 1`] = ` @@ -2038,9 +2038,9 @@ Entrypoint entry = entry.js `; exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` -"Hash: f47bea8ea571296b32b82a4cd6b69820dd6e8c36 +"Hash: cc16a0dfba6b532cf00e1421f841e8a050c2d66b Child - Hash: f47bea8ea571296b32b8 + Hash: cc16a0dfba6b532cf00e Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Entrypoint first = vendor.js first.js @@ -2051,13 +2051,13 @@ Child [3] ./common.js 37 bytes {4} {5} [built] [4] ./lazy_shared.js 31 bytes {0} [built] [5] ./vendor.js 25 bytes {3} [built] - [6] ./lazy_first.js 55 bytes {2} [built] - [7] ./lazy_second.js 55 bytes {1} [built] + [6] ./lazy_first.js 55 bytes {1} [built] + [7] ./lazy_second.js 55 bytes {2} [built] [8] ./first.js 207 bytes {4} [built] [9] ./module_first.js 31 bytes {4} [built] [10] ./second.js 177 bytes {5} [built] Child - Hash: 2a4cd6b69820dd6e8c36 + Hash: 1421f841e8a050c2d66b Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Entrypoint first = vendor.js first.js @@ -2070,7 +2070,7 @@ Child [3] ./vendor.js 25 bytes {3} [built] [4] ./lazy_shared.js 31 bytes {0} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()), ./second.js (referenced with import()) - [5] ./lazy_second.js 55 bytes {1} [built] + [5] ./lazy_second.js 55 bytes {2} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) [6] ./second.js 177 bytes {5} [built] ModuleConcatenation bailout: Module is an entry point @@ -2080,7 +2080,7 @@ Child | ./first.js 207 bytes [built] | ModuleConcatenation bailout: Module is an entry point | ./module_first.js 31 bytes [built] - [8] ./lazy_first.js 55 bytes {2} [built] + [8] ./lazy_first.js 55 bytes {1} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import())" `; @@ -2118,14 +2118,14 @@ Entrypoint main = main.js harmony import specifier ./components [3] ./foo.js 3:20-25 (skipped side-effect-free modules) harmony side effect evaluation ./CompA [7] ./components/src/CompAB/index.js 1:0-43 harmony export imported specifier ./CompA [7] ./components/src/CompAB/index.js 1:0-43 -[5] ./components/src/CompC/CompC.js 33 bytes [built] - [no exports used] - harmony side effect evaluation ./CompC [6] ./components/src/CompC/index.js 1:0-34 - harmony export imported specifier ./CompC [6] ./components/src/CompC/index.js 1:0-34 -[6] ./components/src/CompC/index.js 34 bytes [built] +[5] ./components/src/CompC/index.js 34 bytes [built] [no exports used] harmony side effect evaluation ./CompC [2] ./components/src/index.js 2:0-43 harmony export imported specifier ./CompC [2] ./components/src/index.js 2:0-43 +[6] ./components/src/CompC/CompC.js 33 bytes [built] + [no exports used] + harmony side effect evaluation ./CompC [5] ./components/src/CompC/index.js 1:0-34 + harmony export imported specifier ./CompC [5] ./components/src/CompC/index.js 1:0-34 [7] ./components/src/CompAB/index.js 87 bytes [built] [no exports used] harmony side effect evaluation ./CompAB [2] ./components/src/index.js 1:0-40 @@ -2180,12 +2180,83 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` Entrypoint a = default/a.js Entrypoint b = default/b.js Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{4}> <{9}> ={0}= ={1}= ={3}= ={5}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + > ./g [] 6:0-47 + > ./g [] 6:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={4}= ={5}= >{2}< >{7}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + chunk {4} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{7}< [rendered] + > ./a [8] ./index.js 1:0-47 + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {5} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + > ./b [8] ./index.js 2:0-47 + [5] ./b.js 72 bytes {5} {11} [built] + chunk {6} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + > ./c [8] ./index.js 3:0-47 + [6] ./c.js 72 bytes {6} {12} [built] + chunk {7} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{4}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {7} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={6}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) + > ./c [8] ./index.js 3:0-47 + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{8}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {9} [built] + chunk {10} default/a.js (a) 216 bytes >{2}< >{7}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + > ./b b + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] + [5] ./b.js 72 bytes {5} {11} [built] + chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + > ./c c + [0] ./d.js 20 bytes {1} {10} {11} {12} [built] + [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] + [2] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./node_modules/z.js 20 bytes {8} {12} [built] + [6] ./c.js 72 bytes {6} {12} [built] +Child all-chunks: + Entrypoint main = default/main.js + Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a.js + Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/b.js + Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js + chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + > ./a a + > ./b b + > ./c c + > ./a [8] ./index.js 1:0-47 + > ./b [8] ./index.js 2:0-47 + > ./c [8] ./index.js 3:0-47 + [2] ./node_modules/x.js 20 bytes {0} [built] + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 @@ -2195,60 +2266,57 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 - [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b) + [1] ./f.js 20 bytes {2} {11} {12} [built] + chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + > ./a a + > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + [3] ./node_modules/y.js 20 bytes {3} [built] + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + > ./c c + > ./c [8] ./index.js 3:0-47 + [7] ./node_modules/z.js 20 bytes {4} [built] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: vendors) (name: vendors~async-c) - > ./c [8] ./index.js 3:0-47 - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + chunk {10} default/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 152 bytes [entry] [rendered] + chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] > ./b b [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] - chunk {12} default/c.js (c) 152 bytes [entry] [rendered] + [1] ./f.js 20 bytes {2} {11} {12} [built] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - [2] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] -Child all-chunks: + [1] ./f.js 20 bytes {2} {11} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] +Child manual: Entrypoint main = default/main.js - Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a.js - Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/b.js - Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js - chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + Entrypoint a = default/vendors.js default/a.js + Entrypoint b = default/vendors.js default/b.js + Entrypoint c = default/vendors.js default/c.js + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={1}= ={2}= ={3}= ={6}= ={7}= ={8}= >{4}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a a > ./b b > ./c c @@ -2256,117 +2324,49 @@ Child all-chunks: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + [3] ./node_modules/y.js 20 bytes {0} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [9] multi x y z 52 bytes {0} [built] + chunk {1} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{4}< [rendered] > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) - > ./g [] 6:0-47 - > ./g [] 6:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) - > ./a a - > ./b b - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) - > ./c c - > ./c [8] ./index.js 3:0-47 - [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] - > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {2} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] + chunk {3} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 176 bytes ={0}= ={3}= >{2}< >{5}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] - > ./b b - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] - chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] - > ./c c - [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] -Child manual: - Entrypoint main = default/main.js - Entrypoint a = default/vendors.js default/a.js - Entrypoint b = default/vendors.js default/b.js - Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./a a - > ./b b - > ./c c - > ./a [8] ./index.js 1:0-47 - > ./b [8] ./index.js 2:0-47 - > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - [3] ./node_modules/y.js 20 bytes {0} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] + chunk {4} default/async-g.js (async-g) 54 bytes <{0}> <{1}> <{6}> [rendered] > ./g [] 6:0-47 > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [10] ./g.js 34 bytes {4} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered] + chunk {6} default/a.js (a) 176 bytes ={0}= >{4}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] Child name-too-long: Entrypoint main = main.js Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-a.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js @@ -2438,126 +2438,126 @@ Child custom-chunks-filter: Entrypoint a = default/a.js Entrypoint b = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-a~async-b~b.js default/b.js Entrypoint c = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/c.js - chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c~b~c) + chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~async-c~b~c) > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} {10} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~b) + chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-a~async-b~b) > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} {10} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{5}< [entry] [rendered] + chunk {10} default/a.js (a) 216 bytes >{2}< >{8}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [2] ./node_modules/x.js 20 bytes {0} {10} [built] [3] ./node_modules/y.js 20 bytes {3} {10} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 112 bytes ={0}= ={3}= [entry] [rendered] > ./b b [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} default/c.js (c) 112 bytes ={0}= ={4}= [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] Child custom-chunks-filter-in-cache-groups: Entrypoint main = default/main.js Entrypoint a = default/a.js Entrypoint b = default/vendors.js default/b.js Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={1}= ={2}= ={3}= ={7}= ={8}= >{4}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} {6} [built] - [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 216 bytes >{1}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] [2] ./node_modules/x.js 20 bytes {0} {6} [built] [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [9] multi x y z 52 bytes {0} [built] + chunk {1} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] + chunk {3} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] + chunk {4} default/async-g.js (async-g) 54 bytes <{0}> <{1}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [10] ./g.js 34 bytes {4} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 216 bytes >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built]" + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built]" `; exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` diff --git a/test/configCases/chunk-index/order-multiple-entries/a.js b/test/configCases/chunk-index/order-multiple-entries/a.js new file mode 100644 index 000000000..7777e2e08 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/a.js @@ -0,0 +1 @@ +import "./shared"; \ No newline at end of file diff --git a/test/configCases/chunk-index/order-multiple-entries/async.js b/test/configCases/chunk-index/order-multiple-entries/async.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/b.js b/test/configCases/chunk-index/order-multiple-entries/b.js new file mode 100644 index 000000000..7777e2e08 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/b.js @@ -0,0 +1 @@ +import "./shared"; \ No newline at end of file diff --git a/test/configCases/chunk-index/order-multiple-entries/c.js b/test/configCases/chunk-index/order-multiple-entries/c.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/entry1.js b/test/configCases/chunk-index/order-multiple-entries/entry1.js new file mode 100644 index 000000000..32a5fa8c8 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/entry1.js @@ -0,0 +1,6 @@ +import "./a"; +import(/* webpackChunkName: "async" */ "./async"); +import "./b"; +import "./c"; + +it("should compile", () => {}); diff --git a/test/configCases/chunk-index/order-multiple-entries/entry2.js b/test/configCases/chunk-index/order-multiple-entries/entry2.js new file mode 100644 index 000000000..aa9ec2317 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/entry2.js @@ -0,0 +1,6 @@ +import "./c"; +import(/* webpackChunkName: "async" */ "./async"); +import "./b"; +import "./a"; + +it("should compile", () => {}); diff --git a/test/configCases/chunk-index/order-multiple-entries/shared.js b/test/configCases/chunk-index/order-multiple-entries/shared.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/test.config.js b/test/configCases/chunk-index/order-multiple-entries/test.config.js new file mode 100644 index 000000000..65c1791bc --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle: function(i, options) { + return ["entry1.js", "entry2.js"]; + } +}; diff --git a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js new file mode 100644 index 000000000..52dd63192 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js @@ -0,0 +1,95 @@ +/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../lib/Module")} Module */ + +module.exports = { + entry: { + entry1: "./entry1", + entry2: "./entry2" + }, + output: { + filename: "[name].js" + }, + plugins: [ + function() { + /** + * @param {Compilation} compilation compilation + * @returns {void} + */ + const handler = compilation => { + compilation.hooks.afterSeal.tap("testcase", () => { + const data = {}; + for (const [name, group] of compilation.namedChunkGroups) { + /** @type {Map} */ + const modules = new Map(); + const modules2 = new Map(); + for (const chunk of group.chunks) { + for (const module of chunk.modulesIterable) { + modules.set(module, group.getModuleIndex(module)); + modules2.set(module, group.getModuleIndex2(module)); + } + } + const sortedModules = Array.from(modules).sort((a, b) => { + return a[1] - b[1]; + }); + const sortedModules2 = Array.from(modules2).sort((a, b) => { + return a[1] - b[1]; + }); + const text = sortedModules + .map( + ([m, index]) => + `${index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + const text2 = sortedModules2 + .map( + ([m, index]) => + `${index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + data[name + "Index"] = text; + data[name + "Index2"] = text2; + } + expect(data).toEqual({ + entry1Index: + "0: ./entry1.js, 1: ./a.js, 2: ./shared.js, 3: ./b.js, 4: ./c.js", + entry1Index2: + "0: ./shared.js, 1: ./a.js, 2: ./b.js, 3: ./c.js, 4: ./entry1.js", + entry2Index: + "0: ./entry2.js, 1: ./c.js, 2: ./b.js, 3: ./shared.js, 4: ./a.js", + entry2Index2: + "0: ./c.js, 1: ./shared.js, 2: ./b.js, 3: ./a.js, 4: ./entry2.js", + asyncIndex: "0: ./async.js", + asyncIndex2: "0: ./async.js" + }); + const indicies = compilation.modules + .map( + m => + `${m.index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + const indicies2 = compilation.modules + .map( + m => + `${m.index2}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + expect(indicies).toEqual( + "2: ./shared.js, 4: ./c.js, 3: ./b.js, 1: ./a.js, 6: ./async.js, 5: ./entry2.js, 0: ./entry1.js" + ); + expect(indicies2).toEqual( + "0: ./shared.js, 3: ./c.js, 2: ./b.js, 1: ./a.js, 6: ./async.js, 5: ./entry2.js, 4: ./entry1.js" + ); + }); + }; + this.hooks.compilation.tap("testcase", handler); + } + ] +}; From 6c8fc73f2f747464e76e4a58e7d3daef3e216002 Mon Sep 17 00:00:00 2001 From: Sean Larkin Date: Tue, 26 Jun 2018 10:57:17 -0700 Subject: [PATCH 24/31] chore(pgk): add update-snapshot script for all tests --- _SETUP.md | 6 ++++++ package.json | 1 + 2 files changed, 7 insertions(+) diff --git a/_SETUP.md b/_SETUP.md index 8c080252e..ebd501013 100644 --- a/_SETUP.md +++ b/_SETUP.md @@ -51,6 +51,12 @@ or in watch mode yarn test:unit --watch ``` +### To update Jest snapshots use + +```bash +yarn test:update-snapshots +``` + ### To run code formatter (prettier) run ```bash diff --git a/package.json b/package.json index b333c6c4a..cc59d3c3c 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "scripts": { "setup": "node ./setup/setup.js", "test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest", + "test:update-snapshots": "yarn test -u", "test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\"", "test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"", "test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\"", From f6a86d8c6c771c350bde59525e756f7b420a7c55 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 27 Jun 2018 14:02:37 +0200 Subject: [PATCH 25/31] improve test case --- test/configCases/optimization/hashed-module-ids/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/configCases/optimization/hashed-module-ids/index.js b/test/configCases/optimization/hashed-module-ids/index.js index 8741cc817..93aeb5474 100644 --- a/test/configCases/optimization/hashed-module-ids/index.js +++ b/test/configCases/optimization/hashed-module-ids/index.js @@ -1,10 +1,7 @@ -var path = require("path"); - it("should have named modules ids", function() { for (var i = 1; i <= 5; i++) { - var expectedModuleId = "file" + i + ".js"; var moduleId = require("./files/file" + i + ".js"); - expect(path.basename(moduleId)).not.toBe(expectedModuleId); + expect(moduleId).toMatch(/^[/=a-zA-Z0-9]{4,5}$/); } }); From 17fa26c0adab297e3579199080fa8a56b14a5bcd Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 27 Jun 2018 15:47:45 +0200 Subject: [PATCH 26/31] use jest directly --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cc59d3c3c..d89dedbf7 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "scripts": { "setup": "node ./setup/setup.js", "test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest", - "test:update-snapshots": "yarn test -u", + "test:update-snapshots": "yarn jest -u", "test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\"", "test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"", "test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\"", From 5c4ffd5b90400ba245390ba9c0011f5bfd6747f7 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 28 Jun 2018 11:03:08 +0200 Subject: [PATCH 27/31] fix tests and code --- lib/web/JsonpMainTemplatePlugin.js | 4 +- test/ConfigTestCases.test.js | 9 ++- .../crossorigin/set-crossorigin/index.js | 23 ------- .../crossorigin/set-crossorigin/empty.js | 0 .../crossorigin/set-crossorigin/index.js | 67 +++++++++++++++++++ .../set-crossorigin/webpack.config.js | 13 ++++ .../split-chunks/runtime-chunk/a.js | 2 +- .../configCases/web/prefetch-preload/index.js | 4 +- test/helpers/FakeDocument.js | 38 +++++++++++ 9 files changed, 130 insertions(+), 30 deletions(-) delete mode 100644 test/cases/crossorigin/set-crossorigin/index.js rename test/{cases => configCases}/crossorigin/set-crossorigin/empty.js (100%) create mode 100644 test/configCases/crossorigin/set-crossorigin/index.js create mode 100644 test/configCases/crossorigin/set-crossorigin/webpack.config.js diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index 2890f44af..018d2147b 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -162,7 +162,7 @@ class JsonpMainTemplatePlugin { "script.src = jsonpScriptSrc(chunkId);", crossOriginLoading ? Template.asString([ - "if (script.src.indexOf(window.location.origin)) {", + "if (script.src.indexOf(window.location.origin + '/') !== 0) {", Template.indent( `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` ), @@ -224,7 +224,7 @@ class JsonpMainTemplatePlugin { "link.href = jsonpScriptSrc(chunkId);", crossOriginLoading ? Template.asString([ - "if (link.href.indexOf(window.location.origin)) {", + "if (link.href.indexOf(window.location.origin + '/') !== 0) {", Template.indent( `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` ), diff --git a/test/ConfigTestCases.test.js b/test/ConfigTestCases.test.js index 4f3808341..4923509f2 100644 --- a/test/ConfigTestCases.test.js +++ b/test/ConfigTestCases.test.js @@ -178,7 +178,14 @@ describe("ConfigTestCases", () => { expect: expect, setTimeout: setTimeout, clearTimeout: clearTimeout, - document: new FakeDocument() + document: new FakeDocument(), + location: { + href: "https://test.cases/path/index.html", + origin: "https://test.cases", + toString() { + return "https://test.cases/path/index.html"; + } + } }; function _require(currentDirectory, module) { diff --git a/test/cases/crossorigin/set-crossorigin/index.js b/test/cases/crossorigin/set-crossorigin/index.js deleted file mode 100644 index 07d57cc6f..000000000 --- a/test/cases/crossorigin/set-crossorigin/index.js +++ /dev/null @@ -1,23 +0,0 @@ -it("should load script without crossorigin attribute", function(done) { - import("./empty?a" /* webpackChunkName: "chunk-with-crossorigin-attr" */); - // if in browser context, test that crossorigin attribute was not added. - if (typeof document !== 'undefined') { - var script = document.querySelector('script[src="js/chunk-with-crossorigin-attr.web.js"]'); - script.getAttribute('crossorigin').should.be.exactly(null); - } - done(); -}); - -it("should load script with crossorigin attribute 'anonymous'", function(done) { - var originalValue = __webpack_public_path__; - __webpack_public_path__ = 'https://example.com/'; - import("./empty?b" /* webpackChunkName: "chunk-without-crossorigin-attr" */); - __webpack_public_path__ = originalValue; - // if in browser context, test that crossorigin attribute was added. - if (typeof document !== 'undefined') { - var script = document.querySelector('script[src="https://example.com/js/chunk-without-crossorigin-attr.web.js"]'); - script.getAttribute('crossorigin').should.be.exactly('anonymous'); - } - __webpack_public_path__ = originalValue; - done(); -}); diff --git a/test/cases/crossorigin/set-crossorigin/empty.js b/test/configCases/crossorigin/set-crossorigin/empty.js similarity index 100% rename from test/cases/crossorigin/set-crossorigin/empty.js rename to test/configCases/crossorigin/set-crossorigin/empty.js diff --git a/test/configCases/crossorigin/set-crossorigin/index.js b/test/configCases/crossorigin/set-crossorigin/index.js new file mode 100644 index 000000000..6330978d1 --- /dev/null +++ b/test/configCases/crossorigin/set-crossorigin/index.js @@ -0,0 +1,67 @@ +it("should load script without crossorigin attribute (default)", function() { + const promise = import("./empty?a" /* webpackChunkName: "crossorigin-default" */); + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-default.web.js"); + expect(script.src).toBe("https://test.cases/path/crossorigin-default.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (relative)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "../"; + const promise = import("./empty?b" /* webpackChunkName: "crossorigin-relative" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-relative.web.js"); + expect(script.src).toBe("https://test.cases/crossorigin-relative.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (server relative)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "/server/"; + const promise = import("./empty?c" /* webpackChunkName: "crossorigin-server-relative" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-server-relative.web.js"); + expect(script.src).toBe("https://test.cases/server/crossorigin-server-relative.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (same origin)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "https://test.cases/"; + const promise = import("./empty?d" /* webpackChunkName: "crossorigin-same-origin" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-same-origin.web.js"); + expect(script.src).toBe("https://test.cases/crossorigin-same-origin.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script with crossorigin attribute anonymous (different origin)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "https://example.com/"; + const promise = import("./empty?e" /* webpackChunkName: "crossorigin-different-origin" */); + __webpack_public_path__ = originalValue; + + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-different-origin.web.js"); + expect(script.src).toBe("https://example.com/crossorigin-different-origin.web.js"); + expect(script.crossOrigin).toBe("anonymous"); + + return promise; +}); diff --git a/test/configCases/crossorigin/set-crossorigin/webpack.config.js b/test/configCases/crossorigin/set-crossorigin/webpack.config.js new file mode 100644 index 000000000..68eeb96a5 --- /dev/null +++ b/test/configCases/crossorigin/set-crossorigin/webpack.config.js @@ -0,0 +1,13 @@ +module.exports = { + target: "web", + output: { + chunkFilename: "[name].web.js", + crossOriginLoading: "anonymous" + }, + performance: { + hints: false + }, + optimization: { + minimize: false + } +}; diff --git a/test/configCases/split-chunks/runtime-chunk/a.js b/test/configCases/split-chunks/runtime-chunk/a.js index e13568489..fcae91623 100644 --- a/test/configCases/split-chunks/runtime-chunk/a.js +++ b/test/configCases/split-chunks/runtime-chunk/a.js @@ -2,7 +2,7 @@ it("should be able to load the split chunk on demand", () => { const promise = import(/* webpackChunkName: "shared" */ "./shared"); const script = document.head._children[0]; - expect(script.src).toBe("dep~b~shared.js"); + expect(script.src).toBe("https://test.cases/path/dep~b~shared.js"); __non_webpack_require__("./dep~b~shared.js"); diff --git a/test/configCases/web/prefetch-preload/index.js b/test/configCases/web/prefetch-preload/index.js index 9c0086c7a..dec98a7cc 100644 --- a/test/configCases/web/prefetch-preload/index.js +++ b/test/configCases/web/prefetch-preload/index.js @@ -5,18 +5,16 @@ let oldPublicPath; beforeEach(() => { oldNonce = __webpack_nonce__; oldPublicPath = __webpack_public_path__; - global.location = {origin: "https://example.com"}; }); afterEach(() => { __webpack_nonce__ = oldNonce; __webpack_public_path__ = oldPublicPath; - delete global.location; }); it("should prefetch and preload child chunks on chunk load", () => { __webpack_nonce__ = "nonce"; - __webpack_public_path__ = "/public/path/"; + __webpack_public_path__ = "https://example.com/public/path/"; let link, script; diff --git a/test/helpers/FakeDocument.js b/test/helpers/FakeDocument.js index 0c9d80de0..680c51576 100644 --- a/test/helpers/FakeDocument.js +++ b/test/helpers/FakeDocument.js @@ -20,6 +20,8 @@ class FakeElement { this._type = type; this._children = []; this._attributes = Object.create(null); + this._src = undefined; + this._href = undefined; } appendChild(node) { @@ -33,4 +35,40 @@ class FakeElement { getAttribute(name) { return this._attributes[name]; } + + _toRealUrl(value) { + if (/^\//.test(value)) { + return `https://test.cases${value}`; + } else if (/^\.\.\//.test(value)) { + return `https://test.cases${value.substr(2)}`; + } else if (/^\.\//.test(value)) { + return `https://test.cases/path${value.substr(1)}`; + } else if (/^\w+:\/\//.test(value)) { + return value; + } else if (/^\/\//.test(value)) { + return `https:${value}`; + } else { + return `https://test.cases/path/${value}`; + } + } + + set src(value) { + if (this._type === "script") { + this._src = this._toRealUrl(value); + } + } + + get src() { + return this._src; + } + + set href(value) { + if (this._type === "link") { + this._href = this._toRealUrl(value); + } + } + + get href() { + return this._href; + } } From ef2ec255dd30e216ca6f6f88084229d6b6289410 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 28 Jun 2018 11:17:41 +0200 Subject: [PATCH 28/31] update template.md too --- examples/dll-app-and-vendor/0-vendor/template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dll-app-and-vendor/0-vendor/template.md b/examples/dll-app-and-vendor/0-vendor/template.md index e66f844f1..358db39d4 100644 --- a/examples/dll-app-and-vendor/0-vendor/template.md +++ b/examples/dll-app-and-vendor/0-vendor/template.md @@ -1,10 +1,10 @@ This is the vendor build part. -It's built separately from the app part. The vendors dll is only built when vendors has changed and not while the normal development cycle. +It's built separately from the app part. The vendors dll is only built when the array of vendors has changed and not during the normal development cycle. The DllPlugin in combination with the `output.library` option exposes the internal require function as global variable in the target environment. -A manifest is creates which includes mappings from module names to internal ids. +A manifest is created which includes mappings from module names to internal ids. ### webpack.config.js From 7b7d323c5b9de132d57910e751908c561c0ff514 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 28 Jun 2018 15:20:23 +0200 Subject: [PATCH 29/31] upgrade enhanced-resolve --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1e39fad13..d11ca5693 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "ajv": "^6.1.0", "ajv-keywords": "^3.1.0", "chrome-trace-event": "^1.0.0", - "enhanced-resolve": "^4.0.0", + "enhanced-resolve": "^4.1.0", "eslint-scope": "^3.7.1", "json-parse-better-errors": "^1.0.2", "loader-runner": "^2.3.0", diff --git a/yarn.lock b/yarn.lock index 4f12dc3fd..43aaf9ca7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1750,9 +1750,9 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a" +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" From 43563b3afbade93bae91e576ba77423c1444f222 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 28 Jun 2018 17:32:41 +0200 Subject: [PATCH 30/31] hotfix merge issue in watchCases (not in CI) --- test/watchCases/plugins/define-plugin/0/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/watchCases/plugins/define-plugin/0/index.js b/test/watchCases/plugins/define-plugin/0/index.js index f0b05c51d..182e0f038 100644 --- a/test/watchCases/plugins/define-plugin/0/index.js +++ b/test/watchCases/plugins/define-plugin/0/index.js @@ -1,15 +1,17 @@ it("should be able to use dynamic defines in watch mode", function() { const module = require("./module"); - module.should.be.eql({ + expect(module).toEqual({ default: WATCH_STEP, - type: "string" + type: "string", + [Symbol.toStringTag]: "Module" }); }); it("should not update a define when dependencies list is missing", function() { const module2 = require("./module2"); - module2.should.be.eql({ + expect(module2).toEqual({ default: "0", - type: "string" + type: "string", + [Symbol.toStringTag]: "Module" }); }); From e3678aa3767aaeb26ebcf5e3028412bbebdb4f9f Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 28 Jun 2018 17:34:17 +0200 Subject: [PATCH 31/31] 4.13.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d11ca5693..c7cde371d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack", - "version": "4.12.2", + "version": "4.13.0", "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT",