From dca8e62b60bc5f946025c44070a154450e30cc92 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 17 Jan 2017 22:26:38 +0100 Subject: [PATCH 1/9] don't shorten node_modules to ~ it's confusing --- lib/RequestShortener.js | 2 -- test/Compiler.test.js | 2 +- test/statsCases/separate-css-bundle/expected.txt | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/RequestShortener.js b/lib/RequestShortener.js index 0904c902423..a9aabc0712e 100644 --- a/lib/RequestShortener.js +++ b/lib/RequestShortener.js @@ -34,7 +34,6 @@ class RequestShortener { this.buildinsRegExp = buildinsRegExp; } - this.nodeModulesRegExp = /\/node_modules\//g; this.indexJsRegExp = /\/index.js(!|\?|\(query\))/g; } @@ -49,7 +48,6 @@ class RequestShortener { request = request.replace(this.parentDirectoryRegExp, "!.."); if(!this.buildinsAsModule && this.buildinsRegExp) request = request.replace(this.buildinsRegExp, "!(webpack)"); - request = request.replace(this.nodeModulesRegExp, "/~/"); request = request.replace(this.indexJsRegExp, "$1"); return request.replace(/^!|!$/, ""); } diff --git a/test/Compiler.test.js b/test/Compiler.test.js index 5589f077c41..ab48fce992c 100644 --- a/test/Compiler.test.js +++ b/test/Compiler.test.js @@ -99,7 +99,7 @@ describe("Compiler", function() { bundle.should.containEql("./main1.js"); bundle.should.containEql("./a.js"); bundle.should.containEql("./b.js"); - bundle.should.containEql("./~/m1/a.js"); + bundle.should.containEql("./node_modules/m1/a.js"); bundle.should.containEql("This is a"); bundle.should.containEql("This is b"); bundle.should.containEql("This is m1/a"); diff --git a/test/statsCases/separate-css-bundle/expected.txt b/test/statsCases/separate-css-bundle/expected.txt index c7d5d01b2ca..7cb0dc3e1fd 100644 --- a/test/statsCases/separate-css-bundle/expected.txt +++ b/test/statsCases/separate-css-bundle/expected.txt @@ -10,8 +10,8 @@ Child [1] (webpack)/test/statsCases/separate-css-bundle/a/index.js 23 bytes {0} [built] Child extract-text-webpack-plugin: chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered] - [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 192 bytes {0} [built] - [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] + [0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 192 bytes {0} [built] + [1] (webpack)/node_modules/css-loader/lib/css-base.js 1.46 kB {0} [built] Child Hash: f4d2d844a00ebd8ee85a Time: Xms @@ -23,5 +23,5 @@ Child [1] (webpack)/test/statsCases/separate-css-bundle/b/index.js 23 bytes {0} [built] Child extract-text-webpack-plugin: chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered] - [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 194 bytes {0} [built] - [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] \ No newline at end of file + [0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 194 bytes {0} [built] + [1] (webpack)/node_modules/css-loader/lib/css-base.js 1.46 kB {0} [built] \ No newline at end of file From e8bc9c2b3b121d97d9040d76856a4f33f75d56a3 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 18 Apr 2017 22:30:18 +0200 Subject: [PATCH 2/9] use a Set for Module.chunks --- lib/Compilation.js | 2 +- lib/Module.js | 90 +++++++++++++++++++---- lib/ModuleFilenameHelpers.js | 2 +- lib/Stats.js | 2 +- lib/optimize/OccurrenceOrderPlugin.js | 21 +++--- lib/optimize/RemoveParentModulesPlugin.js | 31 +------- 6 files changed, 95 insertions(+), 53 deletions(-) diff --git a/lib/Compilation.js b/lib/Compilation.js index 541f115925c..4927a1e3768 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -507,7 +507,7 @@ class Compilation extends Tapable { if(err) return callback(err); deps.forEach(d => { if(d.module && d.module.removeReason(module, d)) { - module.chunks.forEach(chunk => { + module.forEachChunk(chunk => { if(!d.module.hasReasonForChunk(chunk)) { if(d.module.removeChunk(chunk)) { this.removeChunkFromDependencies(d.module, chunk); diff --git a/lib/Module.js b/lib/Module.js index 788e3277b43..2ffe2c4f4e9 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -4,6 +4,7 @@ */ "use strict"; +const util = require("util"); const DependenciesBlock = require("./DependenciesBlock"); const ModuleReason = require("./ModuleReason"); const Template = require("./Template"); @@ -36,7 +37,9 @@ class Module extends DependenciesBlock { this.used = null; this.usedExports = null; this.providedExports = null; - this.chunks = []; + this._chunks = new Set(); + this._chunksIsSorted = true; + this._chunksDebugIdent = undefined; this.warnings = []; this.dependenciesWarnings = []; this.errors = []; @@ -55,7 +58,9 @@ class Module extends DependenciesBlock { this.used = null; this.usedExports = null; this.providedExports = null; - this.chunks.length = 0; + this._chunks.clear(); + this._chunksDebugIdent = undefined; + this._chunksIsSorted = false; super.disconnect(); } @@ -65,26 +70,74 @@ class Module extends DependenciesBlock { this.index = null; this.index2 = null; this.depth = null; - this.chunks.length = 0; + this._chunks.clear(); + this._chunksDebugIdent = undefined; + this._chunksIsSorted = false; super.unseal(); } addChunk(chunk) { - let idx = this.chunks.indexOf(chunk); - if(idx < 0) - this.chunks.push(chunk); + this._chunks.add(chunk); + this._chunksDebugIdent = undefined; + this._chunksIsSorted = false; } removeChunk(chunk) { - let idx = this.chunks.indexOf(chunk); - if(idx >= 0) { - this.chunks.splice(idx, 1); + if(this._chunks.delete(chunk)) { + this._chunksDebugIdent = undefined; chunk.removeModule(this); return true; } return false; } + isInChunk(chunk) { + return this._chunks.has(chunk); + } + + getChunkIdsIdent() { + if(this._chunksDebugIdent !== undefined) return this._chunksDebugIdent; + this._ensureChunksSorted(); + const chunks = this._chunks; + const list = []; + for(let chunk of chunks) { + const debugId = chunk.debugId; + + if(typeof debugId !== "number") { + return this._chunksDebugIdent = null; + } + + list.push(debugId); + } + + return this._chunksDebugIdent = list.join(","); + } + + forEachChunk(fn) { + this._chunks.forEach(fn); + } + + mapChunks(fn) { + const chunks = this._chunks; + const size = chunks.size; + const array = new Array(size); + let idx = 0; + for(let chunk of chunks) { + array[idx++] = fn(chunk, idx, chunks); + } + return array; + } + + getNumberOfChunks() { + return this._chunks.size; + } + + _ensureChunksSorted() { + if(this._chunksIsSorted) return; + this._chunks = new Set(Array.from(this._chunks).sort(byId)); + this._chunksIsSorted = true; + } + addReason(module, dependency) { this.reasons.push(new ModuleReason(module, dependency)); } @@ -105,7 +158,7 @@ class Module extends DependenciesBlock { if(r.chunks) { if(r.chunks.indexOf(chunk) >= 0) return true; - } else if(r.module.chunks.indexOf(chunk) >= 0) + } else if(r.module._chunks.has(chunk)) return true; } return false; @@ -114,9 +167,9 @@ class Module extends DependenciesBlock { rewriteChunkInReasons(oldChunk, newChunks) { this.reasons.forEach(r => { if(!r.chunks) { - if(r.module.chunks.indexOf(oldChunk) < 0) + if(!r.module._chunks.has(oldChunk)) return; - r.chunks = r.module.chunks; + r.chunks = Array.from(r.module._chunks); } r.chunks = r.chunks.reduce((arr, c) => { addToSet(arr, c !== oldChunk ? [c] : newChunks); @@ -160,7 +213,7 @@ class Module extends DependenciesBlock { sortItems() { super.sortItems(); - this.chunks.sort(byId); + this._ensureChunksSorted(); this.reasons.sort((a, b) => byId(a.module, b.module)); } @@ -178,6 +231,17 @@ Object.defineProperty(Module.prototype, "entry", { throw new Error("Module.entry was removed. Use Chunk.entryModule"); } }); + +Object.defineProperty(Module.prototype, "chunks", { + configurable: false, + get: util.deprecate(() => { + return Array.from(this._chunks); + }, "Module.chunks: Use Module.forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk instead"), + set() { + throw new Error("Readonly. Use Module.addChunk/removeChunk to modify chunks."); + } +}); + Module.prototype.identifier = null; Module.prototype.readableIdentifier = null; Module.prototype.build = null; diff --git a/lib/ModuleFilenameHelpers.js b/lib/ModuleFilenameHelpers.js index 9fe569847ea..59010dee55c 100644 --- a/lib/ModuleFilenameHelpers.js +++ b/lib/ModuleFilenameHelpers.js @@ -112,7 +112,7 @@ ModuleFilenameHelpers.createFooter = function createFooter(module, requestShorte "// WEBPACK FOOTER", `// ${module.readableIdentifier(requestShortener)}`, `// module id = ${module.id}`, - `// module chunks = ${module.chunks.map(c => c.id).join(" ")}` + `// module chunks = ${module.mapChunks(c => c.id).join(" ")}` ].join("\n"); } }; diff --git a/lib/Stats.js b/lib/Stats.js index 8bf3a0e9c88..4ad1df273ce 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -279,7 +279,7 @@ class Stats { built: !!module.built, optional: !!module.optional, prefetched: !!module.prefetched, - chunks: module.chunks.map(chunk => chunk.id), + chunks: module.mapChunks(chunk => chunk.id), assets: Object.keys(module.assets || {}), issuer: module.issuer && module.issuer.identifier(), issuerId: module.issuer && module.issuer.id, diff --git a/lib/optimize/OccurrenceOrderPlugin.js b/lib/optimize/OccurrenceOrderPlugin.js index dc86b11e3a4..f545e27b892 100644 --- a/lib/optimize/OccurrenceOrderPlugin.js +++ b/lib/optimize/OccurrenceOrderPlugin.js @@ -16,12 +16,12 @@ class OccurrenceOrderPlugin { compiler.plugin("compilation", (compilation) => { compilation.plugin("optimize-module-order", (modules) => { function entryChunks(m) { - return m.chunks.map((c) => { + let total = 0; + m.forEachChunk(c => { const sum = (c.isInitial() ? 1 : 0) + (c.entryModule === m ? 1 : 0); - return sum; - }).reduce((a, b) => { - return a + b; - }, 0); + total += sum; + }); + return total; } function occursInEntry(m) { @@ -37,14 +37,17 @@ class OccurrenceOrderPlugin { function occurs(m) { if(typeof m.__OccurenceOrderPlugin_occurs === "number") return m.__OccurenceOrderPlugin_occurs; + let numberEntry = 0; + m.forEachChunk(c => { + if(c.entryModule === m) + numberEntry++; + }); const result = m.reasons.map((r) => { if(!r.module) return 0; - return r.module.chunks.length; + return r.module.getNumberOfChunks(); }).reduce((a, b) => { return a + b; - }, 0) + m.chunks.length + m.chunks.filter((c) => { - return c.entryModule === m; - }).length; + }, 0) + m.getNumberOfChunks() + numberEntry; return m.__OccurenceOrderPlugin_occurs = result; } modules.sort((a, b) => { diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index af4b42dfb4d..8467b859064 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -4,18 +4,8 @@ */ "use strict"; -function chunkContainsModule(chunk, module) { - const chunks = module.chunks; - const modules = chunk.modules; - if(chunks.length < modules.length) { - return chunks.indexOf(chunk) >= 0; - } else { - return modules.indexOf(module) >= 0; - } -} - function hasModule(chunk, module, checkedChunks) { - if(chunkContainsModule(chunk, module)) return [chunk]; + if(module.isInChunk(chunk)) return [chunk]; if(chunk.parents.length === 0) return false; return allHaveModule(chunk.parents.filter((c) => { return checkedChunks.indexOf(c) < 0; @@ -41,21 +31,6 @@ function allHaveModule(someChunks, module, checkedChunks) { return chunks; } -function debugIds(chunks) { - var list = []; - for(var i = 0; i < chunks.length; i++) { - var debugId = chunks[i].debugId; - - if(typeof debugId !== "number") { - return "no"; - } - - list.push(debugId); - } - - list.sort(); - return list.join(","); -} class RemoveParentModulesPlugin { apply(compiler) { @@ -71,9 +46,9 @@ class RemoveParentModulesPlugin { for(var i = 0; i < modules.length; i++) { var module = modules[i]; - var dId = debugIds(module.chunks); + var dId = module.getChunkIdsIdent(); var parentChunksWithModule; - if((dId in cache) && dId !== "no") { + if(dId !== null && (dId in cache)) { parentChunksWithModule = cache[dId]; } else { parentChunksWithModule = cache[dId] = allHaveModule(chunk.parents, module); From 7ca1297e11c95fff2f543d8e76621194f04b13fc Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 18 Apr 2017 23:28:16 +0200 Subject: [PATCH 3/9] Use a Set in RemoveParentModulesPlugin for performance --- lib/optimize/RemoveParentModulesPlugin.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index 8467b859064..28fe5a78e3f 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -8,24 +8,22 @@ function hasModule(chunk, module, checkedChunks) { if(module.isInChunk(chunk)) return [chunk]; if(chunk.parents.length === 0) return false; return allHaveModule(chunk.parents.filter((c) => { - return checkedChunks.indexOf(c) < 0; + return !checkedChunks.has(c); }), module, checkedChunks); } function allHaveModule(someChunks, module, checkedChunks) { - if(!checkedChunks) checkedChunks = []; - var chunks = []; + if(!checkedChunks) checkedChunks = new Set(); + var chunks = new Set(); for(var i = 0; i < someChunks.length; i++) { - checkedChunks.push(someChunks[i]); + checkedChunks.add(someChunks[i]); var subChunks = hasModule(someChunks[i], module, checkedChunks); if(!subChunks) return false; for(var index = 0; index < subChunks.length; index++) { var item = subChunks[index]; - if(!chunks.length || chunks.indexOf(item) < 0) { - chunks.push(item); - } + chunks.add(item); } } return chunks; @@ -48,13 +46,15 @@ class RemoveParentModulesPlugin { var dId = module.getChunkIdsIdent(); var parentChunksWithModule; - if(dId !== null && (dId in cache)) { + if(dId === null) { + parentChunksWithModule = allHaveModule(chunk.parents, module); + } else if(dId in cache) { parentChunksWithModule = cache[dId]; } else { parentChunksWithModule = cache[dId] = allHaveModule(chunk.parents, module); } if(parentChunksWithModule) { - module.rewriteChunkInReasons(chunk, parentChunksWithModule); + module.rewriteChunkInReasons(chunk, Array.from(parentChunksWithModule)); chunk.removeModule(module); } } From aac0389ba840e8f45f55853d49782605ce7f3a1c Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 19 Apr 2017 07:57:21 +0200 Subject: [PATCH 4/9] Sort by debug id and id --- lib/Compilation.js | 4 ++-- lib/Module.js | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/Compilation.js b/lib/Compilation.js index 4927a1e3768..18bdf4402c6 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -1013,7 +1013,7 @@ class Compilation extends Tapable { const modules = this.modules; for(let indexModule = 0; indexModule < modules.length; indexModule++) { - modules[indexModule].sortItems(); + modules[indexModule].sortItems(false); } const chunks = this.chunks; @@ -1027,7 +1027,7 @@ class Compilation extends Tapable { const modules = this.modules; for(let indexModule = 0; indexModule < modules.length; indexModule++) { - modules[indexModule].sortItems(); + modules[indexModule].sortItems(true); } const chunks = this.chunks; diff --git a/lib/Module.js b/lib/Module.js index 2ffe2c4f4e9..dfb350524dd 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -20,6 +20,10 @@ function byId(a, b) { return a.id - b.id; } +function byDebugId(a, b) { + return a.debugId - b.debugId; +} + let debugId = 1000; class Module extends DependenciesBlock { @@ -39,6 +43,7 @@ class Module extends DependenciesBlock { this.providedExports = null; this._chunks = new Set(); this._chunksIsSorted = true; + this._chunksIsSortedByDebugId = true; this._chunksDebugIdent = undefined; this.warnings = []; this.dependenciesWarnings = []; @@ -60,7 +65,7 @@ class Module extends DependenciesBlock { this.providedExports = null; this._chunks.clear(); this._chunksDebugIdent = undefined; - this._chunksIsSorted = false; + this._chunksIsSorted = this._chunksIsSortedByDebugId = false; super.disconnect(); } @@ -72,14 +77,14 @@ class Module extends DependenciesBlock { this.depth = null; this._chunks.clear(); this._chunksDebugIdent = undefined; - this._chunksIsSorted = false; + this._chunksIsSorted = this._chunksIsSortedByDebugId = false; super.unseal(); } addChunk(chunk) { this._chunks.add(chunk); this._chunksDebugIdent = undefined; - this._chunksIsSorted = false; + this._chunksIsSorted = this._chunksIsSortedByDebugId = false; } removeChunk(chunk) { @@ -97,7 +102,7 @@ class Module extends DependenciesBlock { getChunkIdsIdent() { if(this._chunksDebugIdent !== undefined) return this._chunksDebugIdent; - this._ensureChunksSorted(); + this._ensureChunksSortedByDebugId(); const chunks = this._chunks; const list = []; for(let chunk of chunks) { @@ -135,9 +140,17 @@ class Module extends DependenciesBlock { _ensureChunksSorted() { if(this._chunksIsSorted) return; this._chunks = new Set(Array.from(this._chunks).sort(byId)); + this._chunksIsSortedByDebugId = false; this._chunksIsSorted = true; } + _ensureChunksSortedByDebugId() { + if(this._chunksIsSortedByDebugId) return; + this._chunks = new Set(Array.from(this._chunks).sort(byDebugId)); + this._chunksIsSorted = false; + this._chunksIsSortedByDebugId = true; + } + addReason(module, dependency) { this.reasons.push(new ModuleReason(module, dependency)); } @@ -211,9 +224,10 @@ class Module extends DependenciesBlock { super.updateHash(hash); } - sortItems() { + sortItems(sortChunks) { super.sortItems(); - this._ensureChunksSorted(); + if(sortChunks) + this._ensureChunksSorted(); this.reasons.sort((a, b) => byId(a.module, b.module)); } From f6f22ef0a733931e217050ad9c3b95265978a556 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 21 Apr 2017 10:05:56 +0200 Subject: [PATCH 5/9] Use a Set to store modules in a chunk --- lib/AsyncDependenciesBlock.js | 12 +- lib/Chunk.js | 111 +++++++++++++++--- lib/FlagInitialModulesAsUsedPlugin.js | 2 +- lib/HotModuleReplacementPlugin.js | 6 +- lib/HotUpdateChunkTemplate.js | 11 +- lib/LibManifestPlugin.js | 15 ++- lib/Stats.js | 8 +- lib/Template.js | 6 +- lib/UmdMainTemplatePlugin.js | 2 +- lib/optimize/AggressiveSplittingPlugin.js | 40 +++---- lib/optimize/CommonsChunkPlugin.js | 2 +- lib/optimize/EnsureChunkConditionsPlugin.js | 2 +- lib/optimize/FlagIncludedChunksPlugin.js | 8 +- lib/optimize/MergeDuplicateChunksPlugin.js | 2 +- lib/optimize/OccurrenceOrderPlugin.js | 15 +-- lib/optimize/RemoveParentModulesPlugin.js | 14 +-- test/Chunk.test.js | 2 +- .../expected.txt | 8 +- .../webpack.config.js | 6 +- 19 files changed, 156 insertions(+), 116 deletions(-) diff --git a/lib/AsyncDependenciesBlock.js b/lib/AsyncDependenciesBlock.js index d21218895ab..e8ff2daae52 100644 --- a/lib/AsyncDependenciesBlock.js +++ b/lib/AsyncDependenciesBlock.js @@ -37,17 +37,7 @@ module.exports = class AsyncDependenciesBlock extends DependenciesBlock { sortItems() { super.sortItems(); if(this.chunks) { - this.chunks.sort((a, b) => { - let i = 0; - while(true) { // eslint-disable-line no-constant-condition - if(!a.modules[i] && !b.modules[i]) return 0; - if(!a.modules[i]) return -1; - if(!b.modules[i]) return 1; - if(a.modules[i].id > b.modules[i].id) return 1; - if(a.modules[i].id < b.modules[i].id) return -1; - i++; - } - }); + this.chunks.sort((a, b) => a.compareTo(b)); } } }; diff --git a/lib/Chunk.js b/lib/Chunk.js index 5bfb2910e53..93feb411628 100644 --- a/lib/Chunk.js +++ b/lib/Chunk.js @@ -4,6 +4,7 @@ */ "use strict"; +const util = require("util"); const compareLocations = require("./compareLocations"); let debugId = 1000; @@ -20,7 +21,8 @@ class Chunk { this.ids = null; this.debugId = debugId++; this.name = name; - this.modules = []; + this._modules = new Set(); + this._modulesIsSorted = true; this.entrypoints = []; this.chunks = []; this.parents = []; @@ -88,7 +90,12 @@ class Chunk { } addModule(module) { - return this.addToCollection(this.modules, module); + if(!this._modules.has(module)) { + this._modules.add(module); + this._modulesIsSorted = false; + return true; + } + return false; } addBlock(block) { @@ -96,9 +103,7 @@ class Chunk { } removeModule(module) { - const idx = this.modules.indexOf(module); - if(idx >= 0) { - this.modules.splice(idx, 1); + if(this._modules.delete(module)) { module.removeChunk(this); return true; } @@ -133,9 +138,72 @@ class Chunk { }); } + setModules(modules) { + this._modules = new Set(modules); + this._modulesIsSorted = false; + } + + getNumberOfModules() { + return this._modules.size; + } + + get modulesIterable() { + return this._modules; + } + + forEachModule(fn) { + this._modules.forEach(fn); + } + + mapModules(fn) { + const modules = this._modules; + const array = new Array(modules.size); + let idx = 0; + for(let module of modules) { + array[idx++] = fn(module, idx, modules); + } + return array; + } + + _ensureModulesSorted() { + if(this._modulesIsSorted) return; + this._modules = new Set(Array.from(this._modules).sort((a, b) => { + if(a.identifier() > b.identifier()) return 1; + if(a.identifier() < b.identifier()) return -1; + return 0; + })); + this._modulesIsSorted = true; + } + + compareTo(otherChunk) { + this._ensureModulesSorted(); + otherChunk._ensureModulesSorted(); + if(this._modules.size > otherChunk._modules.size) return -1; + if(this._modules.size < otherChunk._modules.size) return 1; + const a = this._modules[Symbol.iterator](); + const b = otherChunk._modules[Symbol.iterator](); + while(true) { // eslint-disable-line + const aItem = a.next(); + const bItem = b.next(); + if(aItem.done) return 0; + const aModuleIdentifier = aItem.value.identifier(); + const bModuleIdentifier = bItem.value.identifier(); + if(aModuleIdentifier > bModuleIdentifier) return -1; + if(aModuleIdentifier < bModuleIdentifier) return 1; + } + } + + containsModule(module) { + return this._modules.has(module); + } + + getModules() { + return Array.from(this._modules); + } + remove(reason) { // cleanup modules - this.modules.slice().forEach(module => { + Array.from(this._modules).forEach(module => { module.removeChunk(this); }); @@ -219,9 +287,9 @@ class Chunk { return false; } - const otherChunkModules = otherChunk.modules.slice(); + const otherChunkModules = Array.from(otherChunk._modules); otherChunkModules.forEach(module => otherChunk.moveModule(module, this)); - otherChunk.modules.length = 0; + otherChunk._modules.clear(); otherChunk.parents.forEach(parentChunk => parentChunk.replaceChunk(otherChunk, this)); otherChunk.parents.length = 0; @@ -276,14 +344,14 @@ class Chunk { } isEmpty() { - return this.modules.length === 0; + return this._modules.size === 0; } updateHash(hash) { hash.update(`${this.id} `); hash.update(this.ids ? this.ids.join(",") : ""); hash.update(`${this.name || ""} `); - this.modules.forEach(m => m.updateHash(hash)); + this._modules.forEach(m => m.updateHash(hash)); } canBeIntegrated(otherChunk) { @@ -307,8 +375,8 @@ class Chunk { modulesSize() { let count = 0; - for(let i = 0; i < this.modules.length; i++) { - count += this.modules[i].size(); + for(let module of this._modules) { + count += module.size(); } return count; } @@ -325,9 +393,8 @@ class Chunk { let integratedModulesSize = this.modulesSize(); // only count modules that do not exist in this chunk! - for(let i = 0; i < otherChunk.modules.length; i++) { - const otherModule = otherChunk.modules[i]; - if(this.modules.indexOf(otherModule) === -1) { + for(let otherModule of otherChunk._modules) { + if(!this._modules.has(otherModule)) { integratedModulesSize += otherModule.size(); } } @@ -356,7 +423,7 @@ class Chunk { } sortItems() { - this.modules.sort(byId); + this._modules = new Set(Array.from(this._modules).sort(byId)); this.origins.sort((a, b) => { const aIdent = a.module.identifier(); const bIdent = b.module.identifier(); @@ -373,7 +440,7 @@ class Chunk { } toString() { - return `Chunk[${this.modules.join()}]`; + return `Chunk[${Array.from(this._modules).join()}]`; } checkConstraints() { @@ -393,4 +460,14 @@ class Chunk { } } +Object.defineProperty(Chunk.prototype, "modules", { + configurable: false, + get: util.deprecate(function() { + return Array.from(this._modules); + }, "Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead."), + set: util.deprecate(function(value) { + this.setModules(value); + }, "Chunk.modules is deprecated. Use Chunk.addModule/removeModule instead.") +}); + module.exports = Chunk; diff --git a/lib/FlagInitialModulesAsUsedPlugin.js b/lib/FlagInitialModulesAsUsedPlugin.js index 64d084270ea..ae81f8b9b99 100644 --- a/lib/FlagInitialModulesAsUsedPlugin.js +++ b/lib/FlagInitialModulesAsUsedPlugin.js @@ -12,7 +12,7 @@ class FlagInitialModulesAsUsedPlugin { if(!chunk.isInitial()) { return; } - chunk.modules.forEach((module) => { + chunk.forEachModule((module) => { module.usedExports = true; }); }); diff --git a/lib/HotModuleReplacementPlugin.js b/lib/HotModuleReplacementPlugin.js index 48de6fedf61..5cfdcd380be 100644 --- a/lib/HotModuleReplacementPlugin.js +++ b/lib/HotModuleReplacementPlugin.js @@ -54,7 +54,7 @@ HotModuleReplacementPlugin.prototype.apply = function(compiler) { }); records.chunkModuleIds = {}; this.chunks.forEach(function(chunk) { - records.chunkModuleIds[chunk.id] = chunk.modules.map(function(m) { + records.chunkModuleIds[chunk.id] = chunk.mapModules(function(m) { return m.id; }); }); @@ -112,11 +112,11 @@ HotModuleReplacementPlugin.prototype.apply = function(compiler) { chunkId = isNaN(+chunkId) ? chunkId : +chunkId; var currentChunk = this.chunks.find(chunk => chunk.id === chunkId); if(currentChunk) { - var newModules = currentChunk.modules.filter(function(module) { + var newModules = currentChunk.mapModules(m => m).filter(function(module) { return module.hotUpdate; }); var allModules = {}; - currentChunk.modules.forEach(function(module) { + currentChunk.forEachModule(function(module) { allModules[module.id] = true; }); var removedModules = records.chunkModuleIds[chunkId].filter(function(id) { diff --git a/lib/HotUpdateChunkTemplate.js b/lib/HotUpdateChunkTemplate.js index e32e5cccb85..84b366a08df 100644 --- a/lib/HotUpdateChunkTemplate.js +++ b/lib/HotUpdateChunkTemplate.js @@ -5,6 +5,7 @@ "use strict"; const Template = require("./Template"); +const Chunk = require("./Chunk"); module.exports = class HotUpdateChunkTemplate extends Template { constructor(outputOptions) { @@ -12,11 +13,11 @@ module.exports = class HotUpdateChunkTemplate extends Template { } render(id, modules, removedModules, hash, moduleTemplate, dependencyTemplates) { - const modulesSource = this.renderChunkModules({ - id: id, - modules: modules, - removedModules: removedModules - }, moduleTemplate, dependencyTemplates); + const hotUpdateChunk = new Chunk(); + hotUpdateChunk.id = id; + hotUpdateChunk.setModules(modules); + hotUpdateChunk.removedModules = removedModules; + const modulesSource = this.renderChunkModules(hotUpdateChunk, moduleTemplate, dependencyTemplates); const core = this.applyPluginsWaterfall("modules", modulesSource, modules, removedModules, moduleTemplate, dependencyTemplates); const source = this.applyPluginsWaterfall("render", core, modules, removedModules, hash, id, moduleTemplate, dependencyTemplates); return source; diff --git a/lib/LibManifestPlugin.js b/lib/LibManifestPlugin.js index 76a790b6ea1..356c549e75c 100644 --- a/lib/LibManifestPlugin.js +++ b/lib/LibManifestPlugin.js @@ -30,19 +30,24 @@ class LibManifestPlugin { const manifest = { name, type: this.options.type, - content: chunk.modules.reduce((obj, module) => { + content: chunk.mapModules(module => { if(module.libIdent) { const ident = module.libIdent({ context: this.options.context || compiler.options.context }); if(ident) { - obj[ident] = { - id: module.id, - meta: module.meta, - exports: Array.isArray(module.providedExports) ? module.providedExports : undefined + return { + ident, + data: { + id: module.id, + meta: module.meta, + exports: Array.isArray(module.providedExports) ? module.providedExports : undefined + } }; } } + }).filter(Boolean).reduce((obj, item) => { + obj[item.ident] = item.data; return obj; }, {}) }; diff --git a/lib/Stats.js b/lib/Stats.js index 8bf3a0e9c88..17eed718bad 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -327,19 +327,19 @@ class Stats { entry: chunk.hasRuntime(), recorded: chunk.recorded, extraAsync: !!chunk.extraAsync, - size: chunk.modules.reduce((size, module) => size + module.size(), 0), + size: chunk.mapModules(m => m.size()).reduce((size, moduleSize) => size + moduleSize, 0), names: chunk.name ? [chunk.name] : [], files: chunk.files.slice(), hash: chunk.renderedHash, parents: chunk.parents.map(c => c.id) }; if(showChunkModules) { - obj.modules = chunk.modules - .slice() + obj.modules = chunk + .mapModules(m => m) .sort(sortByField("depth")) .filter(createModuleFilter()) .map(fnModule); - obj.filteredModules = chunk.modules.length - obj.modules.length; + obj.filteredModules = chunk.getNumberOfModules() - obj.modules.length; obj.modules.sort(sortByField(sortModules)); } if(showChunkOrigins) { diff --git a/lib/Template.js b/lib/Template.js index 192965a6d88..f7d488da88f 100644 --- a/lib/Template.js +++ b/lib/Template.js @@ -94,12 +94,12 @@ module.exports = class Template extends Tapable { renderChunkModules(chunk, moduleTemplate, dependencyTemplates, prefix) { if(!prefix) prefix = ""; var source = new ConcatSource(); - if(chunk.modules.length === 0) { + if(chunk.getNumberOfModules() === 0) { source.add("[]"); return source; } var removedModules = chunk.removedModules; - var allModules = chunk.modules.map(function(module) { + var allModules = chunk.mapModules(function(module) { return { id: module.id, source: moduleTemplate.render(module, dependencyTemplates, chunk) @@ -113,7 +113,7 @@ module.exports = class Template extends Tapable { }); }); } - var bounds = this.getModulesArrayBounds(chunk.modules); + var bounds = this.getModulesArrayBounds(allModules); if(bounds) { // Render a spare array diff --git a/lib/UmdMainTemplatePlugin.js b/lib/UmdMainTemplatePlugin.js index 54d88bff293..1c6ff1b9a32 100644 --- a/lib/UmdMainTemplatePlugin.js +++ b/lib/UmdMainTemplatePlugin.js @@ -32,7 +32,7 @@ class UmdMainTemplatePlugin { apply(compilation) { const mainTemplate = compilation.mainTemplate; compilation.templatesPlugin("render-with-entry", function(source, chunk, hash) { - let externals = chunk.modules.filter(m => m.external); + let externals = chunk.mapModules(m => m).filter(m => m.external); const optionalExternals = []; let requiredExternals = []; if(this.optionalAmdExternalAsGlobal) { diff --git a/lib/optimize/AggressiveSplittingPlugin.js b/lib/optimize/AggressiveSplittingPlugin.js index 3c5006d6d54..b74c859da27 100644 --- a/lib/optimize/AggressiveSplittingPlugin.js +++ b/lib/optimize/AggressiveSplittingPlugin.js @@ -6,18 +6,6 @@ const identifierUtils = require("../util/identifier"); -function toIndexOf(list) { - return function(item) { - return list.indexOf(item); - }; -} - -function toChunkModuleIndices(modules) { - return function(idx) { - return modules[idx]; - }; -} - function moveModuleBetween(oldChunk, newChunk) { return function(module) { oldChunk.moveModule(module, newChunk); @@ -62,17 +50,19 @@ class AggressiveSplittingPlugin { const splitData = usedSplits[j]; for(let i = 0; i < chunks.length; i++) { const chunk = chunks[i]; - const chunkModuleNames = chunk.modules.map(m => identifierUtils.makePathsRelative(compiler.context, m.identifier())); - if(chunkModuleNames.length < splitData.modules.length) + if(chunk.getNumberOfModules() < splitData.modules.length) continue; - const moduleIndicies = splitData.modules.map(toIndexOf(chunkModuleNames)); - const hasAllModules = moduleIndicies.every((idx) => { - return idx >= 0; + + const nameToModuleMap = new Map(); + chunk.forEachModule(m => { + const name = identifierUtils.makePathsRelative(compiler.context, m.identifier()); + nameToModuleMap.set(name, m); }); - if(hasAllModules) { - if(chunkModuleNames.length > splitData.modules.length) { - const selectedModules = moduleIndicies.map(toChunkModuleIndices(chunk.modules)); + + const selectedModules = splitData.modules.map(name => nameToModuleMap.get(name)); + if(selectedModules.every(Boolean)) { + if(chunk.getNumberOfModules() > splitData.modules.length) { const newChunk = compilation.addChunk(); selectedModules.forEach(moveModuleBetween(chunk, newChunk)); chunk.split(newChunk); @@ -101,9 +91,9 @@ class AggressiveSplittingPlugin { for(let i = 0; i < chunks.length; i++) { const chunk = chunks[i]; const size = chunk.size(this.options); - if(size > maxSize && chunk.modules.length > 1) { + if(size > maxSize && chunk.getNumberOfModules() > 1) { const newChunk = compilation.addChunk(); - const modules = chunk.modules + const modules = chunk.mapModules(m => m) .filter(isNotAEntryModule(chunk.entryModule)) .sort((a, b) => { a = a.identifier(); @@ -131,13 +121,13 @@ class AggressiveSplittingPlugin { break; } } - if(newChunk.modules.length > 0) { + if(newChunk.getNumberOfModules() > 0) { chunk.split(newChunk); chunk.name = null; newChunk.origins = chunk.origins.map(copyWithReason); chunk.origins = chunk.origins.map(copyWithReason); compilation._aggressiveSplittingSplits = (compilation._aggressiveSplittingSplits || []).concat({ - modules: newChunk.modules.map(m => identifierUtils.makePathsRelative(compiler.context, m.identifier())) + modules: newChunk.mapModules(m => identifierUtils.makePathsRelative(compiler.context, m.identifier())) }); return true; } else { @@ -154,7 +144,7 @@ class AggressiveSplittingPlugin { if(chunk.hasEntryModule()) return; const size = chunk.size(this.options); const incorrectSize = size < minSize; - const modules = chunk.modules.map(m => identifierUtils.makePathsRelative(compiler.context, m.identifier())); + const modules = chunk.mapModules(m => identifierUtils.makePathsRelative(compiler.context, m.identifier())); if(typeof chunk._fromAggressiveSplittingIndex === "undefined") { if(incorrectSize) return; chunk.recorded = true; diff --git a/lib/optimize/CommonsChunkPlugin.js b/lib/optimize/CommonsChunkPlugin.js index ff025c67189..a07f3942b19 100644 --- a/lib/optimize/CommonsChunkPlugin.js +++ b/lib/optimize/CommonsChunkPlugin.js @@ -275,7 +275,7 @@ Take a look at the "name"/"names" or async/children option.`); // count how many chunks contain a module const commonModulesToCountMap = usedChunks.reduce((map, chunk) => { - for(let module of chunk.modules) { + for(let module of chunk.modulesIterable) { const count = map.has(module) ? map.get(module) : 0; map.set(module, count + 1); } diff --git a/lib/optimize/EnsureChunkConditionsPlugin.js b/lib/optimize/EnsureChunkConditionsPlugin.js index 590adc6e587..8c2f401d245 100644 --- a/lib/optimize/EnsureChunkConditionsPlugin.js +++ b/lib/optimize/EnsureChunkConditionsPlugin.js @@ -11,7 +11,7 @@ class EnsureChunkConditionsPlugin { compilation.plugin(["optimize-chunks-basic", "optimize-extracted-chunks-basic"], (chunks) => { let changed = false; chunks.forEach((chunk) => { - chunk.modules.slice().forEach((module) => { + chunk.forEachModule((module) => { if(!module.chunkCondition) return; if(!module.chunkCondition(chunk)) { const usedChunks = module._EnsureChunkConditionsPlugin_usedChunks = (module._EnsureChunkConditionsPlugin_usedChunks || []).concat(chunk); diff --git a/lib/optimize/FlagIncludedChunksPlugin.js b/lib/optimize/FlagIncludedChunksPlugin.js index 4fa9b1f9d6d..23f83b45b1f 100644 --- a/lib/optimize/FlagIncludedChunksPlugin.js +++ b/lib/optimize/FlagIncludedChunksPlugin.js @@ -17,13 +17,13 @@ class FlagIncludedChunksPlugin { // instead of swapping A and B just bail // as we loop twice the current A will be B and B then A - if(chunkA.modules.length < chunkB.modules.length) return; + if(chunkA.getNumberOfModules() < chunkB.getNumberOfModules()) return; - if(chunkB.modules.length === 0) return; + if(chunkB.getNumberOfModules() === 0) return; // is chunkB in chunkA? - for(let i = 0; i < chunkB.modules.length; i++) { - if(chunkA.modules.indexOf(chunkB.modules[i]) < 0) return; + for(let m of chunkB.modulesIterable) { + if(!chunkA.containsModule(m)) return; } chunkA.ids.push(chunkB.id); }); diff --git a/lib/optimize/MergeDuplicateChunksPlugin.js b/lib/optimize/MergeDuplicateChunksPlugin.js index 104cd6d6c8c..aaf0acc7d65 100644 --- a/lib/optimize/MergeDuplicateChunksPlugin.js +++ b/lib/optimize/MergeDuplicateChunksPlugin.js @@ -5,7 +5,7 @@ "use strict"; function getChunkIdentifier(chunk) { - return chunk.modules.map((m) => { + return chunk.mapModules((m) => { return m.identifier(); }).sort().join(", "); } diff --git a/lib/optimize/OccurrenceOrderPlugin.js b/lib/optimize/OccurrenceOrderPlugin.js index dc86b11e3a4..316314809db 100644 --- a/lib/optimize/OccurrenceOrderPlugin.js +++ b/lib/optimize/OccurrenceOrderPlugin.js @@ -80,13 +80,6 @@ class OccurrenceOrderPlugin { function occurs(c) { return c.blocks.length; } - chunks.forEach((c) => { - c.modules.sort((a, b) => { - if(a.identifier() > b.identifier()) return 1; - if(a.identifier() < b.identifier()) return -1; - return 0; - }); - }); chunks.sort((a, b) => { const aEntryOccurs = occursInEntry(a); const bEntryOccurs = occursInEntry(b); @@ -96,13 +89,7 @@ class OccurrenceOrderPlugin { const bOccurs = occurs(b); if(aOccurs > bOccurs) return -1; if(aOccurs < bOccurs) return 1; - if(a.modules.length > b.modules.length) return -1; - if(a.modules.length < b.modules.length) return 1; - for(let i = 0; i < a.modules.length; i++) { - if(a.modules[i].identifier() > b.modules[i].identifier()) return -1; - if(a.modules[i].identifier() < b.modules[i].identifier()) return 1; - } - return 0; + return a.compareTo(b); }); // TODO refactor to Map chunks.forEach((c) => { diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index af4b42dfb4d..1c25dcf9e6e 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -4,18 +4,8 @@ */ "use strict"; -function chunkContainsModule(chunk, module) { - const chunks = module.chunks; - const modules = chunk.modules; - if(chunks.length < modules.length) { - return chunks.indexOf(chunk) >= 0; - } else { - return modules.indexOf(module) >= 0; - } -} - function hasModule(chunk, module, checkedChunks) { - if(chunkContainsModule(chunk, module)) return [chunk]; + if(chunk.containsModule(module)) return [chunk]; if(chunk.parents.length === 0) return false; return allHaveModule(chunk.parents.filter((c) => { return checkedChunks.indexOf(c) < 0; @@ -67,7 +57,7 @@ class RemoveParentModulesPlugin { // TODO consider Map when performance has improved https://gist.github.com/sokra/b36098368da7b8f6792fd7c85fca6311 var cache = Object.create(null); - var modules = chunk.modules.slice(); + var modules = chunk.getModules(); for(var i = 0; i < modules.length; i++) { var module = modules[i]; diff --git a/test/Chunk.test.js b/test/Chunk.test.js index d096dbbfbe1..0105dae1e2f 100644 --- a/test/Chunk.test.js +++ b/test/Chunk.test.js @@ -102,7 +102,7 @@ describe("Chunk", () => { }); describe("and the chunk does contain this module", function() { beforeEach(function() { - ChunkInstance.modules = [module]; + ChunkInstance._modules = new Set([module]); }); it("calls module.removeChunk with itself and returns true", function() { ChunkInstance.removeModule(module).should.eql(true); diff --git a/test/statsCases/aggressive-splitting-on-demand/expected.txt b/test/statsCases/aggressive-splitting-on-demand/expected.txt index b5138f201d9..568b8c62d34 100644 --- a/test/statsCases/aggressive-splitting-on-demand/expected.txt +++ b/test/statsCases/aggressive-splitting-on-demand/expected.txt @@ -1,4 +1,4 @@ -Hash: 57bbddba5221b9ac4a33 +Hash: 3605a628ea012f7d12ca Time: Xms Asset Size Chunks Chunk Names fc930a2adf8206ea2dc5.js 1.94 kB 0 [emitted] @@ -6,10 +6,10 @@ cd45585186d59208602b.js 1.96 kB 1 [emitted] 6b94c231e016c5aaccdb.js 1.94 kB 2 [emitted] fd0985cee894c4f3f1a6.js 1.94 kB 3 [emitted] d9fc46873c8ea924b895.js 979 bytes 4 [emitted] -beecea47f9a8ded3c298.js 7.54 kB 6 [emitted] main +a773fee259e5a284dea9.js 7.54 kB 6 [emitted] main b08c507d4e1e05cbab45.js 985 bytes 9 [emitted] 5d50e858fe6e559aa47c.js 977 bytes 11 [emitted] -Entrypoint main = beecea47f9a8ded3c298.js +Entrypoint main = a773fee259e5a284dea9.js chunk {0} fc930a2adf8206ea2dc5.js 1.8 kB {6} > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 4:0-51 > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 5:0-44 @@ -36,7 +36,7 @@ chunk {4} d9fc46873c8ea924b895.js 899 bytes {6} > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 2:0-23 > aggressive-splitted duplicate [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 3:0-30 [2] (webpack)/test/statsCases/aggressive-splitting-on-demand/c.js 899 bytes {4} [built] -chunk {6} beecea47f9a8ded3c298.js (main) 248 bytes [entry] +chunk {6} a773fee259e5a284dea9.js (main) 248 bytes [entry] > main [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js [9] (webpack)/test/statsCases/aggressive-splitting-on-demand/index.js 248 bytes {6} [built] chunk {9} b08c507d4e1e05cbab45.js 899 bytes {6} diff --git a/test/statsCases/named-chunks-plugin-async/webpack.config.js b/test/statsCases/named-chunks-plugin-async/webpack.config.js index 468dcf8505a..1b81d94fa69 100644 --- a/test/statsCases/named-chunks-plugin-async/webpack.config.js +++ b/test/statsCases/named-chunks-plugin-async/webpack.config.js @@ -12,13 +12,13 @@ module.exports = { if(chunk.name) { return chunk.name; } - const modulesToName = (mods) => mods.map((mod) => { + const chunkModulesToName = (chunk) => chunk.mapModules((mod) => { const rs = new RequestShortener(mod.context); return rs.shorten(mod.request).replace(/[.\/\\]/g, "_"); }).join("-"); - if(chunk.modules.length > 0) { - return `chunk-containing-${modulesToName(chunk.modules)}`; + if(chunk.getNumberOfModules() > 0) { + return `chunk-containing-${chunkModulesToName(chunk)}`; } return null; From 616777b520a52707816118f624c5b153ab51cd3c Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 21 Apr 2017 18:47:59 +0200 Subject: [PATCH 6/9] fix spacing issue --- lib/optimize/RemoveParentModulesPlugin.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index 28fe5a78e3f..a6f46c5ba15 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -29,7 +29,6 @@ function allHaveModule(someChunks, module, checkedChunks) { return chunks; } - class RemoveParentModulesPlugin { apply(compiler) { compiler.plugin("compilation", (compilation) => { From df44599731b4b1d185b20ccd36e9d37d817ad8c2 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Sat, 22 Apr 2017 19:04:11 +0200 Subject: [PATCH 7/9] optimize variable --- lib/Module.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Module.js b/lib/Module.js index dfb350524dd..7f1e83f6767 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -124,8 +124,7 @@ class Module extends DependenciesBlock { mapChunks(fn) { const chunks = this._chunks; - const size = chunks.size; - const array = new Array(size); + const array = new Array(chunks.size); let idx = 0; for(let chunk of chunks) { array[idx++] = fn(chunk, idx, chunks); From 101850c5a90dbc51f1a95813fe1fece42bc1b9dc Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 13 Apr 2017 13:43:51 +0200 Subject: [PATCH 8/9] assign correct records and cache to child compilations This is a breaking change because plugins or loader could rely on this incorrect behavior When using child compilations plugins and loaders should use a unique compiler name or use a consistent order fixes #2777 --- lib/Compilation.js | 7 +++++-- lib/Compiler.js | 23 ++++++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/Compilation.js b/lib/Compilation.js index bdc4f0368f5..2cc53f3bd94 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -80,6 +80,7 @@ class Compilation extends Tapable { this.children = []; this.dependencyFactories = new Map(); this.dependencyTemplates = new Map(); + this.childrenCounters = {}; } getStats() { @@ -1218,8 +1219,10 @@ class Compilation extends Tapable { return this.mainTemplate.applyPluginsWaterfall("asset-path", filename, data); } - createChildCompiler(name, outputOptions) { - return this.compiler.createChildCompiler(this, name, outputOptions); + createChildCompiler(name, outputOptions, plugins) { + var idx = (this.childrenCounters[name] || 0); + this.childrenCounters[name] = idx + 1; + return this.compiler.createChildCompiler(this, name, idx, outputOptions, plugins); } checkConstraints() { diff --git a/lib/Compiler.js b/lib/Compiler.js index 8e1f95de0d8..d825edd73af 100644 --- a/lib/Compiler.js +++ b/lib/Compiler.js @@ -10,6 +10,8 @@ var Stats = require("./Stats"); var NormalModuleFactory = require("./NormalModuleFactory"); var ContextModuleFactory = require("./ContextModuleFactory"); +var makePathsRelative = require("./util/identifier").makePathsRelative; + function Watching(compiler, watchOptions, handler) { this.startTime = null; this.invalid = false; @@ -407,7 +409,7 @@ Compiler.prototype.readRecords = function readRecords(callback) { }); }; -Compiler.prototype.createChildCompiler = function(compilation, compilerName, outputOptions, plugins) { +Compiler.prototype.createChildCompiler = function(compilation, compilerName, compilerIndex, outputOptions, plugins) { var childCompiler = new Compiler(); if(Array.isArray(plugins)) { plugins.forEach(plugin => childCompiler.apply(plugin)); @@ -423,8 +425,23 @@ Compiler.prototype.createChildCompiler = function(compilation, compilerName, out childCompiler.resolvers = this.resolvers; childCompiler.fileTimestamps = this.fileTimestamps; childCompiler.contextTimestamps = this.contextTimestamps; - if(!this.records[compilerName]) this.records[compilerName] = []; - this.records[compilerName].push(childCompiler.records = {}); + + var relativeCompilerName = makePathsRelative(this.context, compilerName); + if(!this.records[relativeCompilerName]) this.records[relativeCompilerName] = []; + if(this.records[relativeCompilerName][compilerIndex]) + childCompiler.records = this.records[relativeCompilerName][compilerIndex]; + else + this.records[relativeCompilerName].push(childCompiler.records = {}); + + if(this.cache) { + if(!this.cache.children) this.cache.children = {}; + if(!this.cache.children[compilerName]) this.cache.children[compilerName] = []; + if(this.cache.children[compilerName][compilerIndex]) + childCompiler.cache = this.cache.children[compilerName][compilerIndex]; + else + this.cache.children[compilerName].push(childCompiler.cache = {}); + } + childCompiler.options = Object.create(this.options); childCompiler.options.output = Object.create(childCompiler.options.output); for(name in outputOptions) { From 206ef6d079515a57fbca113cbdcb53cec3def4d6 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 17 Jan 2017 22:26:38 +0100 Subject: [PATCH 9/9] fixes incorrect CLI stats output add "detailed" preset clean up presets to do more useful stuff fixes #4141 fixes #4118 --- bin/webpack.js | 67 +++-- lib/Stats.js | 240 ++++++++++-------- schemas/webpackOptionsSchema.json | 1 + test/BinTestCases.test.js | 4 +- test/MultiStats.test.js | 1 - test/Stats.test.js | 37 +-- test/binCases/entry/multi-file/test.opts | 5 + test/binCases/entry/named-entry/test.opts | 5 + .../entry/non-hyphenated-args/test.opts | 5 + .../uglifyjsplugin-empty-args/test.opts | 5 + test/binCases/stats/custom-preset/index.js | 1 + test/binCases/stats/custom-preset/test.js | 8 + test/binCases/stats/custom-preset/test.opts | 5 + test/binCases/stats/none/index.js | 1 + test/binCases/stats/none/test.js | 8 + test/binCases/stats/none/webpack.config.js | 6 + test/binCases/stats/single-config/test.js | 7 +- .../watch/multi-config-watch-opt/test.opts | 5 + .../watch/single-config-watch-opt/test.opts | 5 + .../webpack.config.js | 11 +- .../webpack.config.js | 11 +- test/statsCases/chunks/expected.txt | 19 +- test/statsCases/chunks/webpack.config.js | 12 +- test/statsCases/color-disabled/expected.txt | 3 +- .../color-enabled-custom/expected.txt | 3 +- test/statsCases/color-enabled/expected.txt | 3 +- .../commons-chunk-min-size-0/expected.txt | 18 +- .../expected.txt | 21 +- test/statsCases/define-plugin/expected.txt | 6 +- .../exclude-with-loader/expected.txt | 7 +- test/statsCases/external/expected.txt | 5 +- test/statsCases/filter-warnings/expected.txt | 13 - .../max-modules-default/expected.txt | 33 ++- test/statsCases/max-modules/expected.txt | 43 ++-- .../expected.txt | 3 +- .../expected.txt | 3 +- .../named-chunks-plugin-async/expected.txt | 9 +- .../named-chunks-plugin/expected.txt | 13 +- .../optimize-chunks/webpack.config.js | 3 + .../performance-disabled/expected.txt | 16 +- .../statsCases/performance-error/expected.txt | 16 +- .../expected.txt | 15 +- .../performance-no-hints/expected.txt | 16 +- .../expected.txt | 9 +- test/statsCases/preset-detailed/a.js | 1 + test/statsCases/preset-detailed/b.js | 1 + test/statsCases/preset-detailed/c.js | 1 + test/statsCases/preset-detailed/d.js | 1 + test/statsCases/preset-detailed/e.js | 1 + test/statsCases/preset-detailed/expected.txt | 22 ++ test/statsCases/preset-detailed/index.js | 3 + .../preset-detailed/webpack.config.js | 4 + .../preset-minimal-simple/expected.txt | 2 +- test/statsCases/preset-minimal/expected.txt | 5 +- .../preset-mixed-array/expected.txt | 5 +- .../expected.txt | 16 +- .../preset-normal-performance/expected.txt | 16 +- test/statsCases/preset-normal/expected.txt | 15 +- test/statsCases/preset-verbose/expected.txt | 4 + .../resolve-plugin-context/expected.txt | 1 - .../reverse-sort-modules/expected.txt | 43 ++-- .../separate-css-bundle/expected.txt | 26 +- test/statsCases/simple-more-info/expected.txt | 4 - test/statsCases/simple/expected.txt | 3 +- test/statsCases/tree-shaking/expected.txt | 1 - .../statsCases/warnings-uglifyjs/expected.txt | 1 - 66 files changed, 442 insertions(+), 461 deletions(-) mode change 100755 => 100644 bin/webpack.js create mode 100644 test/binCases/stats/custom-preset/index.js create mode 100644 test/binCases/stats/custom-preset/test.js create mode 100644 test/binCases/stats/custom-preset/test.opts create mode 100644 test/binCases/stats/none/index.js create mode 100644 test/binCases/stats/none/test.js create mode 100644 test/binCases/stats/none/webpack.config.js create mode 100644 test/statsCases/preset-detailed/a.js create mode 100644 test/statsCases/preset-detailed/b.js create mode 100644 test/statsCases/preset-detailed/c.js create mode 100644 test/statsCases/preset-detailed/d.js create mode 100644 test/statsCases/preset-detailed/e.js create mode 100644 test/statsCases/preset-detailed/expected.txt create mode 100644 test/statsCases/preset-detailed/index.js create mode 100644 test/statsCases/preset-detailed/webpack.config.js diff --git a/bin/webpack.js b/bin/webpack.js old mode 100755 new mode 100644 index 37125533c52..d69c1357ae3 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -129,6 +129,11 @@ yargs.options({ group: DISPLAY_GROUP, describe: "Display details about errors" }, + "display": { + type: "string", + group: DISPLAY_GROUP, + describe: "Select display preset (verbose, detailed, normal, minimal, errors-only, none)" + }, "verbose": { type: "boolean", group: DISPLAY_GROUP, @@ -139,15 +144,7 @@ yargs.options({ var argv = yargs.argv; if(argv.verbose) { - argv["display-reasons"] = true; - argv["display-depth"] = true; - argv["display-entrypoints"] = true; - argv["display-used-exports"] = true; - argv["display-provided-exports"] = true; - argv["display-error-details"] = true; - argv["display-modules"] = true; - argv["display-cached"] = true; - argv["display-cached-assets"] = true; + argv["display"] = "verbose"; } var options = require("./convert-argv")(yargs, argv); @@ -181,6 +178,11 @@ function processOptions(options) { } else if(!outputOptions) { outputOptions = {}; } + + ifArg("display", function(preset) { + outputOptions = statsPresetToOptions(preset); + }); + outputOptions = Object.create(outputOptions); if(Array.isArray(options) && !outputOptions.children) { outputOptions.children = options.map(o => o.stats); @@ -219,36 +221,46 @@ function processOptions(options) { outputOptions.cachedAssets = false; ifArg("display-chunks", function(bool) { - outputOptions.modules = !bool; - outputOptions.chunks = bool; + if(bool) { + outputOptions.modules = false; + outputOptions.chunks = true; + outputOptions.chunkModules = true; + } }); ifArg("display-entrypoints", function(bool) { - outputOptions.entrypoints = bool; + if(bool) + outputOptions.entrypoints = true; }); ifArg("display-reasons", function(bool) { - outputOptions.reasons = bool; + if(bool) + outputOptions.reasons = true; }); ifArg("display-depth", function(bool) { - outputOptions.depth = bool; + if(bool) + outputOptions.depth = true; }); ifArg("display-used-exports", function(bool) { - outputOptions.usedExports = bool; + if(bool) + outputOptions.usedExports = true; }); ifArg("display-provided-exports", function(bool) { - outputOptions.providedExports = bool; + if(bool) + outputOptions.providedExports = true; }); ifArg("display-error-details", function(bool) { - outputOptions.errorDetails = bool; + if(bool) + outputOptions.errorDetails = true; }); ifArg("display-origins", function(bool) { - outputOptions.chunkOrigins = bool; + if(bool) + outputOptions.chunkOrigins = true; }); ifArg("display-max-modules", function(value) { @@ -272,21 +284,6 @@ function processOptions(options) { outputOptions.maxModules = Infinity; outputOptions.exclude = undefined; } - } else { - if(typeof outputOptions.chunks === "undefined") - outputOptions.chunks = true; - if(typeof outputOptions.entrypoints === "undefined") - outputOptions.entrypoints = true; - if(typeof outputOptions.modules === "undefined") - outputOptions.modules = true; - if(typeof outputOptions.chunkModules === "undefined") - outputOptions.chunkModules = true; - if(typeof outputOptions.reasons === "undefined") - outputOptions.reasons = true; - if(typeof outputOptions.cached === "undefined") - outputOptions.cached = true; - if(typeof outputOptions.cachedAssets === "undefined") - outputOptions.cachedAssets = true; } ifArg("hide-modules", function(bool) { @@ -337,7 +334,9 @@ function processOptions(options) { process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n"); } else if(stats.hash !== lastHash) { lastHash = stats.hash; - process.stdout.write(stats.toString(outputOptions) + "\n"); + var statsString = stats.toString(outputOptions); + if(statsString) + process.stdout.write(statsString + "\n"); } if(!options.watch && stats.hasErrors()) { process.on("exit", function() { diff --git a/lib/Stats.js b/lib/Stats.js index 7e869a0cf5c..6136b29e281 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -8,7 +8,7 @@ const RequestShortener = require("./RequestShortener"); const SizeFormatHelpers = require("./SizeFormatHelpers"); const formatLocation = require("./formatLocation"); -const optionOrFallback = (optionValue, fallbackValue) => optionValue !== undefined ? optionValue : fallbackValue; +const optionOrFallback = (optionValue, fallbackValue) => typeof optionValue !== "undefined" ? optionValue : fallbackValue; class Stats { constructor(compilation) { @@ -75,50 +75,61 @@ class Stats { options = {}; } + const optionOrLocalFallback = (v, def) => + typeof v !== "undefined" ? v : + typeof options.all !== "undefined" ? options.all : def; + const compilation = this.compilation; const requestShortener = new RequestShortener(optionOrFallback(options.context, process.cwd())); - const showPerformance = optionOrFallback(options.performance, true); - const showHash = optionOrFallback(options.hash, true); - const showVersion = optionOrFallback(options.version, true); - const showTimings = optionOrFallback(options.timings, true); - const showAssets = optionOrFallback(options.assets, true); - const showEntrypoints = optionOrFallback(options.entrypoints, !forToString); - const showChunks = optionOrFallback(options.chunks, true); - const showChunkModules = optionOrFallback(options.chunkModules, !!forToString); - const showChunkOrigins = optionOrFallback(options.chunkOrigins, !forToString); - const showModules = optionOrFallback(options.modules, !forToString); - const showDepth = optionOrFallback(options.depth, !forToString); - const showCachedModules = optionOrFallback(options.cached, true); - const showCachedAssets = optionOrFallback(options.cachedAssets, true); - const showReasons = optionOrFallback(options.reasons, !forToString); - const showUsedExports = optionOrFallback(options.usedExports, !forToString); - const showProvidedExports = optionOrFallback(options.providedExports, !forToString); - const showChildren = optionOrFallback(options.children, true); - const showSource = optionOrFallback(options.source, !forToString); - const showModuleTrace = optionOrFallback(options.moduleTrace, true); - const showErrors = optionOrFallback(options.errors, true); - const showErrorDetails = optionOrFallback(options.errorDetails, !forToString); - const showWarnings = optionOrFallback(options.warnings, true); + const showPerformance = optionOrLocalFallback(options.performance, true); + const showHash = optionOrLocalFallback(options.hash, true); + const showVersion = optionOrLocalFallback(options.version, true); + const showTimings = optionOrLocalFallback(options.timings, true); + const showAssets = optionOrLocalFallback(options.assets, true); + const showEntrypoints = optionOrLocalFallback(options.entrypoints, !forToString); + const showChunks = optionOrLocalFallback(options.chunks, !forToString); + const showChunkModules = optionOrLocalFallback(options.chunkModules, !!forToString); + const showChunkOrigins = optionOrLocalFallback(options.chunkOrigins, !forToString); + const showModules = optionOrLocalFallback(options.modules, true); + const showDepth = optionOrLocalFallback(options.depth, !forToString); + const showCachedModules = optionOrLocalFallback(options.cached, true); + const showCachedAssets = optionOrLocalFallback(options.cachedAssets, true); + const showReasons = optionOrLocalFallback(options.reasons, !forToString); + const showUsedExports = optionOrLocalFallback(options.usedExports, !forToString); + const showProvidedExports = optionOrLocalFallback(options.providedExports, !forToString); + const showChildren = optionOrLocalFallback(options.children, true); + const showSource = optionOrLocalFallback(options.source, !forToString); + const showModuleTrace = optionOrLocalFallback(options.moduleTrace, true); + const showErrors = optionOrLocalFallback(options.errors, true); + const showErrorDetails = optionOrLocalFallback(options.errorDetails, !forToString); + const showWarnings = optionOrLocalFallback(options.warnings, true); const warningsFilter = optionOrFallback(options.warningsFilter, null); - const showPublicPath = optionOrFallback(options.publicPath, !forToString); - const excludeModules = [].concat(optionOrFallback(options.exclude, [])).map(str => { - if(typeof str !== "string") return str; - return new RegExp(`[\\\\/]${str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")}([\\\\/]|$|!|\\?)`); + const showPublicPath = optionOrLocalFallback(options.publicPath, !forToString); + const excludeModules = [].concat(optionOrFallback(options.exclude, [])).map(item => { + if(typeof item === "string") { + const regExp = new RegExp(`[\\\\/]${item.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")}([\\\\/]|$|!|\\?)`); + return ident => regExp.test(ident); + } + if(item && typeof item === "object" && typeof item.test === "function") + return ident => item.test(ident); + if(typeof item === "function") + return item; }); const maxModules = optionOrFallback(options.maxModules, forToString ? 15 : Infinity); const sortModules = optionOrFallback(options.modulesSort, "id"); const sortChunks = optionOrFallback(options.chunksSort, "id"); const sortAssets = optionOrFallback(options.assetsSort, ""); + if(!showCachedModules) { + excludeModules.push((ident, module) => !module.built); + } + const createModuleFilter = () => { let i = 0; return module => { - if(!showCachedModules && !module.built) { - return false; - } if(excludeModules.length > 0) { const ident = requestShortener.shorten(module.resource); - const excluded = excludeModules.some(regExp => regExp.test(ident)); + const excluded = excludeModules.some(fn => fn(ident, module)); if(excluded) return false; } @@ -685,6 +696,35 @@ class Stats { } }; + const processModulesList = (obj, prefix) => { + if(obj.modules) { + obj.modules.forEach(module => { + colors.normal(prefix); + if(module.id < 1000) colors.normal(" "); + if(module.id < 100) colors.normal(" "); + if(module.id < 10) colors.normal(" "); + colors.normal("["); + colors.normal(module.id); + colors.normal("] "); + colors.bold(module.name || module.identifier); + processModuleAttributes(module); + newline(); + processModuleContent(module, prefix + " "); + }); + if(obj.filteredModules > 0) { + colors.normal(prefix); + colors.normal(" "); + if(obj.modules.length > 0) + colors.normal(" + "); + colors.normal(obj.filteredModules); + if(obj.modules.length > 0) + colors.normal(" hidden"); + colors.normal(obj.filteredModules !== 1 ? " modules" : " module"); + newline(); + } + } + }; + if(obj.chunks) { obj.chunks.forEach(chunk => { colors.normal("chunk "); @@ -746,46 +786,12 @@ class Stats { newline(); }); } - if(chunk.modules) { - chunk.modules.forEach(module => { - colors.normal(" "); - if(module.id < 1000) colors.normal(" "); - if(module.id < 100) colors.normal(" "); - if(module.id < 10) colors.normal(" "); - colors.normal("["); - colors.normal(module.id); - colors.normal("] "); - colors.bold(module.name); - processModuleAttributes(module); - newline(); - processModuleContent(module, " "); - }); - if(chunk.filteredModules > 0) { - colors.normal(` + ${chunk.filteredModules} hidden modules`); - newline(); - } - } - }); - } - if(obj.modules) { - obj.modules.forEach(module => { - if(module.id < 1000) colors.normal(" "); - if(module.id < 100) colors.normal(" "); - if(module.id < 10) colors.normal(" "); - colors.normal("["); - colors.normal(module.id); - colors.normal("] "); - colors.bold(module.name || module.identifier); - processModuleAttributes(module); - newline(); - processModuleContent(module, " "); + processModulesList(chunk, " "); }); - if(obj.filteredModules > 0) { - colors.normal(` + ${obj.filteredModules} hidden modules`); - newline(); - } } + processModulesList(obj, ""); + if(obj._showWarnings && obj.warnings) { obj.warnings.forEach(warning => { newline(); @@ -827,51 +833,61 @@ class Stats { } static presetToOptions(name) { - //Accepted values: none, errors-only, minimal, normal, verbose - //Any other falsy value will behave as 'none', truthy values as 'normal' - const pn = (typeof name === "string") && name.toLowerCase() || name; - if(pn === "none" || !pn) { - return { - hash: false, - version: false, - timings: false, - assets: false, - entrypoints: false, - chunks: false, - chunkModules: false, - modules: false, - reasons: false, - depth: false, - usedExports: false, - providedExports: false, - children: false, - source: false, - errors: false, - errorDetails: false, - warnings: false, - publicPath: false, - performance: false - }; - } else { - return { - hash: pn !== "errors-only" && pn !== "minimal", - version: pn === "verbose", - timings: pn !== "errors-only" && pn !== "minimal", - assets: pn === "verbose", - entrypoints: pn === "verbose", - chunks: pn !== "errors-only", - chunkModules: pn === "verbose", - //warnings: pn !== "errors-only", - errorDetails: pn !== "errors-only" && pn !== "minimal", - reasons: pn === "verbose", - depth: pn === "verbose", - usedExports: pn === "verbose", - providedExports: pn === "verbose", - colors: true, - performance: true - }; + // Accepted values: none, errors-only, minimal, normal, detailed, verbose + // Any other falsy value will behave as 'none', truthy values as 'normal' + const pn = (typeof name === "string") && name.toLowerCase() || name || "none"; + switch(pn) { + case "none": + return { + all: false + }; + case "verbose": + return { + entrypoints: true, + modules: false, + chunks: true, + chunkModules: true, + chunkOrigins: true, + depth: true, + reasons: true, + usedExports: true, + providedExports: true, + errorDetails: true, + publicPath: true, + exclude: () => false, + maxModules: Infinity, + }; + case "detailed": + return { + entrypoints: true, + chunks: true, + chunkModules: false, + chunkOrigins: true, + depth: true, + usedExports: true, + providedExports: true, + errorDetails: true, + publicPath: true, + exclude: () => false, + maxModules: Infinity, + }; + case "minimal": + return { + all: false, + modules: true, + maxModules: 0, + errors: true, + warnings: true + }; + case "errors-only": + return { + all: false, + errors: true, + moduleTrace: true + }; + default: + return {}; } - } static getChildOptions(options, idx) { diff --git a/schemas/webpackOptionsSchema.json b/schemas/webpackOptionsSchema.json index a370ef51eee..4fd613e8072 100644 --- a/schemas/webpackOptionsSchema.json +++ b/schemas/webpackOptionsSchema.json @@ -1016,6 +1016,7 @@ "errors-only", "minimal", "normal", + "detailed", "verbose" ] } diff --git a/test/BinTestCases.test.js b/test/BinTestCases.test.js index 7457edf1067..98fff9fe047 100644 --- a/test/BinTestCases.test.js +++ b/test/BinTestCases.test.js @@ -22,7 +22,7 @@ function getTestSpecificArguments(testDirectory) { try { return loadOptsFile(path.join(testDirectory, "test.opts")); } catch(e) { - return []; + return null; } } @@ -51,7 +51,7 @@ describe("BinTestCases", function() { category.tests.forEach(function(testName) { const testDirectory = path.join(casesPath, category.name, testName); - const testArgs = defaultArgs.concat(getTestSpecificArguments(testDirectory)); + const testArgs = getTestSpecificArguments(testDirectory) || defaultArgs; const testAssertions = require(path.join(testDirectory, "test.js")); const outputPath = path.join(path.resolve(casesPath, "../js/bin"), category.name, testName); diff --git a/test/MultiStats.test.js b/test/MultiStats.test.js index c0737a0e816..211014e8893 100644 --- a/test/MultiStats.test.js +++ b/test/MultiStats.test.js @@ -210,7 +210,6 @@ describe("MultiStats", () => { "(xyz890-compilation) xyz890-warning-1", "(xyz890-compilation) xyz890-warning-2" ], - hash: "abc123xyz890", children: [{ warnings: ["abc123-warning"], errors: ["abc123-error"], diff --git a/test/Stats.test.js b/test/Stats.test.js index 9943d9a50a1..c49ab793080 100644 --- a/test/Stats.test.js +++ b/test/Stats.test.js @@ -154,22 +154,7 @@ describe("Stats", () => { describe("Presets", () => { describe("presetToOptions", () => { it("returns correct object with 'Normal'", () => { - Stats.presetToOptions("Normal").should.eql({ - assets: false, - version: false, - timings: true, - hash: true, - entrypoints: false, - chunks: true, - chunkModules: false, - errorDetails: true, - reasons: false, - depth: false, - usedExports: false, - providedExports: false, - colors: true, - performance: true - }); + Stats.presetToOptions("Normal").should.eql({}); }); it("truthy values behave as 'normal'", () => { const normalOpts = Stats.presetToOptions("normal"); @@ -182,25 +167,7 @@ describe("Stats", () => { }); it("returns correct object with 'none'", () => { Stats.presetToOptions("none").should.eql({ - hash: false, - version: false, - timings: false, - assets: false, - entrypoints: false, - chunks: false, - chunkModules: false, - modules: false, - reasons: false, - depth: false, - usedExports: false, - providedExports: false, - children: false, - source: false, - errors: false, - errorDetails: false, - warnings: false, - publicPath: false, - performance: false + all: false }); }); it("falsy values behave as 'none'", () => { diff --git a/test/binCases/entry/multi-file/test.opts b/test/binCases/entry/multi-file/test.opts index 7e426fa77b6..53402ac53c5 100644 --- a/test/binCases/entry/multi-file/test.opts +++ b/test/binCases/entry/multi-file/test.opts @@ -1 +1,6 @@ +--entry ./index.js --entry ./a.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node diff --git a/test/binCases/entry/named-entry/test.opts b/test/binCases/entry/named-entry/test.opts index fce9b8c1757..b8f0fa016e2 100644 --- a/test/binCases/entry/named-entry/test.opts +++ b/test/binCases/entry/named-entry/test.opts @@ -1 +1,6 @@ --entry foo=./a.js +--entry ./index.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node diff --git a/test/binCases/entry/non-hyphenated-args/test.opts b/test/binCases/entry/non-hyphenated-args/test.opts index 777a4a4b9f1..6b8499d5275 100644 --- a/test/binCases/entry/non-hyphenated-args/test.opts +++ b/test/binCases/entry/non-hyphenated-args/test.opts @@ -1 +1,6 @@ ./a.js +--entry ./index.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node diff --git a/test/binCases/plugins/uglifyjsplugin-empty-args/test.opts b/test/binCases/plugins/uglifyjsplugin-empty-args/test.opts index 9c67444edef..edc5ab3dcb3 100644 --- a/test/binCases/plugins/uglifyjsplugin-empty-args/test.opts +++ b/test/binCases/plugins/uglifyjsplugin-empty-args/test.opts @@ -1 +1,6 @@ +--entry ./index.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node --plugin webpack/lib/optimize/UglifyJsPlugin diff --git a/test/binCases/stats/custom-preset/index.js b/test/binCases/stats/custom-preset/index.js new file mode 100644 index 00000000000..e7134e7006d --- /dev/null +++ b/test/binCases/stats/custom-preset/index.js @@ -0,0 +1 @@ +module.exports = "foo"; diff --git a/test/binCases/stats/custom-preset/test.js b/test/binCases/stats/custom-preset/test.js new file mode 100644 index 00000000000..0b93dfe3c2b --- /dev/null +++ b/test/binCases/stats/custom-preset/test.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function testAssertions(code, stdout, stderr) { + stderr.should.be.empty(); + code.should.be.eql(0); + + stdout.should.be.empty(); +}; diff --git a/test/binCases/stats/custom-preset/test.opts b/test/binCases/stats/custom-preset/test.opts new file mode 100644 index 00000000000..4747dc2f32f --- /dev/null +++ b/test/binCases/stats/custom-preset/test.opts @@ -0,0 +1,5 @@ +--entry ./index.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node +--display none diff --git a/test/binCases/stats/none/index.js b/test/binCases/stats/none/index.js new file mode 100644 index 00000000000..e7134e7006d --- /dev/null +++ b/test/binCases/stats/none/index.js @@ -0,0 +1 @@ +module.exports = "foo"; diff --git a/test/binCases/stats/none/test.js b/test/binCases/stats/none/test.js new file mode 100644 index 00000000000..ee38bdcc2f4 --- /dev/null +++ b/test/binCases/stats/none/test.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function testAssertions(code, stdout, stderr) { + code.should.be.eql(0); + + stdout.should.be.empty(); + stderr.should.be.empty(); +}; diff --git a/test/binCases/stats/none/webpack.config.js b/test/binCases/stats/none/webpack.config.js new file mode 100644 index 00000000000..40a6ae80766 --- /dev/null +++ b/test/binCases/stats/none/webpack.config.js @@ -0,0 +1,6 @@ +var path = require("path"); + +module.exports = { + entry: path.resolve(__dirname, "./index"), + stats: "none" +}; diff --git a/test/binCases/stats/single-config/test.js b/test/binCases/stats/single-config/test.js index 02dc1de9410..a961bcd51de 100644 --- a/test/binCases/stats/single-config/test.js +++ b/test/binCases/stats/single-config/test.js @@ -8,9 +8,10 @@ module.exports = function testAssertions(code, stdout, stderr) { stdout[1].should.containEql("Version: "); stdout[2].should.containEql("Time: "); stdout[4].should.containEql("\u001b[1m\u001b[32mnull.js\u001b[39m\u001b[22m"); - stdout[5].should.not.containEql("./index.js"); - stdout[5].should.not.containEql("[built]"); - stdout[5].should.containEql("1 hidden module"); + stdout[5].should.containEql("chunk"); + stdout[6].should.not.containEql("./index.js"); + stdout[6].should.not.containEql("[built]"); + stdout[6].should.containEql("1 module"); stderr.should.be.empty(); }; diff --git a/test/binCases/watch/multi-config-watch-opt/test.opts b/test/binCases/watch/multi-config-watch-opt/test.opts index c4b4d4f8bd2..38534ad5708 100644 --- a/test/binCases/watch/multi-config-watch-opt/test.opts +++ b/test/binCases/watch/multi-config-watch-opt/test.opts @@ -1 +1,6 @@ +--entry ./index.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node --watch diff --git a/test/binCases/watch/single-config-watch-opt/test.opts b/test/binCases/watch/single-config-watch-opt/test.opts index c4b4d4f8bd2..38534ad5708 100644 --- a/test/binCases/watch/single-config-watch-opt/test.opts +++ b/test/binCases/watch/single-config-watch-opt/test.opts @@ -1 +1,6 @@ +--entry ./index.js +--config ./webpack.config.js +--output-filename [name].js +--output-chunk-filename [id].chunk.js +--target async-node --watch diff --git a/test/statsCases/aggressive-splitting-entry/webpack.config.js b/test/statsCases/aggressive-splitting-entry/webpack.config.js index 4e58f335e02..4a7dbe53276 100644 --- a/test/statsCases/aggressive-splitting-entry/webpack.config.js +++ b/test/statsCases/aggressive-splitting-entry/webpack.config.js @@ -16,18 +16,11 @@ module.exports = { recordsInputPath: __dirname + "/input-records.json", //recordsOutputPath: __dirname + "/records.json", stats: { - reasons: false, + chunks: true, chunkModules: true, chunkOrigins: true, entrypoints: true, modules: false, - cached: true, - cachedAssets: true, - source: true, - errorDetails: true, - publicPath: true, - excludeModules: [ - /e\.js/ - ] + publicPath: true } }; diff --git a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js index 4e58f335e02..4a7dbe53276 100644 --- a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js +++ b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js @@ -16,18 +16,11 @@ module.exports = { recordsInputPath: __dirname + "/input-records.json", //recordsOutputPath: __dirname + "/records.json", stats: { - reasons: false, + chunks: true, chunkModules: true, chunkOrigins: true, entrypoints: true, modules: false, - cached: true, - cachedAssets: true, - source: true, - errorDetails: true, - publicPath: true, - excludeModules: [ - /e\.js/ - ] + publicPath: true } }; diff --git a/test/statsCases/chunks/expected.txt b/test/statsCases/chunks/expected.txt index 60b2ee197c3..4989c5f931e 100644 --- a/test/statsCases/chunks/expected.txt +++ b/test/statsCases/chunks/expected.txt @@ -29,21 +29,4 @@ chunk {3} bundle.js (main) 73 bytes [entry] [rendered] cjs require ./a [5] (webpack)/test/statsCases/chunks/index.js 1:0-14 [] -> factory:Xms building:Xms = Xms [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {3} [built] - factory:Xms building:Xms = Xms - [0] (webpack)/test/statsCases/chunks/a.js 22 bytes {3} [built] - cjs require ./a [5] (webpack)/test/statsCases/chunks/index.js 1:0-14 - [] -> factory:Xms building:Xms = Xms - [1] (webpack)/test/statsCases/chunks/b.js 22 bytes {1} [built] - amd require ./b [5] (webpack)/test/statsCases/chunks/index.js 2:0-16 - [] -> factory:Xms building:Xms = Xms - [2] (webpack)/test/statsCases/chunks/c.js 54 bytes {0} [built] - amd require ./c [5] (webpack)/test/statsCases/chunks/index.js 3:0-16 - [] -> factory:Xms building:Xms = Xms - [3] (webpack)/test/statsCases/chunks/d.js 22 bytes {2} [built] - require.ensure item ./d [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 - [] -> factory:Xms building:Xms = Xms - [4] (webpack)/test/statsCases/chunks/e.js 22 bytes {2} [built] - require.ensure item ./e [2] (webpack)/test/statsCases/chunks/c.js 1:0-52 - [] -> factory:Xms building:Xms = Xms - [5] (webpack)/test/statsCases/chunks/index.js 51 bytes {3} [built] - factory:Xms building:Xms = Xms \ No newline at end of file + factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/chunks/webpack.config.js b/test/statsCases/chunks/webpack.config.js index 78a5b433e41..ac4b79411fd 100644 --- a/test/statsCases/chunks/webpack.config.js +++ b/test/statsCases/chunks/webpack.config.js @@ -6,16 +6,10 @@ module.exports = { profile: true, stats: { reasons: true, + chunks: true, chunkModules: true, chunkOrigins: true, - modules: true, - cached: true, - cachedAssets: true, - source: true, - errorDetails: true, - publicPath: true, - excludeModules: [ - /e\.js/ - ] + modules: false, + publicPath: true } }; diff --git a/test/statsCases/color-disabled/expected.txt b/test/statsCases/color-disabled/expected.txt index 89a00401496..bf115852479 100644 --- a/test/statsCases/color-disabled/expected.txt +++ b/test/statsCases/color-disabled/expected.txt @@ -2,5 +2,4 @@ Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.63 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/color-disabled/index.js 0 bytes {0} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/color-disabled/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled-custom/expected.txt b/test/statsCases/color-enabled-custom/expected.txt index e75eca438a8..8540d3f05ff 100644 --- a/test/statsCases/color-enabled-custom/expected.txt +++ b/test/statsCases/color-enabled-custom/expected.txt @@ -2,5 +2,4 @@ Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.63 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/color-enabled-custom/index.js 0 bytes {0} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/color-enabled-custom/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/color-enabled/expected.txt b/test/statsCases/color-enabled/expected.txt index 3873582f12b..1171df94862 100644 --- a/test/statsCases/color-enabled/expected.txt +++ b/test/statsCases/color-enabled/expected.txt @@ -2,5 +2,4 @@ Hash: 6c781fe6bf412ba6435b Time: Xms Asset Size Chunks Chunk Names main.js 2.63 kB 0 [emitted] main -chunk {0} main.js (main) 0 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/color-enabled/index.js 0 bytes {0} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/color-enabled/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/commons-chunk-min-size-0/expected.txt b/test/statsCases/commons-chunk-min-size-0/expected.txt index f67180b9ffa..99a221968c1 100644 --- a/test/statsCases/commons-chunk-min-size-0/expected.txt +++ b/test/statsCases/commons-chunk-min-size-0/expected.txt @@ -3,13 +3,11 @@ Time: Xms Asset Size Chunks Chunk Names entry-1.js 25 bytes 0 [emitted] entry-1 vendor-1.js 6.84 kB 1 [emitted] vendor-1 -chunk {0} entry-1.js (entry-1) 0 bytes {1} [initial] [rendered] -chunk {1} vendor-1.js (vendor-1) 329 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/a.js 22 bytes {1} [built] - [1] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/b.js 22 bytes {1} [built] - [2] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/c.js 22 bytes {1} [built] - [3] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/d.js 22 bytes {1} [built] - [4] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/e.js 22 bytes {1} [built] - [5] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/f.js 22 bytes {1} [built] - [6] multi ./modules/a ./modules/b ./modules/c 52 bytes {1} [built] - [7] (webpack)/test/statsCases/commons-chunk-min-size-0/entry-1.js 145 bytes {1} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/a.js 22 bytes {1} [built] + [1] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/c.js 22 bytes {1} [built] + [3] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/d.js 22 bytes {1} [built] + [4] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/e.js 22 bytes {1} [built] + [5] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/f.js 22 bytes {1} [built] + [6] multi ./modules/a ./modules/b ./modules/c 52 bytes {1} [built] + [7] (webpack)/test/statsCases/commons-chunk-min-size-0/entry-1.js 145 bytes {1} [built] \ No newline at end of file diff --git a/test/statsCases/commons-chunk-min-size-Infinity/expected.txt b/test/statsCases/commons-chunk-min-size-Infinity/expected.txt index 7fc0b94b55b..7904a409e25 100644 --- a/test/statsCases/commons-chunk-min-size-Infinity/expected.txt +++ b/test/statsCases/commons-chunk-min-size-Infinity/expected.txt @@ -3,16 +3,11 @@ Time: Xms Asset Size Chunks Chunk Names entry-1.js 3.27 kB 0 [emitted] entry-1 vendor-1.js 3.02 kB 1 [emitted] vendor-1 -chunk {0} entry-1.js (entry-1) 277 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/a.js 22 bytes {0} {1} [built] - [1] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/b.js 22 bytes {0} {1} [built] - [2] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/c.js 22 bytes {0} {1} [built] - [3] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/entry-1.js 145 bytes {0} [built] - [4] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/d.js 22 bytes {0} [built] - [5] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/e.js 22 bytes {0} [built] - [6] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/f.js 22 bytes {0} [built] -chunk {1} vendor-1.js (vendor-1) 118 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/a.js 22 bytes {0} {1} [built] - [1] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/b.js 22 bytes {0} {1} [built] - [2] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/c.js 22 bytes {0} {1} [built] - [7] multi ./modules/a ./modules/b ./modules/c 52 bytes {1} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/a.js 22 bytes {0} {1} [built] + [1] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/b.js 22 bytes {0} {1} [built] + [2] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/c.js 22 bytes {0} {1} [built] + [3] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/entry-1.js 145 bytes {0} [built] + [4] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/d.js 22 bytes {0} [built] + [5] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/e.js 22 bytes {0} [built] + [6] (webpack)/test/statsCases/commons-chunk-min-size-Infinity/modules/f.js 22 bytes {0} [built] + [7] multi ./modules/a ./modules/b ./modules/c 52 bytes {1} [built] \ No newline at end of file diff --git a/test/statsCases/define-plugin/expected.txt b/test/statsCases/define-plugin/expected.txt index d208e116896..35cc18f5c1f 100644 --- a/test/statsCases/define-plugin/expected.txt +++ b/test/statsCases/define-plugin/expected.txt @@ -4,12 +4,10 @@ Child Time: Xms Asset Size Chunks Chunk Names main.js 2.68 kB 0 [emitted] main - chunk {0} main.js (main) 24 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] + [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] Child Hash: eb3ff8e5a88b9234d04f Time: Xms Asset Size Chunks Chunk Names main.js 2.68 kB 0 [emitted] main - chunk {0} main.js (main) 24 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/define-plugin/index.js 24 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/exclude-with-loader/expected.txt b/test/statsCases/exclude-with-loader/expected.txt index af7ff0f8d47..929df34dc58 100644 --- a/test/statsCases/exclude-with-loader/expected.txt +++ b/test/statsCases/exclude-with-loader/expected.txt @@ -2,7 +2,6 @@ Hash: 7ab067a6a9fc61623ae0 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.9 kB 0 [emitted] main -chunk {0} bundle.js (main) 132 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/exclude-with-loader/a.txt 43 bytes {0} [built] - [2] (webpack)/test/statsCases/exclude-with-loader/index.js 46 bytes {0} [built] - + 1 hidden modules \ No newline at end of file + [0] (webpack)/test/statsCases/exclude-with-loader/a.txt 43 bytes {0} [built] + [2] (webpack)/test/statsCases/exclude-with-loader/index.js 46 bytes {0} [built] + + 1 hidden module \ No newline at end of file diff --git a/test/statsCases/external/expected.txt b/test/statsCases/external/expected.txt index 18706b3f9f3..08281239a38 100644 --- a/test/statsCases/external/expected.txt +++ b/test/statsCases/external/expected.txt @@ -2,6 +2,5 @@ Hash: 86950abf8dcf924d9cc1 Time: Xms Asset Size Chunks Chunk Names main.js 2.77 kB 0 [emitted] main -chunk {0} main.js (main) 59 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/external/index.js 17 bytes {0} [built] - [1] external "test" 42 bytes {0} [not cacheable] \ No newline at end of file + [0] (webpack)/test/statsCases/external/index.js 17 bytes {0} [built] + [1] external "test" 42 bytes {0} [not cacheable] \ No newline at end of file diff --git a/test/statsCases/filter-warnings/expected.txt b/test/statsCases/filter-warnings/expected.txt index 190998e233f..9349f5402f4 100644 --- a/test/statsCases/filter-warnings/expected.txt +++ b/test/statsCases/filter-warnings/expected.txt @@ -4,7 +4,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -23,43 +22,36 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] Child Hash: e4d2b189bb205589ee1e Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -78,7 +70,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -97,7 +88,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -116,7 +106,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -135,7 +124,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] @@ -154,7 +142,6 @@ Child Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main - chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] WARNING in bundle.js from UglifyJs Dropping unused function someRemoteUnUsedFunction1 [./a.js:3,0] diff --git a/test/statsCases/max-modules-default/expected.txt b/test/statsCases/max-modules-default/expected.txt index 6f4233e4bb1..6a690d0b6bc 100644 --- a/test/statsCases/max-modules-default/expected.txt +++ b/test/statsCases/max-modules-default/expected.txt @@ -2,20 +2,19 @@ Hash: 8f4b66734cb63e0581be Time: Xms Asset Size Chunks Chunk Names main.js 5.95 kB 0 [emitted] main -chunk {0} main.js (main) 1.18 kB [entry] [rendered] - [0] (webpack)/test/statsCases/max-modules-default/a.js?1 33 bytes {0} [built] - [1] (webpack)/test/statsCases/max-modules-default/a.js?10 33 bytes {0} [built] - [2] (webpack)/test/statsCases/max-modules-default/a.js?2 33 bytes {0} [built] - [3] (webpack)/test/statsCases/max-modules-default/a.js?3 33 bytes {0} [built] - [4] (webpack)/test/statsCases/max-modules-default/a.js?4 33 bytes {0} [built] - [5] (webpack)/test/statsCases/max-modules-default/a.js?5 33 bytes {0} [built] - [6] (webpack)/test/statsCases/max-modules-default/a.js?6 33 bytes {0} [built] - [7] (webpack)/test/statsCases/max-modules-default/a.js?7 33 bytes {0} [built] - [8] (webpack)/test/statsCases/max-modules-default/a.js?8 33 bytes {0} [built] - [9] (webpack)/test/statsCases/max-modules-default/a.js?9 33 bytes {0} [built] - [20] (webpack)/test/statsCases/max-modules-default/c.js?1 33 bytes {0} [built] - [21] (webpack)/test/statsCases/max-modules-default/c.js?10 33 bytes {0} [built] - [22] (webpack)/test/statsCases/max-modules-default/c.js?2 33 bytes {0} [built] - [23] (webpack)/test/statsCases/max-modules-default/c.js?3 33 bytes {0} [built] - [30] (webpack)/test/statsCases/max-modules-default/index.js 181 bytes {0} [built] - + 16 hidden modules \ No newline at end of file + [0] (webpack)/test/statsCases/max-modules-default/a.js?1 33 bytes {0} [built] + [1] (webpack)/test/statsCases/max-modules-default/a.js?10 33 bytes {0} [built] + [2] (webpack)/test/statsCases/max-modules-default/a.js?2 33 bytes {0} [built] + [3] (webpack)/test/statsCases/max-modules-default/a.js?3 33 bytes {0} [built] + [4] (webpack)/test/statsCases/max-modules-default/a.js?4 33 bytes {0} [built] + [5] (webpack)/test/statsCases/max-modules-default/a.js?5 33 bytes {0} [built] + [6] (webpack)/test/statsCases/max-modules-default/a.js?6 33 bytes {0} [built] + [7] (webpack)/test/statsCases/max-modules-default/a.js?7 33 bytes {0} [built] + [8] (webpack)/test/statsCases/max-modules-default/a.js?8 33 bytes {0} [built] + [9] (webpack)/test/statsCases/max-modules-default/a.js?9 33 bytes {0} [built] + [20] (webpack)/test/statsCases/max-modules-default/c.js?1 33 bytes {0} [built] + [21] (webpack)/test/statsCases/max-modules-default/c.js?10 33 bytes {0} [built] + [22] (webpack)/test/statsCases/max-modules-default/c.js?2 33 bytes {0} [built] + [23] (webpack)/test/statsCases/max-modules-default/c.js?3 33 bytes {0} [built] + [30] (webpack)/test/statsCases/max-modules-default/index.js 181 bytes {0} [built] + + 16 hidden modules \ No newline at end of file diff --git a/test/statsCases/max-modules/expected.txt b/test/statsCases/max-modules/expected.txt index 16a20b5f252..3e33c28bddc 100644 --- a/test/statsCases/max-modules/expected.txt +++ b/test/statsCases/max-modules/expected.txt @@ -2,25 +2,24 @@ Hash: 8f4b66734cb63e0581be Time: Xms Asset Size Chunks Chunk Names main.js 5.95 kB 0 [emitted] main -chunk {0} main.js (main) 1.18 kB [entry] [rendered] - [0] (webpack)/test/statsCases/max-modules/a.js?1 33 bytes {0} [built] - [1] (webpack)/test/statsCases/max-modules/a.js?10 33 bytes {0} [built] - [2] (webpack)/test/statsCases/max-modules/a.js?2 33 bytes {0} [built] - [3] (webpack)/test/statsCases/max-modules/a.js?3 33 bytes {0} [built] - [4] (webpack)/test/statsCases/max-modules/a.js?4 33 bytes {0} [built] - [5] (webpack)/test/statsCases/max-modules/a.js?5 33 bytes {0} [built] - [6] (webpack)/test/statsCases/max-modules/a.js?6 33 bytes {0} [built] - [7] (webpack)/test/statsCases/max-modules/a.js?7 33 bytes {0} [built] - [8] (webpack)/test/statsCases/max-modules/a.js?8 33 bytes {0} [built] - [9] (webpack)/test/statsCases/max-modules/a.js?9 33 bytes {0} [built] - [20] (webpack)/test/statsCases/max-modules/c.js?1 33 bytes {0} [built] - [21] (webpack)/test/statsCases/max-modules/c.js?10 33 bytes {0} [built] - [22] (webpack)/test/statsCases/max-modules/c.js?2 33 bytes {0} [built] - [23] (webpack)/test/statsCases/max-modules/c.js?3 33 bytes {0} [built] - [24] (webpack)/test/statsCases/max-modules/c.js?4 33 bytes {0} [built] - [25] (webpack)/test/statsCases/max-modules/c.js?5 33 bytes {0} [built] - [26] (webpack)/test/statsCases/max-modules/c.js?6 33 bytes {0} [built] - [27] (webpack)/test/statsCases/max-modules/c.js?7 33 bytes {0} [built] - [28] (webpack)/test/statsCases/max-modules/c.js?8 33 bytes {0} [built] - [30] (webpack)/test/statsCases/max-modules/index.js 181 bytes {0} [built] - + 11 hidden modules \ No newline at end of file + [0] (webpack)/test/statsCases/max-modules/a.js?1 33 bytes {0} [built] + [1] (webpack)/test/statsCases/max-modules/a.js?10 33 bytes {0} [built] + [2] (webpack)/test/statsCases/max-modules/a.js?2 33 bytes {0} [built] + [3] (webpack)/test/statsCases/max-modules/a.js?3 33 bytes {0} [built] + [4] (webpack)/test/statsCases/max-modules/a.js?4 33 bytes {0} [built] + [5] (webpack)/test/statsCases/max-modules/a.js?5 33 bytes {0} [built] + [6] (webpack)/test/statsCases/max-modules/a.js?6 33 bytes {0} [built] + [7] (webpack)/test/statsCases/max-modules/a.js?7 33 bytes {0} [built] + [8] (webpack)/test/statsCases/max-modules/a.js?8 33 bytes {0} [built] + [9] (webpack)/test/statsCases/max-modules/a.js?9 33 bytes {0} [built] + [20] (webpack)/test/statsCases/max-modules/c.js?1 33 bytes {0} [built] + [21] (webpack)/test/statsCases/max-modules/c.js?10 33 bytes {0} [built] + [22] (webpack)/test/statsCases/max-modules/c.js?2 33 bytes {0} [built] + [23] (webpack)/test/statsCases/max-modules/c.js?3 33 bytes {0} [built] + [24] (webpack)/test/statsCases/max-modules/c.js?4 33 bytes {0} [built] + [25] (webpack)/test/statsCases/max-modules/c.js?5 33 bytes {0} [built] + [26] (webpack)/test/statsCases/max-modules/c.js?6 33 bytes {0} [built] + [27] (webpack)/test/statsCases/max-modules/c.js?7 33 bytes {0} [built] + [28] (webpack)/test/statsCases/max-modules/c.js?8 33 bytes {0} [built] + [30] (webpack)/test/statsCases/max-modules/index.js 181 bytes {0} [built] + + 11 hidden modules \ No newline at end of file diff --git a/test/statsCases/module-trace-disabled-in-error/expected.txt b/test/statsCases/module-trace-disabled-in-error/expected.txt index 423af5c6e6e..34bb54f0ca5 100644 --- a/test/statsCases/module-trace-disabled-in-error/expected.txt +++ b/test/statsCases/module-trace-disabled-in-error/expected.txt @@ -2,8 +2,7 @@ Hash: 6e950f2e83663cb6e9a6 Time: Xms Asset Size Chunks Chunk Names main.js 2.81 kB 0 [emitted] main -chunk {0} main.js (main) 25 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/module-trace-disabled-in-error/index.js 25 bytes {0} [built] + [0] (webpack)/test/statsCases/module-trace-disabled-in-error/index.js 25 bytes {0} [built] ERROR in (webpack)/test/statsCases/module-trace-disabled-in-error/index.js Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-disabled-in-error' \ No newline at end of file diff --git a/test/statsCases/module-trace-enabled-in-error/expected.txt b/test/statsCases/module-trace-enabled-in-error/expected.txt index edb19409845..d860ba1553f 100644 --- a/test/statsCases/module-trace-enabled-in-error/expected.txt +++ b/test/statsCases/module-trace-enabled-in-error/expected.txt @@ -2,8 +2,7 @@ Hash: 6e950f2e83663cb6e9a6 Time: Xms Asset Size Chunks Chunk Names main.js 2.81 kB 0 [emitted] main -chunk {0} main.js (main) 25 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/module-trace-enabled-in-error/index.js 25 bytes {0} [built] + [0] (webpack)/test/statsCases/module-trace-enabled-in-error/index.js 25 bytes {0} [built] ERROR in (webpack)/test/statsCases/module-trace-enabled-in-error/index.js Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-enabled-in-error' diff --git a/test/statsCases/named-chunks-plugin-async/expected.txt b/test/statsCases/named-chunks-plugin-async/expected.txt index 8cdeb46b613..8e15649558c 100644 --- a/test/statsCases/named-chunks-plugin-async/expected.txt +++ b/test/statsCases/named-chunks-plugin-async/expected.txt @@ -4,9 +4,6 @@ Time: Xms chunk-containing-__a_js.js 266 bytes chunk-containing-__a_js [emitted] chunk-containing-__b_js.js 123 bytes chunk-containing-__b_js [emitted] entry.js 6.07 kB entry [emitted] entry -chunk {chunk-containing-__a_js} chunk-containing-__a_js.js 37 bytes {entry} [rendered] - [2] (webpack)/test/statsCases/named-chunks-plugin-async/modules/a.js 37 bytes {chunk-containing-__a_js} [built] -chunk {chunk-containing-__b_js} chunk-containing-__b_js.js 22 bytes {chunk-containing-__a_js} {entry} [rendered] - [0] (webpack)/test/statsCases/named-chunks-plugin-async/modules/b.js 22 bytes {chunk-containing-__b_js} [built] -chunk {entry} entry.js (entry) 47 bytes [entry] [rendered] - [1] (webpack)/test/statsCases/named-chunks-plugin-async/entry.js 47 bytes {entry} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/named-chunks-plugin-async/modules/b.js 22 bytes {chunk-containing-__b_js} [built] + [1] (webpack)/test/statsCases/named-chunks-plugin-async/entry.js 47 bytes {entry} [built] + [2] (webpack)/test/statsCases/named-chunks-plugin-async/modules/a.js 37 bytes {chunk-containing-__a_js} [built] \ No newline at end of file diff --git a/test/statsCases/named-chunks-plugin/expected.txt b/test/statsCases/named-chunks-plugin/expected.txt index 6fb2abd9417..8bcbb1b883c 100644 --- a/test/statsCases/named-chunks-plugin/expected.txt +++ b/test/statsCases/named-chunks-plugin/expected.txt @@ -4,11 +4,8 @@ Time: Xms entry.js 345 bytes entry [emitted] entry manifest.js 5.86 kB manifest [emitted] manifest vendor.js 397 bytes vendor [emitted] vendor -chunk {entry} entry.js (entry) 94 bytes {vendor} [initial] [rendered] - [./entry.js] (webpack)/test/statsCases/named-chunks-plugin/entry.js 72 bytes {entry} [built] - [./modules/c.js] (webpack)/test/statsCases/named-chunks-plugin/modules/c.js 22 bytes {entry} [built] -chunk {manifest} manifest.js (manifest) 0 bytes [entry] [rendered] -chunk {vendor} vendor.js (vendor) 84 bytes {manifest} [initial] [rendered] - [./modules/a.js] (webpack)/test/statsCases/named-chunks-plugin/modules/a.js 22 bytes {vendor} [built] - [./modules/b.js] (webpack)/test/statsCases/named-chunks-plugin/modules/b.js 22 bytes {vendor} [built] - [0] multi ./modules/a ./modules/b 40 bytes {vendor} [built] \ No newline at end of file + [0] multi ./modules/a ./modules/b 40 bytes {vendor} [built] +[./entry.js] (webpack)/test/statsCases/named-chunks-plugin/entry.js 72 bytes {entry} [built] +[./modules/a.js] (webpack)/test/statsCases/named-chunks-plugin/modules/a.js 22 bytes {vendor} [built] +[./modules/b.js] (webpack)/test/statsCases/named-chunks-plugin/modules/b.js 22 bytes {vendor} [built] +[./modules/c.js] (webpack)/test/statsCases/named-chunks-plugin/modules/c.js 22 bytes {entry} [built] \ No newline at end of file diff --git a/test/statsCases/optimize-chunks/webpack.config.js b/test/statsCases/optimize-chunks/webpack.config.js index aaf6056a2c3..1af7de23048 100644 --- a/test/statsCases/optimize-chunks/webpack.config.js +++ b/test/statsCases/optimize-chunks/webpack.config.js @@ -2,6 +2,9 @@ module.exports = { entry: "./index", stats: { reasons: false, + modules: false, + chunks: true, + chunkModules: true, chunkOrigins: true } }; diff --git a/test/statsCases/performance-disabled/expected.txt b/test/statsCases/performance-disabled/expected.txt index fd629bff505..fa88a94651b 100644 --- a/test/statsCases/performance-disabled/expected.txt +++ b/test/statsCases/performance-disabled/expected.txt @@ -5,13 +5,9 @@ Time: Xms 2.js 204 bytes 2 [emitted] main.js 306 kB 3 [emitted] main Entrypoint main = main.js -chunk {0} 0.js 54 bytes {3} [rendered] - [2] (webpack)/test/statsCases/performance-disabled/c.js 54 bytes {0} [built] -chunk {1} 1.js 22 bytes {3} [rendered] - [1] (webpack)/test/statsCases/performance-disabled/b.js 22 bytes {1} [built] -chunk {2} 2.js 44 bytes {0} [rendered] - [3] (webpack)/test/statsCases/performance-disabled/d.js 22 bytes {2} [built] - [4] (webpack)/test/statsCases/performance-disabled/e.js 22 bytes {2} [built] -chunk {3} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-disabled/a.js 300 kB {3} [built] - [5] (webpack)/test/statsCases/performance-disabled/index.js 52 bytes {3} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/performance-disabled/a.js 300 kB {3} [built] + [1] (webpack)/test/statsCases/performance-disabled/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/performance-disabled/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/performance-disabled/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/performance-disabled/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/performance-disabled/index.js 52 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/performance-error/expected.txt b/test/statsCases/performance-error/expected.txt index 35daf3e1728..fbb37c5d036 100644 --- a/test/statsCases/performance-error/expected.txt +++ b/test/statsCases/performance-error/expected.txt @@ -5,16 +5,12 @@ Time: Xms 2.js 204 bytes 2 [emitted] main.js 306 kB 3 [emitted] [big] main Entrypoint main [big] = main.js -chunk {0} 0.js 54 bytes {3} [rendered] - [2] (webpack)/test/statsCases/performance-error/c.js 54 bytes {0} [built] -chunk {1} 1.js 22 bytes {3} [rendered] - [1] (webpack)/test/statsCases/performance-error/b.js 22 bytes {1} [built] -chunk {2} 2.js 44 bytes {0} [rendered] - [3] (webpack)/test/statsCases/performance-error/d.js 22 bytes {2} [built] - [4] (webpack)/test/statsCases/performance-error/e.js 22 bytes {2} [built] -chunk {3} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-error/a.js 300 kB {3} [built] - [5] (webpack)/test/statsCases/performance-error/index.js 52 bytes {3} [built] + [0] (webpack)/test/statsCases/performance-error/a.js 300 kB {3} [built] + [1] (webpack)/test/statsCases/performance-error/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/performance-error/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/performance-error/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/performance-error/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/performance-error/index.js 52 bytes {3} [built] ERROR in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. diff --git a/test/statsCases/performance-no-async-chunks-shown/expected.txt b/test/statsCases/performance-no-async-chunks-shown/expected.txt index 3437df4c2ea..4436c5e728d 100644 --- a/test/statsCases/performance-no-async-chunks-shown/expected.txt +++ b/test/statsCases/performance-no-async-chunks-shown/expected.txt @@ -4,15 +4,12 @@ Time: Xms main.js 303 kB 1 [emitted] [big] main Entrypoint main [big] = main.js Entrypoint sec = sec.js -chunk {0} sec.js (sec) 114 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/performance-no-async-chunks-shown/b.js 22 bytes {0} {1} [built] - [2] (webpack)/test/statsCases/performance-no-async-chunks-shown/c.js 22 bytes {0} [built] - [3] (webpack)/test/statsCases/performance-no-async-chunks-shown/d.js 22 bytes {0} [built] - [5] (webpack)/test/statsCases/performance-no-async-chunks-shown/index2.js 48 bytes {0} [built] -chunk {1} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-no-async-chunks-shown/b.js 22 bytes {0} {1} [built] - [1] (webpack)/test/statsCases/performance-no-async-chunks-shown/a.js 300 kB {1} [built] - [4] (webpack)/test/statsCases/performance-no-async-chunks-shown/index.js 32 bytes {1} [built] + [0] (webpack)/test/statsCases/performance-no-async-chunks-shown/b.js 22 bytes {0} {1} [built] + [1] (webpack)/test/statsCases/performance-no-async-chunks-shown/a.js 300 kB {1} [built] + [2] (webpack)/test/statsCases/performance-no-async-chunks-shown/c.js 22 bytes {0} [built] + [3] (webpack)/test/statsCases/performance-no-async-chunks-shown/d.js 22 bytes {0} [built] + [4] (webpack)/test/statsCases/performance-no-async-chunks-shown/index.js 32 bytes {1} [built] + [5] (webpack)/test/statsCases/performance-no-async-chunks-shown/index2.js 48 bytes {0} [built] WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. diff --git a/test/statsCases/performance-no-hints/expected.txt b/test/statsCases/performance-no-hints/expected.txt index 1fd21e4050a..040e1cf1637 100644 --- a/test/statsCases/performance-no-hints/expected.txt +++ b/test/statsCases/performance-no-hints/expected.txt @@ -5,13 +5,9 @@ Time: Xms 2.js 204 bytes 2 [emitted] main.js 306 kB 3 [emitted] [big] main Entrypoint main [big] = main.js -chunk {0} 0.js 54 bytes {3} [rendered] - [2] (webpack)/test/statsCases/performance-no-hints/c.js 54 bytes {0} [built] -chunk {1} 1.js 22 bytes {3} [rendered] - [1] (webpack)/test/statsCases/performance-no-hints/b.js 22 bytes {1} [built] -chunk {2} 2.js 44 bytes {0} [rendered] - [3] (webpack)/test/statsCases/performance-no-hints/d.js 22 bytes {2} [built] - [4] (webpack)/test/statsCases/performance-no-hints/e.js 22 bytes {2} [built] -chunk {3} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-no-hints/a.js 300 kB {3} [built] - [5] (webpack)/test/statsCases/performance-no-hints/index.js 52 bytes {3} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/performance-no-hints/a.js 300 kB {3} [built] + [1] (webpack)/test/statsCases/performance-no-hints/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/performance-no-hints/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/performance-no-hints/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/performance-no-hints/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/performance-no-hints/index.js 52 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/performance-oversize-limit-error/expected.txt b/test/statsCases/performance-oversize-limit-error/expected.txt index 92f30846f77..200eedb0741 100644 --- a/test/statsCases/performance-oversize-limit-error/expected.txt +++ b/test/statsCases/performance-oversize-limit-error/expected.txt @@ -4,12 +4,9 @@ Time: Xms main.js 303 kB 1 [emitted] [big] main Entrypoint main [big] = main.js Entrypoint sec [big] = sec.js -chunk {0} sec.js (sec) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-oversize-limit-error/a.js 300 kB {0} {1} [built] - [2] (webpack)/test/statsCases/performance-oversize-limit-error/index2.js 16 bytes {0} [built] -chunk {1} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/performance-oversize-limit-error/a.js 300 kB {0} {1} [built] - [1] (webpack)/test/statsCases/performance-oversize-limit-error/index.js 16 bytes {1} [built] + [0] (webpack)/test/statsCases/performance-oversize-limit-error/a.js 300 kB {0} {1} [built] + [1] (webpack)/test/statsCases/performance-oversize-limit-error/index.js 16 bytes {1} [built] + [2] (webpack)/test/statsCases/performance-oversize-limit-error/index2.js 16 bytes {0} [built] ERROR in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. diff --git a/test/statsCases/preset-detailed/a.js b/test/statsCases/preset-detailed/a.js new file mode 100644 index 00000000000..6cd1d0075d4 --- /dev/null +++ b/test/statsCases/preset-detailed/a.js @@ -0,0 +1 @@ +module.exports = "a"; diff --git a/test/statsCases/preset-detailed/b.js b/test/statsCases/preset-detailed/b.js new file mode 100644 index 00000000000..dfbbeb621fa --- /dev/null +++ b/test/statsCases/preset-detailed/b.js @@ -0,0 +1 @@ +module.exports = "b"; diff --git a/test/statsCases/preset-detailed/c.js b/test/statsCases/preset-detailed/c.js new file mode 100644 index 00000000000..84bdba76f12 --- /dev/null +++ b/test/statsCases/preset-detailed/c.js @@ -0,0 +1 @@ +require.ensure(["./d", "./e"], function(require) {}); diff --git a/test/statsCases/preset-detailed/d.js b/test/statsCases/preset-detailed/d.js new file mode 100644 index 00000000000..0a281018ca1 --- /dev/null +++ b/test/statsCases/preset-detailed/d.js @@ -0,0 +1 @@ +module.exports = "d"; diff --git a/test/statsCases/preset-detailed/e.js b/test/statsCases/preset-detailed/e.js new file mode 100644 index 00000000000..7884d62f732 --- /dev/null +++ b/test/statsCases/preset-detailed/e.js @@ -0,0 +1 @@ +module.exports = "e"; diff --git a/test/statsCases/preset-detailed/expected.txt b/test/statsCases/preset-detailed/expected.txt new file mode 100644 index 00000000000..d4509865c4a --- /dev/null +++ b/test/statsCases/preset-detailed/expected.txt @@ -0,0 +1,22 @@ +Hash: c5a6856b43905ae12f17 +Time: Xms + Asset Size Chunks Chunk Names + 0.js 238 bytes 0 [emitted] + 1.js 108 bytes 1 [emitted] + 2.js 204 bytes 2 [emitted] +main.js 6.18 kB 3 [emitted] main +Entrypoint main = main.js +chunk {0} 0.js 54 bytes {3} [rendered] + > [5] (webpack)/test/statsCases/preset-detailed/index.js 3:0-16 +chunk {1} 1.js 22 bytes {3} [rendered] + > [5] (webpack)/test/statsCases/preset-detailed/index.js 2:0-16 +chunk {2} 2.js 44 bytes {0} [rendered] + > [2] (webpack)/test/statsCases/preset-detailed/c.js 1:0-52 +chunk {3} main.js (main) 73 bytes [entry] [rendered] + > main [5] (webpack)/test/statsCases/preset-detailed/index.js + [0] (webpack)/test/statsCases/preset-detailed/a.js 22 bytes {3} [depth 1] [built] + [1] (webpack)/test/statsCases/preset-detailed/b.js 22 bytes {1} [depth 1] [built] + [2] (webpack)/test/statsCases/preset-detailed/c.js 54 bytes {0} [depth 1] [built] + [3] (webpack)/test/statsCases/preset-detailed/d.js 22 bytes {2} [depth 2] [built] + [4] (webpack)/test/statsCases/preset-detailed/e.js 22 bytes {2} [depth 2] [built] + [5] (webpack)/test/statsCases/preset-detailed/index.js 51 bytes {3} [depth 0] [built] \ No newline at end of file diff --git a/test/statsCases/preset-detailed/index.js b/test/statsCases/preset-detailed/index.js new file mode 100644 index 00000000000..86b979b0de8 --- /dev/null +++ b/test/statsCases/preset-detailed/index.js @@ -0,0 +1,3 @@ +require("./a"); +require(["./b"]); +require(["./c"]); \ No newline at end of file diff --git a/test/statsCases/preset-detailed/webpack.config.js b/test/statsCases/preset-detailed/webpack.config.js new file mode 100644 index 00000000000..0557c040598 --- /dev/null +++ b/test/statsCases/preset-detailed/webpack.config.js @@ -0,0 +1,4 @@ +module.exports = { + entry: "./index", + stats: "detailed" +}; diff --git a/test/statsCases/preset-minimal-simple/expected.txt b/test/statsCases/preset-minimal-simple/expected.txt index 21bb031a2c4..2ba6dec1300 100644 --- a/test/statsCases/preset-minimal-simple/expected.txt +++ b/test/statsCases/preset-minimal-simple/expected.txt @@ -1 +1 @@ -chunk {0} main.js (main) 0 bytes [entry] [rendered] \ No newline at end of file + 1 module \ No newline at end of file diff --git a/test/statsCases/preset-minimal/expected.txt b/test/statsCases/preset-minimal/expected.txt index b5228183ea6..fb8d2244ffb 100644 --- a/test/statsCases/preset-minimal/expected.txt +++ b/test/statsCases/preset-minimal/expected.txt @@ -1,4 +1 @@ -chunk {0} 0.js 54 bytes {3} [rendered] -chunk {1} 1.js 22 bytes {3} [rendered] -chunk {2} 2.js 44 bytes {0} [rendered] -chunk {3} main.js (main) 73 bytes [entry] [rendered] \ No newline at end of file + 6 modules \ No newline at end of file diff --git a/test/statsCases/preset-mixed-array/expected.txt b/test/statsCases/preset-mixed-array/expected.txt index 3665b12d186..e355ec4b615 100644 --- a/test/statsCases/preset-mixed-array/expected.txt +++ b/test/statsCases/preset-mixed-array/expected.txt @@ -1,4 +1,5 @@ Child minimal: - chunk {0} main.js (main) 8 bytes [entry] [rendered] + 1 module Child verbose: - Entrypoint main = main.js \ No newline at end of file + Entrypoint main = main.js + [0] (webpack)/test/statsCases/preset-mixed-array/index.js 8 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt index 3ccf98a4235..a25857c2cf4 100644 --- a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt +++ b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/expected.txt @@ -8,16 +8,12 @@ Time: Xms 1.js.map 250 bytes 1 [emitted] 2.js.map 405 bytes 2 [emitted] main.js.map 1.81 MB 3 [emitted] main -chunk {0} 0.js, 0.js.map 54 bytes {3} [rendered] - [2] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/c.js 54 bytes {0} [built] -chunk {1} 1.js, 1.js.map 22 bytes {3} [rendered] - [1] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/b.js 22 bytes {1} [built] -chunk {2} 2.js, 2.js.map 44 bytes {0} [rendered] - [3] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/d.js 22 bytes {2} [built] - [4] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/e.js 22 bytes {2} [built] -chunk {3} main.js, main.js.map (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/a.js 300 kB {3} [built] - [5] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/index.js 52 bytes {3} [built] + [0] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/a.js 300 kB {3} [built] + [1] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/index.js 52 bytes {3} [built] WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. diff --git a/test/statsCases/preset-normal-performance/expected.txt b/test/statsCases/preset-normal-performance/expected.txt index 044000957d7..73861de5ac9 100644 --- a/test/statsCases/preset-normal-performance/expected.txt +++ b/test/statsCases/preset-normal-performance/expected.txt @@ -4,16 +4,12 @@ Time: Xms 1.js 108 bytes 1 [emitted] 2.js 204 bytes 2 [emitted] main.js 306 kB 3 [emitted] [big] main -chunk {0} 0.js 54 bytes {3} [rendered] - [2] (webpack)/test/statsCases/preset-normal-performance/c.js 54 bytes {0} [built] -chunk {1} 1.js 22 bytes {3} [rendered] - [1] (webpack)/test/statsCases/preset-normal-performance/b.js 22 bytes {1} [built] -chunk {2} 2.js 44 bytes {0} [rendered] - [3] (webpack)/test/statsCases/preset-normal-performance/d.js 22 bytes {2} [built] - [4] (webpack)/test/statsCases/preset-normal-performance/e.js 22 bytes {2} [built] -chunk {3} main.js (main) 300 kB [entry] [rendered] - [0] (webpack)/test/statsCases/preset-normal-performance/a.js 300 kB {3} [built] - [5] (webpack)/test/statsCases/preset-normal-performance/index.js 52 bytes {3} [built] + [0] (webpack)/test/statsCases/preset-normal-performance/a.js 300 kB {3} [built] + [1] (webpack)/test/statsCases/preset-normal-performance/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/preset-normal-performance/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/preset-normal-performance/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/preset-normal-performance/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/preset-normal-performance/index.js 52 bytes {3} [built] WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB). This can impact web performance. diff --git a/test/statsCases/preset-normal/expected.txt b/test/statsCases/preset-normal/expected.txt index a10567f8b65..270664c4b98 100644 --- a/test/statsCases/preset-normal/expected.txt +++ b/test/statsCases/preset-normal/expected.txt @@ -1,6 +1,13 @@ Hash: c5a6856b43905ae12f17 Time: Xms -chunk {0} 0.js 54 bytes {3} [rendered] -chunk {1} 1.js 22 bytes {3} [rendered] -chunk {2} 2.js 44 bytes {0} [rendered] -chunk {3} main.js (main) 73 bytes [entry] [rendered] \ No newline at end of file + Asset Size Chunks Chunk Names + 0.js 238 bytes 0 [emitted] + 1.js 108 bytes 1 [emitted] + 2.js 204 bytes 2 [emitted] +main.js 6.18 kB 3 [emitted] main + [0] (webpack)/test/statsCases/preset-normal/a.js 22 bytes {3} [built] + [1] (webpack)/test/statsCases/preset-normal/b.js 22 bytes {1} [built] + [2] (webpack)/test/statsCases/preset-normal/c.js 54 bytes {0} [built] + [3] (webpack)/test/statsCases/preset-normal/d.js 22 bytes {2} [built] + [4] (webpack)/test/statsCases/preset-normal/e.js 22 bytes {2} [built] + [5] (webpack)/test/statsCases/preset-normal/index.js 51 bytes {3} [built] \ No newline at end of file diff --git a/test/statsCases/preset-verbose/expected.txt b/test/statsCases/preset-verbose/expected.txt index 700ee8cd8df..b1da9cce5f3 100644 --- a/test/statsCases/preset-verbose/expected.txt +++ b/test/statsCases/preset-verbose/expected.txt @@ -7,14 +7,17 @@ Time: Xms main.js 6.18 kB 3 [emitted] main Entrypoint main = main.js chunk {0} 0.js 54 bytes {3} [rendered] + > [5] (webpack)/test/statsCases/preset-verbose/index.js 3:0-16 [2] (webpack)/test/statsCases/preset-verbose/c.js 54 bytes {0} [depth 1] [built] amd require ./c [5] (webpack)/test/statsCases/preset-verbose/index.js 3:0-16 [] -> factory:Xms building:Xms = Xms chunk {1} 1.js 22 bytes {3} [rendered] + > [5] (webpack)/test/statsCases/preset-verbose/index.js 2:0-16 [1] (webpack)/test/statsCases/preset-verbose/b.js 22 bytes {1} [depth 1] [built] amd require ./b [5] (webpack)/test/statsCases/preset-verbose/index.js 2:0-16 [] -> factory:Xms building:Xms = Xms chunk {2} 2.js 44 bytes {0} [rendered] + > [2] (webpack)/test/statsCases/preset-verbose/c.js 1:0-52 [3] (webpack)/test/statsCases/preset-verbose/d.js 22 bytes {2} [depth 2] [built] require.ensure item ./d [2] (webpack)/test/statsCases/preset-verbose/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms @@ -22,6 +25,7 @@ chunk {2} 2.js 44 bytes {0} [rendered] require.ensure item ./e [2] (webpack)/test/statsCases/preset-verbose/c.js 1:0-52 [] -> factory:Xms building:Xms = Xms chunk {3} main.js (main) 73 bytes [entry] [rendered] + > main [5] (webpack)/test/statsCases/preset-verbose/index.js [0] (webpack)/test/statsCases/preset-verbose/a.js 22 bytes {3} [depth 1] [built] cjs require ./a [5] (webpack)/test/statsCases/preset-verbose/index.js 1:0-14 [] -> factory:Xms building:Xms = Xms diff --git a/test/statsCases/resolve-plugin-context/expected.txt b/test/statsCases/resolve-plugin-context/expected.txt index fdf7730374d..894a77d6e34 100644 --- a/test/statsCases/resolve-plugin-context/expected.txt +++ b/test/statsCases/resolve-plugin-context/expected.txt @@ -2,7 +2,6 @@ Hash: 94e1d97f3e1cf37e753f Time: Xms Asset Size Chunks Chunk Names bundle.js 3.04 kB 0 [emitted] main -chunk {0} bundle.js (main) 80 bytes [entry] [rendered] [0] (webpack)/test/statsCases/resolve-plugin-context/~/xyz/index.js 0 bytes {0} [built] [1] (webpack)/test/statsCases/resolve-plugin-context/index.js 48 bytes {0} [built] [2] (webpack)/test/statsCases/resolve-plugin-context/~/abc/index.js 16 bytes {0} [built] diff --git a/test/statsCases/reverse-sort-modules/expected.txt b/test/statsCases/reverse-sort-modules/expected.txt index bf4a490313e..ad9bf76993b 100644 --- a/test/statsCases/reverse-sort-modules/expected.txt +++ b/test/statsCases/reverse-sort-modules/expected.txt @@ -2,25 +2,24 @@ Hash: 8f4b66734cb63e0581be Time: Xms Asset Size Chunks Chunk Names main.js 5.95 kB 0 [emitted] main -chunk {0} main.js (main) 1.18 kB [entry] [rendered] - [30] (webpack)/test/statsCases/reverse-sort-modules/index.js 181 bytes {0} [built] - [28] (webpack)/test/statsCases/reverse-sort-modules/c.js?8 33 bytes {0} [built] - [27] (webpack)/test/statsCases/reverse-sort-modules/c.js?7 33 bytes {0} [built] - [26] (webpack)/test/statsCases/reverse-sort-modules/c.js?6 33 bytes {0} [built] - [25] (webpack)/test/statsCases/reverse-sort-modules/c.js?5 33 bytes {0} [built] - [24] (webpack)/test/statsCases/reverse-sort-modules/c.js?4 33 bytes {0} [built] - [23] (webpack)/test/statsCases/reverse-sort-modules/c.js?3 33 bytes {0} [built] - [22] (webpack)/test/statsCases/reverse-sort-modules/c.js?2 33 bytes {0} [built] - [21] (webpack)/test/statsCases/reverse-sort-modules/c.js?10 33 bytes {0} [built] - [20] (webpack)/test/statsCases/reverse-sort-modules/c.js?1 33 bytes {0} [built] - [9] (webpack)/test/statsCases/reverse-sort-modules/a.js?9 33 bytes {0} [built] - [8] (webpack)/test/statsCases/reverse-sort-modules/a.js?8 33 bytes {0} [built] - [7] (webpack)/test/statsCases/reverse-sort-modules/a.js?7 33 bytes {0} [built] - [6] (webpack)/test/statsCases/reverse-sort-modules/a.js?6 33 bytes {0} [built] - [5] (webpack)/test/statsCases/reverse-sort-modules/a.js?5 33 bytes {0} [built] - [4] (webpack)/test/statsCases/reverse-sort-modules/a.js?4 33 bytes {0} [built] - [3] (webpack)/test/statsCases/reverse-sort-modules/a.js?3 33 bytes {0} [built] - [2] (webpack)/test/statsCases/reverse-sort-modules/a.js?2 33 bytes {0} [built] - [1] (webpack)/test/statsCases/reverse-sort-modules/a.js?10 33 bytes {0} [built] - [0] (webpack)/test/statsCases/reverse-sort-modules/a.js?1 33 bytes {0} [built] - + 11 hidden modules \ No newline at end of file + [30] (webpack)/test/statsCases/reverse-sort-modules/index.js 181 bytes {0} [built] + [28] (webpack)/test/statsCases/reverse-sort-modules/c.js?8 33 bytes {0} [built] + [27] (webpack)/test/statsCases/reverse-sort-modules/c.js?7 33 bytes {0} [built] + [26] (webpack)/test/statsCases/reverse-sort-modules/c.js?6 33 bytes {0} [built] + [25] (webpack)/test/statsCases/reverse-sort-modules/c.js?5 33 bytes {0} [built] + [24] (webpack)/test/statsCases/reverse-sort-modules/c.js?4 33 bytes {0} [built] + [23] (webpack)/test/statsCases/reverse-sort-modules/c.js?3 33 bytes {0} [built] + [22] (webpack)/test/statsCases/reverse-sort-modules/c.js?2 33 bytes {0} [built] + [21] (webpack)/test/statsCases/reverse-sort-modules/c.js?10 33 bytes {0} [built] + [20] (webpack)/test/statsCases/reverse-sort-modules/c.js?1 33 bytes {0} [built] + [9] (webpack)/test/statsCases/reverse-sort-modules/a.js?9 33 bytes {0} [built] + [8] (webpack)/test/statsCases/reverse-sort-modules/a.js?8 33 bytes {0} [built] + [7] (webpack)/test/statsCases/reverse-sort-modules/a.js?7 33 bytes {0} [built] + [6] (webpack)/test/statsCases/reverse-sort-modules/a.js?6 33 bytes {0} [built] + [5] (webpack)/test/statsCases/reverse-sort-modules/a.js?5 33 bytes {0} [built] + [4] (webpack)/test/statsCases/reverse-sort-modules/a.js?4 33 bytes {0} [built] + [3] (webpack)/test/statsCases/reverse-sort-modules/a.js?3 33 bytes {0} [built] + [2] (webpack)/test/statsCases/reverse-sort-modules/a.js?2 33 bytes {0} [built] + [1] (webpack)/test/statsCases/reverse-sort-modules/a.js?10 33 bytes {0} [built] + [0] (webpack)/test/statsCases/reverse-sort-modules/a.js?1 33 bytes {0} [built] + + 11 hidden modules \ No newline at end of file diff --git a/test/statsCases/separate-css-bundle/expected.txt b/test/statsCases/separate-css-bundle/expected.txt index 5cb419e5c34..a38f3d334c0 100644 --- a/test/statsCases/separate-css-bundle/expected.txt +++ b/test/statsCases/separate-css-bundle/expected.txt @@ -5,23 +5,25 @@ Child Asset Size Chunks Chunk Names c7ab11336573e45dc51e.js 2.78 kB 0 [emitted] main c815cf440254d4f3bba4e7041db00a28.css 26 bytes 0 [emitted] main - chunk {0} c7ab11336573e45dc51e.js, c815cf440254d4f3bba4e7041db00a28.css (main) 64 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/separate-css-bundle/a/file.css 41 bytes {0} [built] - [1] (webpack)/test/statsCases/separate-css-bundle/a/index.js 23 bytes {0} [built] + [0] (webpack)/test/statsCases/separate-css-bundle/a/file.css 41 bytes {0} [built] + [1] (webpack)/test/statsCases/separate-css-bundle/a/index.js 23 bytes {0} [built] + [2] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 190 bytes [built] + [3] (webpack)/~/css-loader/lib/css-base.js 1.46 kB [built] + [4] (webpack)/~/style-loader/addStyles.js 6.91 kB [built] Child extract-text-webpack-plugin: - chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered] - [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 190 bytes {0} [built] - [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] + [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 190 bytes {0} [built] + [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] Child Hash: 1139e89514abc13454ce Time: Xms Asset Size Chunks Chunk Names c7ab11336573e45dc51e.js 2.78 kB 0 [emitted] main a3f385680aef7a9bb2a517699532cc34.css 28 bytes 0 [emitted] main - chunk {0} c7ab11336573e45dc51e.js, a3f385680aef7a9bb2a517699532cc34.css (main) 64 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/separate-css-bundle/b/file.css 41 bytes {0} [built] - [1] (webpack)/test/statsCases/separate-css-bundle/b/index.js 23 bytes {0} [built] + [0] (webpack)/test/statsCases/separate-css-bundle/b/file.css 41 bytes {0} [built] + [1] (webpack)/test/statsCases/separate-css-bundle/b/index.js 23 bytes {0} [built] + [2] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 192 bytes [built] + [3] (webpack)/~/css-loader/lib/css-base.js 1.46 kB [built] + [4] (webpack)/~/style-loader/addStyles.js 6.91 kB [built] Child extract-text-webpack-plugin: - chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered] - [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 192 bytes {0} [built] - [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] \ No newline at end of file + [0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 192 bytes {0} [built] + [1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built] \ No newline at end of file diff --git a/test/statsCases/simple-more-info/expected.txt b/test/statsCases/simple-more-info/expected.txt index 2058e7a0db4..0bb1ad4df42 100644 --- a/test/statsCases/simple-more-info/expected.txt +++ b/test/statsCases/simple-more-info/expected.txt @@ -2,9 +2,5 @@ Hash: 0bd4f09244f0e8c60354 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.63 kB 0 [emitted] main -chunk {0} bundle.js (main) 0 bytes [entry] [rendered] - > main [0] (webpack)/test/statsCases/simple-more-info/index.js - [0] (webpack)/test/statsCases/simple-more-info/index.js 0 bytes {0} [built] - factory:Xms building:Xms = Xms [0] (webpack)/test/statsCases/simple-more-info/index.js 0 bytes {0} [built] factory:Xms building:Xms = Xms \ No newline at end of file diff --git a/test/statsCases/simple/expected.txt b/test/statsCases/simple/expected.txt index 71893b16128..4aab0e80572 100644 --- a/test/statsCases/simple/expected.txt +++ b/test/statsCases/simple/expected.txt @@ -2,5 +2,4 @@ Hash: 0bd4f09244f0e8c60354 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.63 kB 0 [emitted] main -chunk {0} bundle.js (main) 0 bytes [entry] [rendered] - [0] (webpack)/test/statsCases/simple/index.js 0 bytes {0} [built] \ No newline at end of file + [0] (webpack)/test/statsCases/simple/index.js 0 bytes {0} [built] \ No newline at end of file diff --git a/test/statsCases/tree-shaking/expected.txt b/test/statsCases/tree-shaking/expected.txt index a6b3bed4a4d..e87e635497d 100644 --- a/test/statsCases/tree-shaking/expected.txt +++ b/test/statsCases/tree-shaking/expected.txt @@ -2,7 +2,6 @@ Hash: 347e6d2384c1a580ac4d Time: Xms Asset Size Chunks Chunk Names bundle.js 7.49 kB 0 [emitted] main -chunk {0} bundle.js (main) 588 bytes [entry] [rendered] [0] (webpack)/test/statsCases/tree-shaking/a.js 13 bytes {0} [built] [exports: a] [only some exports used: a] diff --git a/test/statsCases/warnings-uglifyjs/expected.txt b/test/statsCases/warnings-uglifyjs/expected.txt index 2a36b18a4cc..5c5ef880e9c 100644 --- a/test/statsCases/warnings-uglifyjs/expected.txt +++ b/test/statsCases/warnings-uglifyjs/expected.txt @@ -2,7 +2,6 @@ Hash: 4beee256fa6b8f69eae8 Time: Xms Asset Size Chunks Chunk Names bundle.js 2.24 kB 0 [emitted] main -chunk {0} bundle.js (main) 1.04 kB [entry] [rendered] [0] (webpack)/buildin/module.js 495 bytes {0} [built] [1] (webpack)/test/statsCases/warnings-uglifyjs/a.js 249 bytes {0} [built] [2] (webpack)/test/statsCases/warnings-uglifyjs/index.js 299 bytes {0} [built]