diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index c8f2952d4..7ca970ca1 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -51,6 +51,7 @@ const SideEffectsFlagPlugin = require("./optimize/SideEffectsFlagPlugin"); const FlagDependencyUsagePlugin = require("./FlagDependencyUsagePlugin"); const FlagDependencyExportsPlugin = require("./FlagDependencyExportsPlugin"); const ModuleConcatenationPlugin = require("./optimize/ModuleConcatenationPlugin"); +const AutomaticCommonsChunksPlugin = require("./optimize/AutomaticCommonsChunksPlugin"); const NoEmitOnErrorsPlugin = require("./NoEmitOnErrorsPlugin"); const NamedModulesPlugin = require("./NamedModulesPlugin"); const NamedChunksPlugin = require("./NamedChunksPlugin"); @@ -286,6 +287,40 @@ class WebpackOptionsApply extends OptionsApply { new FlagDependencyUsagePlugin().apply(compiler); if(options.optimization.concatenateModules) new ModuleConcatenationPlugin().apply(compiler); + if(options.optimization.asyncCommonsChunks) { + new AutomaticCommonsChunksPlugin({ + initialChunks: false + }).apply(compiler); + } + if(options.optimization.initialCommonsChunks || options.optimization.initialVendorsChunk) { + let nameOption = options.optimization.initialVendorsChunk; + if(nameOption === true) { + nameOption = { + vendors: /[\\/]node_modules[\\/]/ + }; + } + if(typeof options.optimization.initialVendorChunk === "string") { + nameOption = { + [nameOption]: /[\\/]node_modules[\\/]/ + }; + } + if(nameOption && typeof nameOption === "object") { + nameOption = module => { + if(!module.nameForCondition) return; + const name = module.nameForCondition(); + for(const chunkName of Object.keys(nameOption)) { + const regExp = nameOption[chunkName]; + if(regExp.test(name)) + return chunkName; + } + }; + } + new AutomaticCommonsChunksPlugin({ + initialChunks: true, + onlyNamed: !options.optimization.initialCommonsChunks, + name: nameOption + }).apply(compiler); + } if(options.optimization.noEmitOnErrors) new NoEmitOnErrorsPlugin().apply(compiler); if(options.optimization.namedModules) diff --git a/lib/WebpackOptionsDefaulter.js b/lib/WebpackOptionsDefaulter.js index bd4e46a97..c5e63d154 100644 --- a/lib/WebpackOptionsDefaulter.js +++ b/lib/WebpackOptionsDefaulter.js @@ -164,6 +164,9 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { this.set("optimization.providedExports", true); this.set("optimization.usedExports", "make", options => isProductionLikeMode(options)); this.set("optimization.concatenateModules", "make", options => isProductionLikeMode(options)); + this.set("optimization.asyncCommonsChunks", true); + this.set("optimization.initialCommonsChunks", false); + this.set("optimization.initialVendorsChunk", false); this.set("optimization.noEmitOnErrors", "make", options => isProductionLikeMode(options)); this.set("optimization.namedModules", "make", options => options.mode === "development"); this.set("optimization.namedChunks", "make", options => options.mode === "development"); diff --git a/lib/optimize/AutomaticCommonsChunksPlugin.js b/lib/optimize/AutomaticCommonsChunksPlugin.js new file mode 100644 index 000000000..aeff1161c --- /dev/null +++ b/lib/optimize/AutomaticCommonsChunksPlugin.js @@ -0,0 +1,66 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports = class AutomaticCommonsChunksPlugin { + constructor(options) { + this.options = Object.assign({}, { + initialChunks: false, + onlyNamed: false, + name: undefined + }, options); + } + + apply(compiler) { + compiler.hooks.compilation.tap("AutomaticCommonsChunksPlugin", compilation => { + compilation.hooks.optimizeChunks.tap("AutomaticCommonsChunksPlugin", chunks => { + const indexMap = new Map(); + let index = 1; + for(const chunk of chunks) { + if(chunk.isInitial() === this.options.initialChunks) + indexMap.set(chunk, index++); + } + const chunksModulesMap = new Map(); + const chunksNameMap = new Map(); + for(const module of compilation.modules) { + const chunkIndices = Array.from(module.chunksIterable, chunk => indexMap.get(chunk)).filter(Boolean); + let name = this.options.name; + if(typeof name === "function") + name = name(module); + if(name) { + chunkIndices.push(name); + } else if(this.options.onlyNamed) { + continue; + } + if(chunkIndices.length <= 1) continue; + const key = chunkIndices.sort().join(); + let modules = chunksModulesMap.get(key); + if(modules === undefined) { + chunksModulesMap.set(key, modules = []); + if(name) { + chunksNameMap.set(key, name); + } + } + modules.push(module); + } + for(const [key, modules] of chunksModulesMap.entries()) { + let chunkName = chunksNameMap.get(key); + const newChunk = compilation.addChunk(chunkName); + for(const chunk of modules[0].chunksIterable) { + chunk.split(newChunk); + for(const module of modules) { + chunk.removeModule(module); + module.rewriteChunkInReasons(chunk, [newChunk]); + } + } + for(const module of modules) { + newChunk.addModule(module); + module.addChunk(newChunk); + } + } + }); + }); + } +}; diff --git a/lib/webpack.js b/lib/webpack.js index 9da651e58..339c0a62d 100644 --- a/lib/webpack.js +++ b/lib/webpack.js @@ -106,6 +106,7 @@ exportPlugins(exports, { exportPlugins(exports.optimize = {}, { "AggressiveMergingPlugin": () => require("./optimize/AggressiveMergingPlugin"), "AggressiveSplittingPlugin": () => require("./optimize/AggressiveSplittingPlugin"), + "AutomaticCommonsChunksPlugin": () => require("./optimize/AutomaticCommonsChunksPlugin"), "CommonsChunkPlugin": () => require("./optimize/CommonsChunkPlugin"), "ChunkModuleIdRangePlugin": () => require("./optimize/ChunkModuleIdRangePlugin"), "DedupePlugin": () => require("./optimize/DedupePlugin"), diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 779d913bb..a63abda58 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1323,6 +1323,35 @@ "description": "Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer", "type": "boolean" }, + "asyncCommonsChunks": { + "description": "Automatically deduplicate modules in on-demand chunks by creating additional async-loaded shared chunks", + "type": "boolean" + }, + "initialCommonsChunks": { + "description": "Automatically deduplicate modules in initial chunks by creating additional initial-loaded shared chunks (These chunks need to be added to the HTML)", + "type": "boolean" + }, + "initialVendorsChunk": { + "description": "Automatically extract vendor modules (inside of node_modules) into separate chunk assuming they change less often ", + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": { + "instanceof": "RegExp" + } + }, + { + "type": "string", + "minLength": 1 + }, + { + "instanceof": "Function" + } + ] + }, "noEmitOnErrors": { "description": "Avoid emitting assets when errors occur", "type": "boolean" diff --git a/test/statsCases/aggressive-splitting-on-demand/expected.txt b/test/statsCases/aggressive-splitting-on-demand/expected.txt index 22e4bb453..a2ee27cae 100644 --- a/test/statsCases/aggressive-splitting-on-demand/expected.txt +++ b/test/statsCases/aggressive-splitting-on-demand/expected.txt @@ -1,49 +1,34 @@ -Hash: 68735d6d492523fdd0c6 +Hash: 0f07aca3bcc352ccf4df Time: Xms Asset Size Chunks Chunk Names 8111929f6761a49abd03.js 1.96 KiB 0 [emitted] eed136bb9b1f0de139a9.js 1.94 KiB 1 [emitted] -127dcc911b6e4c95204d.js 1 KiB 2 [emitted] -2bfb7afd1f901f4f309f.js 1.94 KiB 3 [emitted] +a787132a2376949dd13f.js 1.94 KiB 2 [emitted] +c04e6c1042793fb803ed.js 1 KiB 3 [emitted] e013686b7b1ce4bd99ba.js 1.94 KiB 4 [emitted] -5ac554478945d88843c9.js 1 KiB 5 [emitted] +af4d0eb806c83010aa9c.js 1 KiB 5 [emitted] 2eb796a695b728235608.js 1.01 KiB 6 [emitted] -8d11ec270922149a5452.js 8.37 KiB 7 [emitted] main -Entrypoint main = 8d11ec270922149a5452.js -chunk {0} 8111929f6761a49abd03.js 1.76 KiB {7} [recorded] - > aggressive-splitted duplicate [11] ./index.js 4:0-51 - > aggressive-splitted duplicate [11] ./index.js 5:0-44 - > aggressive-splitted duplicate [11] ./index.js 6:0-72 +810442a28510d745748d.js 8.31 KiB 7 [emitted] main +Entrypoint main = 810442a28510d745748d.js +chunk {0} 8111929f6761a49abd03.js 1.76 KiB {7} [3] ./f.js 899 bytes {0} [built] [4] ./g.js 901 bytes {0} [built] -chunk {1} eed136bb9b1f0de139a9.js 1.76 KiB {7} [recorded] - > aggressive-splitted duplicate [11] ./index.js 3:0-30 - > aggressive-splitted duplicate [11] ./index.js 5:0-44 - > aggressive-splitted duplicate [11] ./index.js 6:0-72 +chunk {1} eed136bb9b1f0de139a9.js 1.76 KiB {7} [1] ./d.js 899 bytes {1} [built] [2] ./e.js 899 bytes {1} [built] -chunk {2} 127dcc911b6e4c95204d.js 899 bytes {7} - > aggressive-splitted duplicate [11] ./index.js 2:0-23 - > aggressive-splitted duplicate [11] ./index.js 3:0-30 - [5] ./c.js 899 bytes {2} [built] -chunk {3} 2bfb7afd1f901f4f309f.js 1.76 KiB {7} [recorded] - > aggressive-splitted duplicate [11] ./index.js 4:0-51 - > aggressive-splitted duplicate [11] ./index.js 6:0-72 - [8] ./j.js 901 bytes {3} [built] - [9] ./k.js 899 bytes {3} [built] +chunk {2} a787132a2376949dd13f.js 1.76 KiB {7} [recorded] + [8] ./j.js 901 bytes {2} [built] + [9] ./k.js 899 bytes {2} [built] +chunk {3} c04e6c1042793fb803ed.js 899 bytes {7} + [0] ./b.js 899 bytes {3} [built] chunk {4} e013686b7b1ce4bd99ba.js 1.76 KiB {7} [recorded] - > aggressive-splitted duplicate [11] ./index.js 4:0-51 - > aggressive-splitted duplicate [11] ./index.js 6:0-72 [6] ./h.js 899 bytes {4} [built] [7] ./i.js 899 bytes {4} [built] -chunk {5} 5ac554478945d88843c9.js 899 bytes {7} - > aggressive-splitted duplicate [11] ./index.js 2:0-23 - > aggressive-splitted duplicate [11] ./index.js 5:0-44 - > aggressive-splitted duplicate [11] ./index.js 6:0-72 - [0] ./b.js 899 bytes {5} [built] +chunk {5} af4d0eb806c83010aa9c.js 899 bytes {7} + [5] ./c.js 899 bytes {5} [built] chunk {6} 2eb796a695b728235608.js 899 bytes {7} > [11] ./index.js 1:0-16 [10] ./a.js 899 bytes {6} [built] -chunk {7} 8d11ec270922149a5452.js (main) 248 bytes [entry] +chunk {7} 810442a28510d745748d.js (main) 248 bytes [entry] > main [11] ./index.js [11] ./index.js 248 bytes {7} [built] \ No newline at end of file diff --git a/test/statsCases/async-commons-chunk-auto/a.js b/test/statsCases/async-commons-chunk-auto/a.js new file mode 100644 index 000000000..a718657a7 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/a.js @@ -0,0 +1,6 @@ +import "./d"; +import "./e"; +import "x"; +import "y"; +export default "a"; +import("./g"); diff --git a/test/statsCases/async-commons-chunk-auto/b.js b/test/statsCases/async-commons-chunk-auto/b.js new file mode 100644 index 000000000..fd909a7b6 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/b.js @@ -0,0 +1,5 @@ +import "./d"; +import "./f"; +import "x"; +import "y"; +export default "b"; diff --git a/test/statsCases/async-commons-chunk-auto/c.js b/test/statsCases/async-commons-chunk-auto/c.js new file mode 100644 index 000000000..6bbf24bfe --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/c.js @@ -0,0 +1,5 @@ +import "./d"; +import "./f"; +import "x"; +import "z"; +export default "c"; diff --git a/test/statsCases/async-commons-chunk-auto/d.js b/test/statsCases/async-commons-chunk-auto/d.js new file mode 100644 index 000000000..987d6d7e4 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/d.js @@ -0,0 +1 @@ +export default "d"; diff --git a/test/statsCases/async-commons-chunk-auto/e.js b/test/statsCases/async-commons-chunk-auto/e.js new file mode 100644 index 000000000..d97e38b22 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/e.js @@ -0,0 +1 @@ +export default "e"; diff --git a/test/statsCases/async-commons-chunk-auto/expected.txt b/test/statsCases/async-commons-chunk-auto/expected.txt new file mode 100644 index 000000000..f01728e58 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/expected.txt @@ -0,0 +1,43 @@ +Entrypoint main = main.js +Entrypoint a = 2.js 3.js a.js +Entrypoint b = 2.js 3.js 0.js b.js +Entrypoint c = 2.js 0.js c.js +chunk {0} 0.js 20 bytes {2} {3} {4} {7} {8} [initial] [rendered] + [2] ./f.js 20 bytes {0} [built] +chunk {1} 1.chunk.js 34 bytes {2} {3} {4} {8} [rendered] + > [] 6:0-13 + [8] ./g.js 34 bytes {1} [built] +chunk {2} 2.js 40 bytes {7} [entry] [rendered] + [0] ./d.js 20 bytes {2} [built] + [1] ./node_modules/x.js 20 bytes {2} [built] +chunk {3} 3.js 20 bytes {7} [initial] [rendered] + [3] ./node_modules/y.js 20 bytes {3} [built] +chunk {4} 4.chunk.js 122 bytes {7} [rendered] + > [7] ./index.js 1:0-13 + [5] ./a.js + 1 modules 122 bytes {4} {8} [built] + | ./a.js 87 bytes [built] + | ./e.js 20 bytes [built] +chunk {5} 5.chunk.js 72 bytes {7} [rendered] + > [7] ./index.js 2:0-13 + [4] ./b.js 72 bytes {5} {9} [built] +chunk {6} 6.chunk.js 107 bytes {7} [rendered] + > [7] ./index.js 3:0-13 + [6] ./c.js + 1 modules 107 bytes {6} {10} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] +chunk {7} main.js (main) 45 bytes [entry] [rendered] + > main [7] ./index.js + [7] ./index.js 45 bytes {7} [built] +chunk {8} a.js (a) 122 bytes [initial] [rendered] + > a [] + [5] ./a.js + 1 modules 122 bytes {4} {8} [built] + | ./a.js 87 bytes [built] + | ./e.js 20 bytes [built] +chunk {9} b.js (b) 72 bytes [initial] [rendered] + > b [4] ./b.js + [4] ./b.js 72 bytes {5} {9} [built] +chunk {10} c.js (c) 107 bytes [initial] [rendered] + > c [] + [6] ./c.js + 1 modules 107 bytes {6} {10} [built] + | ./c.js 72 bytes [built] + | ./node_modules/z.js 20 bytes [built] \ No newline at end of file diff --git a/test/statsCases/async-commons-chunk-auto/f.js b/test/statsCases/async-commons-chunk-auto/f.js new file mode 100644 index 000000000..657d4dee8 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/f.js @@ -0,0 +1 @@ +export default "f"; diff --git a/test/statsCases/async-commons-chunk-auto/g.js b/test/statsCases/async-commons-chunk-auto/g.js new file mode 100644 index 000000000..45be0e691 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/g.js @@ -0,0 +1,2 @@ +import "./f"; +export default "g"; diff --git a/test/statsCases/async-commons-chunk-auto/index.js b/test/statsCases/async-commons-chunk-auto/index.js new file mode 100644 index 000000000..274d4952f --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/index.js @@ -0,0 +1,3 @@ +import("./a"); +import("./b"); +import("./c"); diff --git a/test/statsCases/async-commons-chunk-auto/node_modules/x.js b/test/statsCases/async-commons-chunk-auto/node_modules/x.js new file mode 100644 index 000000000..3fd5ecc7a --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/node_modules/x.js @@ -0,0 +1 @@ +export default "x"; diff --git a/test/statsCases/async-commons-chunk-auto/node_modules/y.js b/test/statsCases/async-commons-chunk-auto/node_modules/y.js new file mode 100644 index 000000000..413e7c09d --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/node_modules/y.js @@ -0,0 +1 @@ +export default "y"; diff --git a/test/statsCases/async-commons-chunk-auto/node_modules/z.js b/test/statsCases/async-commons-chunk-auto/node_modules/z.js new file mode 100644 index 000000000..0b3887507 --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/node_modules/z.js @@ -0,0 +1 @@ +export default "z"; diff --git a/test/statsCases/async-commons-chunk-auto/webpack.config.js b/test/statsCases/async-commons-chunk-auto/webpack.config.js new file mode 100644 index 000000000..363664c6a --- /dev/null +++ b/test/statsCases/async-commons-chunk-auto/webpack.config.js @@ -0,0 +1,24 @@ +module.exports = { + mode: "production", + entry: { + main: "./", + a: "./a", + b: "./b", + c: "./c" + }, + output: { + chunkFilename: "[name].chunk.js" + }, + optimization: { + initialVendorChunk: "libs" + }, + stats: { + hash: false, + timings: false, + assets: false, + chunks: true, + chunkOrigins: true, + entrypoints: true, + modules: false + } +}; diff --git a/test/statsCases/commons-chunk-plugin-children/expected.txt b/test/statsCases/commons-chunk-plugin-children/expected.txt index 0141f844c..ec27a75a3 100644 --- a/test/statsCases/commons-chunk-plugin-children/expected.txt +++ b/test/statsCases/commons-chunk-plugin-children/expected.txt @@ -1,107 +1,147 @@ Child normal: Asset Size Chunks Chunk Names - 0.bundle.js 499 bytes 0 [emitted] x1 - 1.bundle.js 815 bytes 1 [emitted] x2 - 2.bundle.js 1.07 KiB 2 [emitted] x3 - 3.bundle.js 1.33 KiB 3 [emitted] x4 - 4.bundle.js 865 bytes 4 [emitted] x5 - 5.bundle.js 1.04 KiB 5 [emitted] xx5 - bundle.js 7.06 KiB 6 [emitted] main + 5.bundle.js 661 bytes 5 [emitted] x2 + 0.bundle.js 127 bytes 0 [emitted] + 2.bundle.js 130 bytes 2 [emitted] + 3.bundle.js 130 bytes 3 [emitted] + 4.bundle.js 441 bytes 4 [emitted] x1 + 1.bundle.js 136 bytes 1 [emitted] + 6.bundle.js 881 bytes 6 [emitted] x3 + 7.bundle.js 1.08 KiB 7 [emitted] x4 + 8.bundle.js 815 bytes 8 [emitted] x5 + 9.bundle.js 939 bytes 9 [emitted] xx5 + bundle.js 7.44 KiB 10 [emitted] main Entrypoint main = bundle.js - chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered] + chunk {0} 0.bundle.js 0 bytes {10} [rendered] + [0] ./a.js 0 bytes {0} [built] + chunk {1} 1.bundle.js 0 bytes {10} [rendered] + [1] ./b.js 0 bytes {1} [built] + chunk {2} 2.bundle.js 0 bytes {0+1+8} {10} [rendered] + [2] ./c.js 0 bytes {2} [built] + chunk {3} 3.bundle.js 0 bytes {0+1+8} {10} [rendered] + [3] ./d.js 0 bytes {3} [built] + chunk {4} 4.bundle.js (x1) 14 bytes {10} [rendered] > x1 [11] ./index.js 1:0-42 - [0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built] - [6] ./x1.js 14 bytes {0} [built] - chunk {1} 1.bundle.js (x2) 28 bytes {6} [rendered] + [6] ./x1.js 14 bytes {4} [built] + chunk {5} 5.bundle.js (x2) 28 bytes {10} [rendered] > x2 [11] ./index.js 2:0-42 - [0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built] - [1] ./b.js 0 bytes {1} {2} {3} {4} [built] - [7] ./x2.js 28 bytes {1} [built] - chunk {2} 2.bundle.js (x3) 42 bytes {6} [rendered] + [7] ./x2.js 28 bytes {5} [built] + chunk {6} 6.bundle.js (x3) 42 bytes {10} [rendered] > x3 [11] ./index.js 3:0-42 - [0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built] - [1] ./b.js 0 bytes {1} {2} {3} {4} [built] - [2] ./c.js 0 bytes {2} {3} {5} [built] - [8] ./x3.js 42 bytes {2} [built] - chunk {3} 3.bundle.js (x4) 56 bytes {6} [rendered] + [8] ./x3.js 42 bytes {6} [built] + chunk {7} 7.bundle.js (x4) 56 bytes {10} [rendered] > x4 [11] ./index.js 4:0-42 - [0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built] - [1] ./b.js 0 bytes {1} {2} {3} {4} [built] - [2] ./c.js 0 bytes {2} {3} {5} [built] - [3] ./d.js 0 bytes {3} {5} [built] - [9] ./x4.js 56 bytes {3} [built] - chunk {4} 4.bundle.js (x5) 74 bytes {6} [rendered] + [9] ./x4.js 56 bytes {7} [built] + chunk {8} 8.bundle.js (x5) 74 bytes {10} [rendered] > x5 [11] ./index.js 5:0-42 - [0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built] - [1] ./b.js 0 bytes {1} {2} {3} {4} [built] - [10] ./x5.js 74 bytes {4} [built] - chunk {5} 5.bundle.js (xx5) 42 bytes {4} [rendered] + [10] ./x5.js 74 bytes {8} [built] + chunk {9} 9.bundle.js (xx5) 42 bytes {0+1+8} [rendered] > xx5 [10] ./x5.js 3:0-44 - [2] ./c.js 0 bytes {2} {3} {5} [built] - [3] ./d.js 0 bytes {3} {5} [built] - [4] ./xx5.js 42 bytes {5} [built] - [5] ./e.js 0 bytes {5} [built] - chunk {6} bundle.js (main) 220 bytes [entry] [rendered] + [4] ./xx5.js 42 bytes {9} [built] + [5] ./e.js 0 bytes {9} [built] + chunk {10} bundle.js (main) 220 bytes [entry] [rendered] > main [11] ./index.js - [11] ./index.js 220 bytes {6} [built] + [11] ./index.js 220 bytes {10} [built] Child children: Asset Size Chunks Chunk Names - 0.bundle.js 441 bytes 0 [emitted] x1 - 1.bundle.js 661 bytes 1 [emitted] x2 - 2.bundle.js 939 bytes 2 [emitted] x3 - 3.bundle.js 1.19 KiB 3 [emitted] x4 - 4.bundle.js 749 bytes 4 [emitted] x5 - 5.bundle.js 1.04 KiB 5 [emitted] xx5 - bundle.js 7.18 KiB 6 [emitted] main + 0.bundle.js 130 bytes 0 [emitted] + 1.bundle.js 130 bytes 1 [emitted] + 2.bundle.js 441 bytes 2 [emitted] x1 + 3.bundle.js 661 bytes 3 [emitted] x2 + 4.bundle.js 881 bytes 4 [emitted] x3 + 5.bundle.js 1.08 KiB 5 [emitted] x4 + 6.bundle.js 815 bytes 6 [emitted] x5 + 7.bundle.js 939 bytes 7 [emitted] xx5 + bundle.js 7.28 KiB 8 [emitted] main Entrypoint main = bundle.js - chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered] + chunk {0} 0.bundle.js 0 bytes {6} {8} [rendered] + [2] ./c.js 0 bytes {0} [built] + chunk {1} 1.bundle.js 0 bytes {6} {8} [rendered] + [3] ./d.js 0 bytes {1} [built] + chunk {2} 2.bundle.js (x1) 14 bytes {8} [rendered] > x1 [11] ./index.js 1:0-42 - [6] ./x1.js 14 bytes {0} [built] - chunk {1} 1.bundle.js (x2) 28 bytes {6} [rendered] + [6] ./x1.js 14 bytes {2} [built] + chunk {3} 3.bundle.js (x2) 28 bytes {8} [rendered] > x2 [11] ./index.js 2:0-42 - [7] ./x2.js 28 bytes {1} [built] - chunk {2} 2.bundle.js (x3) 42 bytes {6} [rendered] + [7] ./x2.js 28 bytes {3} [built] + chunk {4} 4.bundle.js (x3) 42 bytes {8} [rendered] > x3 [11] ./index.js 3:0-42 - [0] ./c.js 0 bytes {2} {3} {5} [built] - [8] ./x3.js 42 bytes {2} [built] - chunk {3} 3.bundle.js (x4) 56 bytes {6} [rendered] + [8] ./x3.js 42 bytes {4} [built] + chunk {5} 5.bundle.js (x4) 56 bytes {8} [rendered] > x4 [11] ./index.js 4:0-42 - [0] ./c.js 0 bytes {2} {3} {5} [built] - [3] ./d.js 0 bytes {3} {5} [built] - [9] ./x4.js 56 bytes {3} [built] - chunk {4} 4.bundle.js (x5) 74 bytes {6} [rendered] + [9] ./x4.js 56 bytes {5} [built] + chunk {6} 6.bundle.js (x5) 74 bytes {8} [rendered] > x5 [11] ./index.js 5:0-42 - [10] ./x5.js 74 bytes {4} [built] - chunk {5} 5.bundle.js (xx5) 42 bytes {4} [rendered] + [10] ./x5.js 74 bytes {6} [built] + chunk {7} 7.bundle.js (xx5) 42 bytes {6} [rendered] > xx5 [10] ./x5.js 3:0-44 - [0] ./c.js 0 bytes {2} {3} {5} [built] - [3] ./d.js 0 bytes {3} {5} [built] - [4] ./xx5.js 42 bytes {5} [built] - [5] ./e.js 0 bytes {5} [built] - chunk {6} bundle.js (main) 220 bytes [entry] [rendered] + [4] ./xx5.js 42 bytes {7} [built] + [5] ./e.js 0 bytes {7} [built] + chunk {8} bundle.js (main) 220 bytes [entry] [rendered] > main [11] ./index.js - [1] ./a.js 0 bytes {6} [built] - [2] ./b.js 0 bytes {6} [built] - [11] ./index.js 220 bytes {6} [built] + [0] ./a.js 0 bytes {8} [built] + [1] ./b.js 0 bytes {8} [built] + [11] ./index.js 220 bytes {8} [built] Child async: Asset Size Chunks Chunk Names - 0.bundle.js 192 bytes 0 [emitted] - 1.bundle.js 441 bytes 1 [emitted] x1 - 2.bundle.js 661 bytes 2 [emitted] x2 - 3.bundle.js 939 bytes 3 [emitted] x3 - 4.bundle.js 1.19 KiB 4 [emitted] x4 - 5.bundle.js 749 bytes 5 [emitted] x5 - 6.bundle.js 1.04 KiB 6 [emitted] xx5 - bundle.js 7.26 KiB 7 [emitted] main + 0.bundle.js 183 bytes 0 [emitted] + 1.bundle.js 130 bytes 1 [emitted] + 2.bundle.js 130 bytes 2 [emitted] + 3.bundle.js 441 bytes 3 [emitted] x1 + 4.bundle.js 661 bytes 4 [emitted] x2 + 5.bundle.js 881 bytes 5 [emitted] x3 + 6.bundle.js 1.08 KiB 6 [emitted] x4 + 7.bundle.js 815 bytes 7 [emitted] x5 + 8.bundle.js 939 bytes 8 [emitted] xx5 + bundle.js 7.34 KiB 9 [emitted] main Entrypoint main = bundle.js - chunk {0} 0.bundle.js 0 bytes {7} [rendered] + chunk {0} 0.bundle.js 0 bytes {9} [rendered] > async commons x1 [11] ./index.js 1:0-42 > async commons x2 [11] ./index.js 2:0-42 > async commons x3 [11] ./index.js 3:0-42 > async commons x4 [11] ./index.js 4:0-42 > async commons x5 [11] ./index.js 5:0-42 [0] ./a.js 0 bytes {0} [built] - [2] ./b.js 0 bytes {0} [built] + [1] ./b.js 0 bytes {0} [built] + chunk {1} 1.bundle.js 0 bytes {7} {9} [rendered] + [2] ./c.js 0 bytes {1} [built] + chunk {2} 2.bundle.js 0 bytes {7} {9} [rendered] + [3] ./d.js 0 bytes {2} [built] + chunk {3} 3.bundle.js (x1) 14 bytes {9} [rendered] + > x1 [11] ./index.js 1:0-42 + [6] ./x1.js 14 bytes {3} [built] + chunk {4} 4.bundle.js (x2) 28 bytes {9} [rendered] + > x2 [11] ./index.js 2:0-42 + [7] ./x2.js 28 bytes {4} [built] + chunk {5} 5.bundle.js (x3) 42 bytes {9} [rendered] + > x3 [11] ./index.js 3:0-42 + [8] ./x3.js 42 bytes {5} [built] + chunk {6} 6.bundle.js (x4) 56 bytes {9} [rendered] + > x4 [11] ./index.js 4:0-42 + [9] ./x4.js 56 bytes {6} [built] + chunk {7} 7.bundle.js (x5) 74 bytes {9} [rendered] + > x5 [11] ./index.js 5:0-42 + [10] ./x5.js 74 bytes {7} [built] + chunk {8} 8.bundle.js (xx5) 42 bytes {7} [rendered] + > xx5 [10] ./x5.js 3:0-44 + [4] ./xx5.js 42 bytes {8} [built] + [5] ./e.js 0 bytes {8} [built] + chunk {9} bundle.js (main) 220 bytes [entry] [rendered] + > main [11] ./index.js + [11] ./index.js 220 bytes {9} [built] +Child deep-children: + Asset Size Chunks Chunk Names + 0.bundle.js 130 bytes 0 [emitted] + 1.bundle.js 441 bytes 1 [emitted] x1 + 2.bundle.js 661 bytes 2 [emitted] x2 + 3.bundle.js 881 bytes 3 [emitted] x3 + 4.bundle.js 1.08 KiB 4 [emitted] x4 + 5.bundle.js 789 bytes 5 [emitted] x5 + 6.bundle.js 939 bytes 6 [emitted] xx5 + bundle.js 7.34 KiB 7 [emitted] main + Entrypoint main = bundle.js + chunk {0} 0.bundle.js 0 bytes {7} [rendered] + [3] ./d.js 0 bytes {0} [built] chunk {1} 1.bundle.js (x1) 14 bytes {7} [rendered] > x1 [11] ./index.js 1:0-42 [6] ./x1.js 14 bytes {1} [built] @@ -110,74 +150,36 @@ Child async: [7] ./x2.js 28 bytes {2} [built] chunk {3} 3.bundle.js (x3) 42 bytes {7} [rendered] > x3 [11] ./index.js 3:0-42 - [1] ./c.js 0 bytes {3} {4} {6} [built] [8] ./x3.js 42 bytes {3} [built] chunk {4} 4.bundle.js (x4) 56 bytes {7} [rendered] > x4 [11] ./index.js 4:0-42 - [1] ./c.js 0 bytes {3} {4} {6} [built] - [3] ./d.js 0 bytes {4} {6} [built] [9] ./x4.js 56 bytes {4} [built] chunk {5} 5.bundle.js (x5) 74 bytes {7} [rendered] > x5 [11] ./index.js 5:0-42 [10] ./x5.js 74 bytes {5} [built] - chunk {6} 6.bundle.js (xx5) 42 bytes {5} [rendered] + chunk {6} 6.bundle.js (xx5) 42 bytes {7} [rendered] > xx5 [10] ./x5.js 3:0-44 - [1] ./c.js 0 bytes {3} {4} {6} [built] - [3] ./d.js 0 bytes {4} {6} [built] [4] ./xx5.js 42 bytes {6} [built] [5] ./e.js 0 bytes {6} [built] chunk {7} bundle.js (main) 220 bytes [entry] [rendered] > main [11] ./index.js + [0] ./a.js 0 bytes {7} [built] + [1] ./b.js 0 bytes {7} [built] + [2] ./c.js 0 bytes {7} [built] [11] ./index.js 220 bytes {7} [built] -Child deep-children: - Asset Size Chunks Chunk Names - 0.bundle.js 441 bytes 0 [emitted] x1 - 1.bundle.js 661 bytes 1 [emitted] x2 - 2.bundle.js 881 bytes 2 [emitted] x3 - 3.bundle.js 1.13 KiB 3 [emitted] x4 - 4.bundle.js 749 bytes 4 [emitted] x5 - 5.bundle.js 1020 bytes 5 [emitted] xx5 - bundle.js 7.3 KiB 6 [emitted] main - Entrypoint main = bundle.js - chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered] - > x1 [11] ./index.js 1:0-42 - [6] ./x1.js 14 bytes {0} [built] - chunk {1} 1.bundle.js (x2) 28 bytes {6} [rendered] - > x2 [11] ./index.js 2:0-42 - [7] ./x2.js 28 bytes {1} [built] - chunk {2} 2.bundle.js (x3) 42 bytes {6} [rendered] - > x3 [11] ./index.js 3:0-42 - [8] ./x3.js 42 bytes {2} [built] - chunk {3} 3.bundle.js (x4) 56 bytes {6} [rendered] - > x4 [11] ./index.js 4:0-42 - [2] ./d.js 0 bytes {3} {5} [built] - [9] ./x4.js 56 bytes {3} [built] - chunk {4} 4.bundle.js (x5) 74 bytes {6} [rendered] - > x5 [11] ./index.js 5:0-42 - [10] ./x5.js 74 bytes {4} [built] - chunk {5} 5.bundle.js (xx5) 42 bytes {6} [rendered] - > xx5 [10] ./x5.js 3:0-44 - [2] ./d.js 0 bytes {3} {5} [built] - [4] ./xx5.js 42 bytes {5} [built] - [5] ./e.js 0 bytes {5} [built] - chunk {6} bundle.js (main) 220 bytes [entry] [rendered] - > main [11] ./index.js - [0] ./a.js 0 bytes {6} [built] - [1] ./b.js 0 bytes {6} [built] - [3] ./c.js 0 bytes {6} [built] - [11] ./index.js 220 bytes {6} [built] Child deep-async: - Asset Size Chunks Chunk Names - 0.bundle.js 239 bytes 0 [emitted] - 1.bundle.js 441 bytes 1 [emitted] x1 - 2.bundle.js 661 bytes 2 [emitted] x2 - 3.bundle.js 881 bytes 3 [emitted] x3 - 4.bundle.js 1.13 KiB 4 [emitted] x4 - 5.bundle.js 789 bytes 5 [emitted] x5 - 6.bundle.js 1020 bytes 6 [emitted] xx5 - bundle.js 7.26 KiB 7 [emitted] main + Asset Size Chunks Chunk Names + 0.bundle.js 239 bytes 0 [emitted] + 1.bundle.js 130 bytes 1 [emitted] + 2.bundle.js 441 bytes 2 [emitted] x1 + 3.bundle.js 661 bytes 3 [emitted] x2 + 4.bundle.js 881 bytes 4 [emitted] x3 + 5.bundle.js 1.08 KiB 5 [emitted] x4 + 6.bundle.js 815 bytes 6 [emitted] x5 + 7.bundle.js 939 bytes 7 [emitted] xx5 + bundle.js 7.29 KiB 8 [emitted] main Entrypoint main = bundle.js - chunk {0} 0.bundle.js 0 bytes {7} [rendered] + chunk {0} 0.bundle.js 0 bytes {8} [rendered] > async commons x1 [11] ./index.js 1:0-42 > async commons x2 [11] ./index.js 2:0-42 > async commons x3 [11] ./index.js 3:0-42 @@ -187,27 +189,27 @@ Child deep-async: [0] ./a.js 0 bytes {0} [built] [1] ./b.js 0 bytes {0} [built] [2] ./c.js 0 bytes {0} [built] - chunk {1} 1.bundle.js (x1) 14 bytes {7} [rendered] + chunk {1} 1.bundle.js 0 bytes {6} {8} [rendered] + [3] ./d.js 0 bytes {1} [built] + chunk {2} 2.bundle.js (x1) 14 bytes {8} [rendered] > x1 [11] ./index.js 1:0-42 - [6] ./x1.js 14 bytes {1} [built] - chunk {2} 2.bundle.js (x2) 28 bytes {7} [rendered] + [6] ./x1.js 14 bytes {2} [built] + chunk {3} 3.bundle.js (x2) 28 bytes {8} [rendered] > x2 [11] ./index.js 2:0-42 - [7] ./x2.js 28 bytes {2} [built] - chunk {3} 3.bundle.js (x3) 42 bytes {7} [rendered] + [7] ./x2.js 28 bytes {3} [built] + chunk {4} 4.bundle.js (x3) 42 bytes {8} [rendered] > x3 [11] ./index.js 3:0-42 - [8] ./x3.js 42 bytes {3} [built] - chunk {4} 4.bundle.js (x4) 56 bytes {7} [rendered] + [8] ./x3.js 42 bytes {4} [built] + chunk {5} 5.bundle.js (x4) 56 bytes {8} [rendered] > x4 [11] ./index.js 4:0-42 - [3] ./d.js 0 bytes {4} {6} [built] - [9] ./x4.js 56 bytes {4} [built] - chunk {5} 5.bundle.js (x5) 74 bytes {7} [rendered] + [9] ./x4.js 56 bytes {5} [built] + chunk {6} 6.bundle.js (x5) 74 bytes {8} [rendered] > x5 [11] ./index.js 5:0-42 - [10] ./x5.js 74 bytes {5} [built] - chunk {6} 6.bundle.js (xx5) 42 bytes {5} [rendered] + [10] ./x5.js 74 bytes {6} [built] + chunk {7} 7.bundle.js (xx5) 42 bytes {6} [rendered] > xx5 [10] ./x5.js 3:0-44 - [3] ./d.js 0 bytes {4} {6} [built] - [4] ./xx5.js 42 bytes {6} [built] - [5] ./e.js 0 bytes {6} [built] - chunk {7} bundle.js (main) 220 bytes [entry] [rendered] + [4] ./xx5.js 42 bytes {7} [built] + [5] ./e.js 0 bytes {7} [built] + chunk {8} bundle.js (main) 220 bytes [entry] [rendered] > main [11] ./index.js - [11] ./index.js 220 bytes {7} [built] \ No newline at end of file + [11] ./index.js 220 bytes {8} [built] \ No newline at end of file diff --git a/test/statsCases/module-deduplication/expected.txt b/test/statsCases/module-deduplication/expected.txt index 056106208..3c5b00a95 100644 --- a/test/statsCases/module-deduplication/expected.txt +++ b/test/statsCases/module-deduplication/expected.txt @@ -1,46 +1,49 @@ 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 8.12 KiB 6 [emitted] e1 -e2.js 8.14 KiB 7 [emitted] e2 -e3.js 8.16 KiB 8 [emitted] e3 + 6.js 71 bytes 6 [emitted] + 0.js 661 bytes 0 [emitted] + 2.js 661 bytes 2 [emitted] + 3.js 139 bytes 3 [emitted] + 4.js 139 bytes 4 [emitted] + 5.js 139 bytes 5 [emitted] + 1.js 661 bytes 1 [emitted] + 7.js 71 bytes 7 [emitted] + 8.js 71 bytes 8 [emitted] +e1.js 8.25 KiB 9, 3 [emitted] e1 +e2.js 8.27 KiB 10, 4 [emitted] e2 +e3.js 8.29 KiB 11, 5 [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 [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 [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 [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] \ No newline at end of file +chunk {0} 0.js 28 bytes {9} {10} {11} [rendered] + [5] ./async1.js 28 bytes {0} [built] +chunk {1} 1.js 28 bytes {9} {10} {11} [rendered] + [6] ./async2.js 28 bytes {1} [built] +chunk {2} 2.js 28 bytes {9} {10} {11} [rendered] + [7] ./async3.js 28 bytes {2} [built] +chunk {3} 3.js 9 bytes {10} {11} [rendered] + [2] ./d.js 9 bytes {3} {9} [built] +chunk {4} 4.js 9 bytes {9} {11} [rendered] + [3] ./f.js 9 bytes {4} {10} [built] +chunk {5} 5.js 9 bytes {9} {10} [rendered] + [4] ./h.js 9 bytes {5} {11} [built] +chunk {6} 6.js 0 bytes {11} [rendered] +chunk {7} 7.js 0 bytes {10} [rendered] +chunk {8} 8.js 0 bytes {9} [rendered] +chunk {9} e1.js (e1) 152 bytes [entry] [rendered] + [0] ./b.js 9 bytes {9} {10} {11} [built] + [1] ./a.js 9 bytes {9} {10} {11} [built] + [2] ./d.js 9 bytes {3} {9} [built] + [8] ./e1.js 116 bytes {9} [built] + [9] ./c.js 9 bytes {9} [built] +chunk {10} e2.js (e2) 152 bytes [entry] [rendered] + [0] ./b.js 9 bytes {9} {10} {11} [built] + [1] ./a.js 9 bytes {9} {10} {11} [built] + [3] ./f.js 9 bytes {4} {10} [built] + [10] ./e2.js 116 bytes {10} [built] + [11] ./e.js 9 bytes {10} [built] +chunk {11} e3.js (e3) 152 bytes [entry] [rendered] + [0] ./b.js 9 bytes {9} {10} {11} [built] + [1] ./a.js 9 bytes {9} {10} {11} [built] + [4] ./h.js 9 bytes {5} {11} [built] + [12] ./e3.js 116 bytes {11} [built] + [13] ./g.js 9 bytes {11} [built] \ No newline at end of file diff --git a/test/statsCases/optimize-chunks/expected.txt b/test/statsCases/optimize-chunks/expected.txt index e69f200eb..dd9d9b3d7 100644 --- a/test/statsCases/optimize-chunks/expected.txt +++ b/test/statsCases/optimize-chunks/expected.txt @@ -1,44 +1,47 @@ -Hash: 0d28f4251780c8a9ae23 +Hash: 6cd3e12cc9c4093a544d Time: Xms Asset Size Chunks Chunk Names - 0.js 299 bytes 0 [emitted] cir1 - 1.js 183 bytes 1 [emitted] ab - 2.js 277 bytes 2, 1 [emitted] abd - 3.js 311 bytes 3 [emitted] cir2 - 4.js 190 bytes 4, 6 [emitted] chunk - 5.js 371 bytes 5, 3 [emitted] cir2 from cir1 - 6.js 130 bytes 6 [emitted] ac in ab -main.js 7.69 KiB 7 [emitted] main + 6.js 71 bytes 6 [emitted] cir2 + 0.js 130 bytes 0 [emitted] + 2.js 183 bytes 2 [emitted] + 3.js 311 bytes 3 [emitted] + 4.js 71 bytes 4 [emitted] ab + 5.js 71 bytes 5 [emitted] abd + 1.js 339 bytes 1 [emitted] cir1 + 7.js 130 bytes 7 [emitted] + 8.js 71 bytes 8 [emitted] chunk + 9.js 130 bytes 9 [emitted] cir2 from cir1 + 10.js 72 bytes 10 [emitted] ac in ab +main.js 8 KiB 11 [emitted] main Entrypoint main = main.js -chunk {0} 0.js (cir1) 81 bytes {3} {7} [rendered] +chunk {0} 0.js 0 bytes {11} {0+2+5} {7+10} [rendered] + [6] ./modules/d.js 0 bytes {0} [built] +chunk {1} 1.js (cir1) 81 bytes {11} {3+6} [rendered] > duplicate cir1 from cir2 [3] ./circular2.js 1:0-79 > duplicate cir1 [8] ./index.js 13:0-54 - [2] ./circular1.js 81 bytes {0} [built] -chunk {1} 1.js (ab) 0 bytes {7} [rendered] + [2] ./circular1.js 81 bytes {1} [built] +chunk {2} 2.js 0 bytes {11} [rendered] + [0] ./modules/a.js 0 bytes {2} [built] + [1] ./modules/b.js 0 bytes {2} [built] +chunk {3} 3.js 81 bytes {1} {11} [rendered] + [3] ./circular2.js 81 bytes {3} [built] +chunk {4} 4.js (ab) 0 bytes {11} [rendered] > ab [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} 2.js (abd) 0 bytes {7} [rendered] +chunk {5} 5.js (abd) 0 bytes {11} [rendered] > abd [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} {4} [built] -chunk {3} 3.js (cir2) 81 bytes {7} [rendered] +chunk {6} 6.js (cir2) 0 bytes {11} [rendered] > cir2 [8] ./index.js 14:0-54 - [3] ./circular2.js 81 bytes {3} {5} [built] -chunk {4} 4.js (chunk) 0 bytes {2} {6} [rendered] +chunk {7} 7.js 0 bytes {0+2+5} {2+4} {7+10} [rendered] + [5] ./modules/c.js 0 bytes {7} [built] +chunk {8} 8.js (chunk) 0 bytes {0+2+5} {7+10} [rendered] > chunk [8] ./index.js 3:2-4:13 > chunk [8] ./index.js 9:1-10:12 - [5] ./modules/c.js 0 bytes {4} {6} [built] - [6] ./modules/d.js 0 bytes {2} {4} [built] -chunk {5} 5.js (cir2 from cir1) 81 bytes {0} [rendered] +chunk {9} 9.js (cir2 from cir1) 0 bytes {1} [rendered] > cir2 from cir1 [2] ./circular1.js 1:0-79 - [3] ./circular2.js 81 bytes {3} {5} [built] - [7] ./modules/e.js 0 bytes {5} [built] -chunk {6} 6.js (ac in ab) 0 bytes {1} [rendered] + [7] ./modules/e.js 0 bytes {9} [built] +chunk {10} 10.js (ac in ab) 0 bytes {2+4} [rendered] > ac in ab [8] ./index.js 2:1-5:15 - [5] ./modules/c.js 0 bytes {4} {6} [built] -chunk {7} main.js (main) 523 bytes [entry] [rendered] +chunk {11} main.js (main) 523 bytes [entry] [rendered] > main [8] ./index.js - [4] ./modules/f.js 0 bytes {7} [built] - [8] ./index.js 523 bytes {7} [built] \ No newline at end of file + [4] ./modules/f.js 0 bytes {11} [built] + [8] ./index.js 523 bytes {11} [built] \ No newline at end of file diff --git a/test/statsCases/scope-hoisting-multi/expected.txt b/test/statsCases/scope-hoisting-multi/expected.txt index be63b0cbd..face33fca 100644 --- a/test/statsCases/scope-hoisting-multi/expected.txt +++ b/test/statsCases/scope-hoisting-multi/expected.txt @@ -1,45 +1,45 @@ -Hash: 618d094d926d88426c4d89db4754cf89b4c9fcd6 +Hash: 3e3ce04ce63dac7e3227f1d9d1f9ebf2dabacdcc Child - Hash: 618d094d926d88426c4d + Hash: 3e3ce04ce63dac7e3227 Time: Xms Entrypoint vendor = vendor.js 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 {3} {4} [built] - [2] ./common_lazy.js 25 bytes {1} {2} [built] - [3] ./vendor.js 25 bytes {5} [built] - [4] ./common.js 37 bytes {3} {4} [built] - [5] ./lazy_shared.js 31 bytes {0} [built] - [6] ./lazy_first.js 55 bytes {2} [built] - [7] ./lazy_second.js 55 bytes {1} [built] - [8] ./first.js 207 bytes {3} [built] - [9] ./module_first.js 31 bytes {3} [built] - [10] ./second.js 177 bytes {4} [built] + [0] ./common2.js 25 bytes {5} {6} [built] + [1] ./common_lazy_shared.js 25 bytes {0} [built] + [2] ./vendor.js 25 bytes {7} [built] + [3] ./common.js 37 bytes {5} {6} [built] + [4] ./common_lazy.js 25 bytes {2} [built] + [5] ./lazy_shared.js 31 bytes {1} [built] + [6] ./lazy_first.js 55 bytes {4} [built] + [7] ./lazy_second.js 55 bytes {3} [built] + [8] ./first.js 207 bytes {5} [built] + [9] ./module_first.js 31 bytes {5} [built] + [10] ./second.js 177 bytes {6} [built] Child - Hash: 89db4754cf89b4c9fcd6 + Hash: f1d9d1f9ebf2dabacdcc Time: Xms Entrypoint vendor = vendor.js 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] ./vendor.js 25 bytes {5} [built] + [0] ./common_lazy_shared.js 25 bytes {0} [built] + [1] ./vendor.js 25 bytes {7} [built] ModuleConcatenation bailout: Module is an entry point - [3] ./common.js + 1 modules 62 bytes {3} {4} [built] + [2] ./common.js + 1 modules 62 bytes {5} {6} [built] | ./common.js 37 bytes [built] | ./common2.js 25 bytes [built] - [4] ./lazy_shared.js 31 bytes {0} [built] + [3] ./common_lazy.js 25 bytes {2} [built] + [4] ./lazy_shared.js 31 bytes {1} [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 {3} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) - [6] ./second.js 177 bytes {4} [built] + [6] ./second.js 177 bytes {6} [built] ModuleConcatenation bailout: Module is an entry point - [7] ./first.js + 1 modules 248 bytes {3} [built] + [7] ./first.js + 1 modules 248 bytes {5} [built] ModuleConcatenation bailout: Cannot concat with ./common.js ModuleConcatenation bailout: Cannot concat with ./vendor.js (<- Module is an entry point) | ./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 {4} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()) \ No newline at end of file