diff --git a/_SETUP.md b/_SETUP.md index 8c080252e..ebd501013 100644 --- a/_SETUP.md +++ b/_SETUP.md @@ -51,6 +51,12 @@ or in watch mode yarn test:unit --watch ``` +### To update Jest snapshots use + +```bash +yarn test:update-snapshots +``` + ### To run code formatter (prettier) run ```bash diff --git a/bin/webpack.js b/bin/webpack.js index 389bc9527..a34fba26b 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -47,6 +47,7 @@ const isInstalled = packageName => { * @typedef {Object} CliOption * @property {string} name display name * @property {string} package npm package name + * @property {string} binName name of the executable file * @property {string} alias shortcut for choice * @property {boolean} installed currently installed? * @property {string} url homepage @@ -58,6 +59,7 @@ const CLIs = [ { name: "webpack-cli", package: "webpack-cli", + binName: "webpack-cli", alias: "cli", installed: isInstalled("webpack-cli"), url: "https://github.com/webpack/webpack-cli", @@ -66,6 +68,7 @@ const CLIs = [ { name: "webpack-command", package: "webpack-command", + binName: "webpack-command", alias: "command", installed: isInstalled("webpack-command"), url: "https://github.com/webpack-contrib/webpack-command", @@ -154,7 +157,10 @@ if (installedClis.length === 0) { }); }); } else if (installedClis.length === 1) { - require(installedClis[0].package); // eslint-disable-line + const path = require("path"); + const pkgPath = require.resolve(`${installedClis[0].package}/package.json`); + const pkg = require(pkgPath); // eslint-disable-line + require(path.resolve(path.dirname(pkgPath), pkg.bin[installedClis[0].binName])); // eslint-disable-line } else { console.warn( `You have installed ${installedClis diff --git a/examples/dll-app-and-vendor/0-vendor/README.md b/examples/dll-app-and-vendor/0-vendor/README.md index 0db675ca8..7d737145f 100644 --- a/examples/dll-app-and-vendor/0-vendor/README.md +++ b/examples/dll-app-and-vendor/0-vendor/README.md @@ -4,7 +4,7 @@ It's built separately from the app part. The vendors dll is only built when the The DllPlugin in combination with the `output.library` option exposes the internal require function as global variable in the target environment. -A manifest is creates which includes mappings from module names to internal ids. +A manifest is created which includes mappings from module names to internal ids. ### webpack.config.js diff --git a/examples/dll-app-and-vendor/0-vendor/template.md b/examples/dll-app-and-vendor/0-vendor/template.md index 662ea88e9..358db39d4 100644 --- a/examples/dll-app-and-vendor/0-vendor/template.md +++ b/examples/dll-app-and-vendor/0-vendor/template.md @@ -4,7 +4,7 @@ It's built separately from the app part. The vendors dll is only built when the The DllPlugin in combination with the `output.library` option exposes the internal require function as global variable in the target environment. -A manifest is creates which includes mappings from module names to internal ids. +A manifest is created which includes mappings from module names to internal ids. ### webpack.config.js diff --git a/lib/ChunkGroup.js b/lib/ChunkGroup.js index c5ac660bb..48c0ef471 100644 --- a/lib/ChunkGroup.js +++ b/lib/ChunkGroup.js @@ -70,6 +70,12 @@ class ChunkGroup { this.chunks = []; /** @type {OriginRecord[]} */ this.origins = []; + /** Indicies in top-down order */ + /** @private @type {Map} */ + this._moduleIndicies = new Map(); + /** Indicies in bottom-up order */ + /** @private @type {Map} */ + this._moduleIndicies2 = new Map(); } /** @@ -440,6 +446,44 @@ class ChunkGroup { return result; } + /** + * Sets the top-down index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex(module, index) { + this._moduleIndicies.set(module, index); + } + + /** + * Gets the top-down index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex(module) { + return this._moduleIndicies.get(module); + } + + /** + * Sets the bottom-up index of a module in this ChunkGroup + * @param {Module} module module for which the index should be set + * @param {number} index the index of the module + * @returns {void} + */ + setModuleIndex2(module, index) { + this._moduleIndicies2.set(module, index); + } + + /** + * Gets the bottom-up index of a module in this ChunkGroup + * @param {Module} module the module + * @returns {number} index + */ + getModuleIndex2(module) { + return this._moduleIndicies2.get(module); + } + checkConstraints() { const chunk = this; for (const child of chunk._children) { diff --git a/lib/Compilation.js b/lib/Compilation.js index f06d8a2dd..eb7c2d982 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -34,6 +34,10 @@ const Queue = require("./util/Queue"); const SortableSet = require("./util/SortableSet"); const GraphHelpers = require("./GraphHelpers"); +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./DependenciesBlock")} DependenciesBlock */ +/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ + const byId = (a, b) => { if (a.id < b.id) return -1; if (a.id > b.id) return 1; @@ -234,8 +238,6 @@ class Compilation { this._modules = new Map(); this.cache = null; this.records = null; - this.nextFreeModuleIndex = undefined; - this.nextFreeModuleIndex2 = undefined; this.additionalChunkAssets = []; this.assets = {}; this.errors = []; @@ -845,8 +847,6 @@ class Compilation { } this.hooks.afterOptimizeDependencies.call(this.modules); - this.nextFreeModuleIndex = 0; - this.nextFreeModuleIndex2 = 0; for (const preparedEntrypoint of this._preparedEntrypoints) { const module = preparedEntrypoint.module; const name = preparedEntrypoint.name; @@ -864,7 +864,6 @@ class Compilation { chunk.entryModule = module; chunk.name = name; - this.assignIndex(module); this.assignDepth(module); } this.processDependenciesBlocksForChunkGroups(this.chunkGroups.slice()); @@ -1013,6 +1012,13 @@ class Compilation { } } + /** + * @param {TODO} groupOptions options for the chunk group + * @param {Module} module the module the references the chunk group + * @param {TODO} loc the location from with the chunk group is reference (inside of module) + * @param {string} request the request from which the the chunk group is referenced + * @returns {ChunkGroup} the new or existing chunk group + */ addChunkInGroup(groupOptions, module, loc, request) { if (typeof groupOptions === "string") { groupOptions = { name: groupOptions }; @@ -1056,70 +1062,6 @@ class Compilation { return chunk; } - assignIndex(module) { - const assignIndexToModule = module => { - // enter module - if (typeof module.index !== "number") { - module.index = this.nextFreeModuleIndex++; - - // leave module - queue.push(() => (module.index2 = this.nextFreeModuleIndex2++)); - - // enter it as block - assignIndexToDependencyBlock(module); - } - }; - - const assignIndexToDependency = dependency => { - if (dependency.module) { - queue.push(() => assignIndexToModule(dependency.module)); - } - }; - - const assignIndexToDependencyBlock = block => { - let allDependencies = []; - - const iteratorDependency = d => allDependencies.push(d); - - const iteratorBlock = b => - queue.push(() => assignIndexToDependencyBlock(b)); - - if (block.variables) { - iterationBlockVariable(block.variables, iteratorDependency); - } - - if (block.dependencies) { - iterationOfArrayCallback(block.dependencies, iteratorDependency); - } - if (block.blocks) { - const blocks = block.blocks; - let indexBlock = blocks.length; - while (indexBlock--) { - iteratorBlock(blocks[indexBlock]); - } - } - - let indexAll = allDependencies.length; - while (indexAll--) { - iteratorAllDependencies(allDependencies[indexAll]); - } - }; - - const queue = [ - () => { - assignIndexToModule(module); - } - ]; - - const iteratorAllDependencies = d => { - queue.push(() => assignIndexToDependency(d)); - }; - - while (queue.length) { - queue.pop()(); - } - } - assignDepth(module) { const queue = new Set([module]); let depth; @@ -1162,7 +1104,12 @@ class Compilation { } } - // This method creates the Chunk graph from the Module graph + /** + * This method creates the Chunk graph from the Module graph + * @private + * @param {TODO[]} inputChunkGroups chunk groups which are processed + * @returns {void} + */ processDependenciesBlocksForChunkGroups(inputChunkGroups) { // Process is splitting into two parts: // Part one traverse the module graph and builds a very basic chunks graph @@ -1172,10 +1119,12 @@ class Compilation { // eachother and Blocks with Chunks. It stops traversing when all modules // for a chunk are already available. So it doesn't connect unneeded chunks. - const chunkDependencies = new Map(); // Map> + /** @type {Map} */ + const chunkDependencies = new Map(); const allCreatedChunkGroups = new Set(); // PREPARE + /** @type {Map} */ const blockInfoMap = new Map(); const iteratorDependency = d => { @@ -1202,7 +1151,15 @@ class Compilation { blockQueue.push(b); }; - let block, blockQueue, blockInfoModules, blockInfoBlocks; + /** @type {DependenciesBlock} */ + let block; + /** @type {TODO} */ + let blockQueue; + /** @type {Set} */ + let blockInfoModules; + /** @type {TODO[]} */ + let blockInfoBlocks; + for (const module of this.modules) { blockQueue = [module]; while (blockQueue.length > 0) { @@ -1223,7 +1180,7 @@ class Compilation { } const blockInfo = { - modules: blockInfoModules, + modules: Array.from(blockInfoModules), blocks: blockInfoBlocks }; blockInfoMap.set(block, blockInfo); @@ -1232,15 +1189,49 @@ class Compilation { // PART ONE + /** @type {Map} */ + const chunkGroupCounters = new Map(); + for (const chunkGroup of inputChunkGroups) { + chunkGroupCounters.set(chunkGroup, { index: 0, index2: 0 }); + } + + let nextFreeModuleIndex = 0; + let nextFreeModuleIndex2 = 0; + + /** @type {Map} */ const blockChunkGroups = new Map(); - // Start with the provided modules/chunks - const queue = inputChunkGroups.map(chunkGroup => ({ + const ADD_AND_ENTER_MODULE = 0; + const ENTER_MODULE = 1; + const PROCESS_BLOCK = 2; + const LEAVE_MODULE = 3; + + /** + * @typedef {Object} QueueItem + * @property {number} action + * @property {DependenciesBlock} block + * @property {Module} module + * @property {Chunk} chunk + * @property {ChunkGroup} chunkGroup + */ + + /** + * @param {ChunkGroup} chunkGroup chunk group + * @returns {QueueItem} queue item + */ + const chunkGroupToQueueItem = chunkGroup => ({ + action: ENTER_MODULE, block: chunkGroup.chunks[0].entryModule, module: chunkGroup.chunks[0].entryModule, chunk: chunkGroup.chunks[0], chunkGroup - })); + }); + + // Start with the provided modules/chunks + /** @type {QueueItem[]} */ + let queue = inputChunkGroups.map(chunkGroupToQueueItem).reverse(); + /** @type {QueueItem[]} */ + let queueDelayed = []; let module, chunk, chunkGroup; @@ -1263,6 +1254,7 @@ class Compilation { b.loc, b.request ); + chunkGroupCounters.set(c, { index: 0, index2: 0 }); blockChunkGroups.set(b, c); allCreatedChunkGroups.add(c); } @@ -1280,7 +1272,8 @@ class Compilation { }); // 3. We enqueue the DependenciesBlock for traversal - queue.push({ + queueDelayed.push({ + action: PROCESS_BLOCK, block: b, module: module, chunk: c.chunks[0], @@ -1291,33 +1284,95 @@ class Compilation { // Iterative traversal of the Module graph // Recursive would be simpler to write but could result in Stack Overflows while (queue.length) { - const queueItem = queue.pop(); - module = queueItem.module; - block = queueItem.block; - chunk = queueItem.chunk; - chunkGroup = queueItem.chunkGroup; + while (queue.length) { + const queueItem = queue.pop(); + module = queueItem.module; + block = queueItem.block; + chunk = queueItem.chunk; + chunkGroup = queueItem.chunkGroup; - // get prepared block info - const blockInfo = blockInfoMap.get(block); + switch (queueItem.action) { + case ADD_AND_ENTER_MODULE: { + // We connect Module and Chunk when not already done + if (chunk.addModule(module)) { + module.addChunk(chunk); + } else { + // already connected, skip it + break; + } + } + // fallthrough + case ENTER_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex(module); + if (index === undefined) { + chunkGroup.setModuleIndex( + module, + chunkGroupCounters.get(chunkGroup).index++ + ); + } + } - // Traverse all referenced modules - for (const refModule of blockInfo.modules) { - // We connect Module and Chunk when not already done - if (chunk.addModule(refModule)) { - refModule.addChunk(chunk); + if (module.index === null) { + module.index = nextFreeModuleIndex++; + } - // And enqueue the Module for traversal - queue.push({ - block: refModule, - module: refModule, - chunk, - chunkGroup - }); + queue.push({ + action: LEAVE_MODULE, + block, + module, + chunk, + chunkGroup + }); + } + // fallthrough + case PROCESS_BLOCK: { + // get prepared block info + const blockInfo = blockInfoMap.get(block); + + // Traverse all referenced modules + for (let i = blockInfo.modules.length - 1; i >= 0; i--) { + const refModule = blockInfo.modules[i]; + if (chunk.containsModule(refModule)) { + // skip early if already connected + continue; + } + // enqueue the add and enter to enter in the correct order + // this is relevant with circular dependencies + queue.push({ + action: ADD_AND_ENTER_MODULE, + block: refModule, + module: refModule, + chunk, + chunkGroup + }); + } + + // Traverse all Blocks + iterationOfArrayCallback(blockInfo.blocks, iteratorBlock); + break; + } + case LEAVE_MODULE: { + if (chunkGroup !== undefined) { + const index = chunkGroup.getModuleIndex2(module); + if (index === undefined) { + chunkGroup.setModuleIndex2( + module, + chunkGroupCounters.get(chunkGroup).index2++ + ); + } + } + + if (module.index2 === null) { + module.index2 = nextFreeModuleIndex2++; + } + break; + } } } - - // Traverse all Blocks - iterationOfArrayCallback(blockInfo.blocks, iteratorBlock); + const tempQueue = queue; + queue = queueDelayed.reverse(); + queueDelayed = tempQueue; } // PART TWO diff --git a/lib/DefinePlugin.js b/lib/DefinePlugin.js index 849cda7da..d558019a2 100644 --- a/lib/DefinePlugin.js +++ b/lib/DefinePlugin.js @@ -14,26 +14,44 @@ const { } = require("./JavascriptParserHelpers"); const NullFactory = require("./NullFactory"); -const stringifyObj = obj => { +class RuntimeValue { + constructor(fn, fileDependencies) { + this.fn = fn; + this.fileDependencies = fileDependencies || []; + } + + exec(parser) { + for (const fileDependency of this.fileDependencies) { + parser.state.module.buildInfo.fileDependencies.add(fileDependency); + } + + return this.fn(); + } +} + +const stringifyObj = (obj, parser) => { return ( "Object({" + Object.keys(obj) .map(key => { const code = obj[key]; - return JSON.stringify(key) + ":" + toCode(code); + return JSON.stringify(key) + ":" + toCode(code, parser); }) .join(",") + "})" ); }; -const toCode = code => { +const toCode = (code, parser) => { if (code === null) { return "null"; } if (code === undefined) { return "undefined"; } + if (code instanceof RuntimeValue) { + return toCode(code.exec(parser), parser); + } if (code instanceof RegExp && code.toString) { return code.toString(); } @@ -41,7 +59,7 @@ const toCode = code => { return "(" + code.toString() + ")"; } if (typeof code === "object") { - return stringifyObj(code); + return stringifyObj(code, parser); } return code + ""; }; @@ -51,6 +69,10 @@ class DefinePlugin { this.definitions = definitions; } + static runtimeValue(fn, fileDependencies) { + return new RuntimeValue(fn, fileDependencies); + } + apply(compiler) { const definitions = this.definitions; compiler.hooks.compilation.tap( @@ -69,6 +91,7 @@ class DefinePlugin { if ( code && typeof code === "object" && + !(code instanceof RuntimeValue) && !(code instanceof RegExp) ) { walkDefinitions(code, prefix + key + "."); @@ -93,7 +116,6 @@ class DefinePlugin { if (isTypeof) key = key.replace(/^typeof\s+/, ""); let recurse = false; let recurseTypeof = false; - code = toCode(code); if (!isTypeof) { parser.hooks.canRename.for(key).tap("DefinePlugin", approve); parser.hooks.evaluateIdentifier @@ -109,21 +131,23 @@ class DefinePlugin { */ if (recurse) return; recurse = true; - const res = parser.evaluate(code); + const res = parser.evaluate(toCode(code, parser)); recurse = false; res.setRange(expr.range); return res; }); - parser.hooks.expression - .for(key) - .tap( - "DefinePlugin", - /__webpack_require__/.test(code) - ? toConstantDependencyWithWebpackRequire(parser, code) - : toConstantDependency(parser, code) - ); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = toCode(code, parser); + if (/__webpack_require__/.test(strCode)) { + return toConstantDependencyWithWebpackRequire( + parser, + strCode + )(expr); + } else { + return toConstantDependency(parser, strCode)(expr); + } + }); } - const typeofCode = isTypeof ? code : "typeof (" + code + ")"; parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { /** * this is needed in case there is a recursion in the DefinePlugin @@ -135,12 +159,18 @@ class DefinePlugin { */ if (recurseTypeof) return; recurseTypeof = true; + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; const res = parser.evaluate(typeofCode); recurseTypeof = false; res.setRange(expr.range); return res; }); parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + const typeofCode = isTypeof + ? toCode(code, parser) + : "typeof (" + toCode(code, parser) + ")"; const res = parser.evaluate(typeofCode); if (!res.isString()) return; return toConstantDependency( @@ -151,7 +181,6 @@ class DefinePlugin { }; const applyObjectDefine = (key, obj) => { - const code = stringifyObj(obj); parser.hooks.canRename.for(key).tap("DefinePlugin", approve); parser.hooks.evaluateIdentifier .for(key) @@ -161,14 +190,17 @@ class DefinePlugin { parser.hooks.evaluateTypeof .for(key) .tap("DefinePlugin", evaluateToString("object")); - parser.hooks.expression - .for(key) - .tap( - "DefinePlugin", - /__webpack_require__/.test(code) - ? toConstantDependencyWithWebpackRequire(parser, code) - : toConstantDependency(parser, code) - ); + parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + const strCode = stringifyObj(obj, parser); + + if (/__webpack_require__/.test(strCode)) { + return toConstantDependencyWithWebpackRequire(parser, strCode)( + expr + ); + } else { + return toConstantDependency(parser, strCode)(expr); + } + }); parser.hooks.typeof .for(key) .tap( diff --git a/lib/DependenciesBlockVariable.js b/lib/DependenciesBlockVariable.js index 7f7416271..efcdf3349 100644 --- a/lib/DependenciesBlockVariable.js +++ b/lib/DependenciesBlockVariable.js @@ -41,11 +41,9 @@ class DependenciesBlockVariable { hasDependencies(filter) { if (filter) { - if (this.dependencies.some(filter)) return true; - } else { - if (this.dependencies.length > 0) return true; + return this.dependencies.some(filter); } - return false; + return this.dependencies.length > 0; } } diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index d583787ac..f22ca8c30 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -56,6 +56,7 @@ const RuntimeChunkPlugin = require("./optimize/RuntimeChunkPlugin"); const NoEmitOnErrorsPlugin = require("./NoEmitOnErrorsPlugin"); const NamedModulesPlugin = require("./NamedModulesPlugin"); const NamedChunksPlugin = require("./NamedChunksPlugin"); +const HashedModuleIdsPlugin = require("./HashedModuleIdsPlugin"); const DefinePlugin = require("./DefinePlugin"); const SizeLimitsPlugin = require("./performance/SizeLimitsPlugin"); const WasmFinalizeExportsPlugin = require("./wasm/WasmFinalizeExportsPlugin"); @@ -354,6 +355,9 @@ class WebpackOptionsApply extends OptionsApply { if (options.optimization.namedModules) { new NamedModulesPlugin().apply(compiler); } + if (options.optimization.hashedModuleIds) { + new HashedModuleIdsPlugin().apply(compiler); + } if (options.optimization.namedChunks) { new NamedChunksPlugin().apply(compiler); } diff --git a/lib/WebpackOptionsDefaulter.js b/lib/WebpackOptionsDefaulter.js index dec4d056b..c3e47f37b 100644 --- a/lib/WebpackOptionsDefaulter.js +++ b/lib/WebpackOptionsDefaulter.js @@ -265,6 +265,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { "make", options => options.mode === "development" ); + this.set("optimization.hashedModuleIds", false); this.set( "optimization.namedChunks", "make", diff --git a/lib/util/Queue.js b/lib/util/Queue.js index 385b3a9bf..6615e9f77 100644 --- a/lib/util/Queue.js +++ b/lib/util/Queue.js @@ -5,7 +5,7 @@ */ class Queue { /** - * @param {IterableIterator=} items The initial elements. + * @param {Iterable=} items The initial elements. */ constructor(items) { /** @private @type {Set} */ diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index e843a270a..018d2147b 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -154,15 +154,21 @@ class JsonpMainTemplatePlugin { : "", "script.charset = 'utf-8';", `script.timeout = ${chunkLoadTimeout / 1000};`, - crossOriginLoading - ? `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - : "", `if (${mainTemplate.requireFn}.nc) {`, Template.indent( `script.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` ), "}", "script.src = jsonpScriptSrc(chunkId);", + crossOriginLoading + ? Template.asString([ + "if (script.src.indexOf(window.location.origin + '/') !== 0) {", + Template.indent( + `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) + : "", "onScriptComplete = function (event) {", Template.indent([ "// avoid mem leaks in IE.", @@ -208,9 +214,6 @@ class JsonpMainTemplatePlugin { ? `link.type = ${JSON.stringify(jsonpScriptType)};` : "", "link.charset = 'utf-8';", - crossOriginLoading - ? `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` - : "", `if (${mainTemplate.requireFn}.nc) {`, Template.indent( `link.setAttribute("nonce", ${mainTemplate.requireFn}.nc);` @@ -218,7 +221,16 @@ class JsonpMainTemplatePlugin { "}", 'link.rel = "preload";', 'link.as = "script";', - "link.href = jsonpScriptSrc(chunkId);" + "link.href = jsonpScriptSrc(chunkId);", + crossOriginLoading + ? Template.asString([ + "if (link.href.indexOf(window.location.origin + '/') !== 0) {", + Template.indent( + `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` + ), + "}" + ]) + : "" ]); } ); diff --git a/package.json b/package.json index 331587755..54074207f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack", - "version": "4.12.2", + "version": "4.13.0", "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT", @@ -15,7 +15,7 @@ "ajv": "^6.1.0", "ajv-keywords": "^3.1.0", "chrome-trace-event": "^1.0.0", - "enhanced-resolve": "^4.0.0", + "enhanced-resolve": "^4.1.0", "eslint-scope": "^3.7.1", "json-parse-better-errors": "^1.0.2", "loader-runner": "^2.3.0", @@ -103,6 +103,7 @@ "scripts": { "setup": "node ./setup/setup.js", "test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest", + "test:update-snapshots": "yarn jest -u", "test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\"", "test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"", "test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\"", diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 70c938c68..451cf477c 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1563,6 +1563,10 @@ "description": "Use readable module identifiers for better debugging", "type": "boolean" }, + "hashedModuleIds": { + "description": "Use hashed module id instead module identifiers for better long term caching", + "type": "boolean" + }, "namedChunks": { "description": "Use readable chunk identifiers for better debugging", "type": "boolean" diff --git a/test/ConfigTestCases.test.js b/test/ConfigTestCases.test.js index 4f3808341..4923509f2 100644 --- a/test/ConfigTestCases.test.js +++ b/test/ConfigTestCases.test.js @@ -178,7 +178,14 @@ describe("ConfigTestCases", () => { expect: expect, setTimeout: setTimeout, clearTimeout: clearTimeout, - document: new FakeDocument() + document: new FakeDocument(), + location: { + href: "https://test.cases/path/index.html", + origin: "https://test.cases", + toString() { + return "https://test.cases/path/index.html"; + } + } }; function _require(currentDirectory, module) { diff --git a/test/TestCases.template.js b/test/TestCases.template.js index 57dab3269..89e63c7ca 100644 --- a/test/TestCases.template.js +++ b/test/TestCases.template.js @@ -29,6 +29,7 @@ const DEFAULT_OPTIMIZATIONS = { noEmitOnErrors: false, concatenateModules: false, namedModules: false, + hashedModuleIds: false, minimizer: [uglifyJsForTesting] }; diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index e39c5927c..c3b34881c 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -148,58 +148,58 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto Entrypoint a = disabled/a.js Entrypoint b = disabled/b.js Entrypoint c = disabled/c.js - chunk {0} disabled/async-g.js (async-g) 54 bytes <{1}> <{5}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [8] ./g.js 34 bytes {0} [built] - chunk {1} disabled/async-a.js (async-a) 216 bytes <{4}> >{0}< [rendered] + chunk {0} disabled/async-a.js (async-a) 216 bytes <{4}> >{3}< [rendered] > ./a [7] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {0} {5} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {2} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] + chunk {1} disabled/async-b.js (async-b) 152 bytes <{4}> [rendered] > ./b [7] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] - chunk {3} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [4] ./b.js 72 bytes {1} {6} [built] + chunk {2} disabled/async-c.js (async-c) 167 bytes <{4}> [rendered] > ./c [7] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {2} {7} [built] | ./c.js 72 bytes [built] | ./node_modules/z.js 20 bytes [built] - chunk {4} disabled/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + chunk {3} disabled/async-g.js (async-g) 54 bytes <{0}> <{5}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [8] ./g.js 34 bytes {3} [built] + chunk {4} disabled/main.js (main) 147 bytes >{0}< >{1}< >{2}< [entry] [rendered] > ./ main [7] ./index.js 147 bytes {4} [built] - chunk {5} disabled/a.js (a) 216 bytes >{0}< [entry] [rendered] + chunk {5} disabled/a.js (a) 216 bytes >{3}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [5] ./a.js + 1 modules 156 bytes {1} {5} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [5] ./a.js + 1 modules 156 bytes {0} {5} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {6} disabled/b.js (b) 152 bytes [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {5} {6} [built] - [4] ./b.js 72 bytes {2} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {5} {6} [built] + [4] ./b.js 72 bytes {1} {6} [built] chunk {7} disabled/c.js (c) 167 bytes [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {5} {6} {7} [built] - [2] ./f.js 20 bytes {0} {2} {3} {6} {7} [built] - [6] ./c.js + 1 modules 107 bytes {3} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {5} {6} {7} [built] + [2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built] + [6] ./c.js + 1 modules 107 bytes {2} {7} [built] | ./c.js 72 bytes [built] | ./node_modules/z.js 20 bytes [built] Child default: @@ -207,53 +207,53 @@ Child default: Entrypoint a = default/a.js Entrypoint b = default/b.js Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c) + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{4}> <{9}> ={0}= ={1}= ={3}= ={5}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b) + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={4}= ={5}= >{2}< >{7}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + chunk {4} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{7}< [rendered] > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {5} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + [5] ./b.js 72 bytes {5} {11} [built] + chunk {6} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c) + [6] ./c.js 72 bytes {6} {12} [built] + chunk {7} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{4}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {7} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={6}= [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c) > ./c [8] ./index.js 3:0-47 [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{8}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + chunk {10} default/a.js (a) 216 bytes >{2}< >{7}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 152 bytes [entry] [rendered] @@ -262,78 +262,78 @@ Child default: [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] + [5] ./b.js 72 bytes {5} {11} [built] chunk {12} default/c.js (c) 152 bytes [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] + [6] ./c.js 72 bytes {6} {12} [built] Child vendors: Entrypoint main = vendors/main.js Entrypoint a = vendors/vendors.js vendors/a.js Entrypoint b = vendors/vendors.js vendors/b.js Entrypoint c = vendors/vendors.js vendors/c.js - chunk {0} vendors/async-g.js (async-g) 54 bytes <{1}> <{4}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [9] ./g.js 34 bytes {0} [built] - chunk {1} vendors/async-a.js (async-a) 216 bytes <{5}> >{0}< [rendered] + chunk {0} vendors/async-a.js (async-a) 216 bytes <{5}> >{3}< [rendered] > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [7] ./a.js + 1 modules 156 bytes {0} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {2} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] + chunk {1} vendors/async-b.js (async-b) 152 bytes <{5}> [rendered] > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [5] ./b.js 72 bytes {2} {7} [built] - chunk {3} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [5] ./b.js 72 bytes {1} {7} [built] + chunk {2} vendors/async-c.js (async-c) 152 bytes <{5}> [rendered] > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - [6] ./c.js 72 bytes {3} {8} [built] - chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{0}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [4] ./node_modules/z.js 20 bytes {2} {4} [built] + [6] ./c.js 72 bytes {2} {8} [built] + chunk {3} vendors/async-g.js (async-g) 54 bytes <{0}> <{4}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [9] ./g.js 34 bytes {3} [built] + chunk {4} vendors/vendors.js (vendors) 60 bytes ={6}= ={7}= ={8}= >{3}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a a > ./b b > ./c c - [1] ./node_modules/x.js 20 bytes {1} {2} {3} {4} [built] - [3] ./node_modules/y.js 20 bytes {1} {2} {4} [built] - [4] ./node_modules/z.js 20 bytes {3} {4} [built] - chunk {5} vendors/main.js (main) 147 bytes >{1}< >{2}< >{3}< [entry] [rendered] + [1] ./node_modules/x.js 20 bytes {0} {1} {2} {4} [built] + [3] ./node_modules/y.js 20 bytes {0} {1} {4} [built] + [4] ./node_modules/z.js 20 bytes {2} {4} [built] + chunk {5} vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {5} [built] - chunk {6} vendors/a.js (a) 176 bytes ={4}= >{0}< [entry] [rendered] + chunk {6} vendors/a.js (a) 176 bytes ={4}= >{3}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {0} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} vendors/b.js (b) 112 bytes ={4}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [5] ./b.js 72 bytes {2} {7} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [5] ./b.js 72 bytes {1} {7} [built] chunk {8} vendors/c.js (c) 112 bytes ={4}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] - [2] ./f.js 20 bytes {0} {2} {3} {7} {8} [built] - [6] ./c.js 72 bytes {3} {8} [built] + [0] ./d.js 20 bytes {0} {1} {2} {6} {7} {8} [built] + [2] ./f.js 20 bytes {1} {2} {3} {7} {8} [built] + [6] ./c.js 72 bytes {2} {8} [built] Child multiple-vendors: Entrypoint main = multiple-vendors/main.js Entrypoint a = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a~async-a~async-b~async-c~b~c.js multiple-vendors/a.js Entrypoint b = multiple-vendors/libs-x.js multiple-vendors/vendors~a~async-a~async-b~b.js multiple-vendors/a~async-a~async-b~async-c~b~c.js multiple-vendors/b.js Entrypoint c = multiple-vendors/libs-x.js multiple-vendors/vendors~async-c~c.js multiple-vendors/a~async-a~async-b~async-c~b~c.js multiple-vendors/c.js - chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) + chunk {0} multiple-vendors/libs-x.js (libs-x) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: libs) (name: libs-x) > ./a a > ./b b > ./c c @@ -341,7 +341,7 @@ Child multiple-vendors: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} multiple-vendors/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) + chunk {1} multiple-vendors/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -349,59 +349,59 @@ Child multiple-vendors: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./d.js 20 bytes {1} [built] - chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} multiple-vendors/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + chunk {3} multiple-vendors/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) > ./a a > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + chunk {4} multiple-vendors/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} multiple-vendors/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} multiple-vendors/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} multiple-vendors/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} multiple-vendors/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} multiple-vendors/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} multiple-vendors/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{5}< [entry] [rendered] + chunk {10} multiple-vendors/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} multiple-vendors/b.js (b) 92 bytes ={0}= ={1}= ={3}= [entry] [rendered] > ./b b [0] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} multiple-vendors/c.js (c) 92 bytes ={0}= ={1}= ={4}= [entry] [rendered] > ./c c [0] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] Child all: Entrypoint main = all/main.js Entrypoint a = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a~async-a~async-b~async-c~b~c.js all/a.js Entrypoint b = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~a~async-a~async-b~b.js all/a~async-a~async-b~async-c~b~c.js all/b.js Entrypoint c = all/vendors~a~async-a~async-b~async-c~b~c.js all/vendors~async-c~c.js all/a~async-a~async-b~async-c~b~c.js all/c.js - chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) + chunk {0} all/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -409,7 +409,7 @@ Child all: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} all/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) + chunk {1} all/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -417,53 +417,53 @@ Child all: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./d.js 20 bytes {1} [built] - chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} all/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) + chunk {3} all/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~async-a~async-b~b) > ./a a > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) + chunk {4} all/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} all/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} all/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} all/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} all/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} all/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} all/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{5}< [entry] [rendered] + chunk {10} all/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} all/b.js (b) 92 bytes ={0}= ={1}= ={3}= [entry] [rendered] > ./b b [0] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} all/c.js (c) 92 bytes ={0}= ={1}= ={4}= [entry] [rendered] > ./c c [0] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built]" + [5] ./c.js 72 bytes {7} {12} [built]" `; exports[`StatsTestCases should print correct stats for chunk-module-id-range 1`] = ` @@ -693,7 +693,7 @@ exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1` `; exports[`StatsTestCases should print correct stats for define-plugin 1`] = ` -"Hash: cfe08d4450db77f81610f4228fcb997ec81e2aa6 +"Hash: cfe08d4450db77f81610f4228fcb997ec81e2aa6ea3a5ddabdf239863047 Child Hash: cfe08d4450db77f81610 Time: Xms @@ -709,6 +709,14 @@ Child Asset Size Chunks Chunk Names main.js 3.6 KiB 0 [emitted] main Entrypoint main = main.js + [0] ./index.js 24 bytes {0} [built] +Child + Hash: ea3a5ddabdf239863047 + Time: Xms + Built at: Thu Jan 01 1970 00:00:00 GMT + Asset Size Chunks Chunk Names + main.js 3.6 KiB 0 [emitted] main + Entrypoint main = main.js [0] ./index.js 24 bytes {0} [built]" `; @@ -925,21 +933,21 @@ Child exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` "Entrypoint e1 = e1.js Entrypoint e2 = e2.js -chunk {0} c.js (c) 49 bytes <{3}> <{4}> >{1}< [rendered] - [1] ./module-c.js 49 bytes {0} [built] - import() ./module-c [2] ./module-b.js 1:0-47 - import() ./module-c [4] ./e2.js 1:0-47 -chunk {1} a.js (a) 49 bytes <{0}> <{2}> >{4}< [rendered] - [0] ./module-a.js 49 bytes {1} [built] +chunk {0} a.js (a) 49 bytes <{1}> <{2}> >{4}< [rendered] + [0] ./module-a.js 49 bytes {0} [built] import() ./module-a [1] ./module-c.js 1:0-47 import() ./module-a [3] ./e1.js 1:0-47 -chunk {2} e1.js (e1) 49 bytes >{1}< [entry] [rendered] +chunk {1} c.js (c) 49 bytes <{3}> <{4}> >{0}< [rendered] + [1] ./module-c.js 49 bytes {1} [built] + import() ./module-c [2] ./module-b.js 1:0-47 + import() ./module-c [4] ./e2.js 1:0-47 +chunk {2} e1.js (e1) 49 bytes >{0}< [entry] [rendered] [3] ./e1.js 49 bytes {2} [built] single entry ./e1 e1 -chunk {3} e2.js (e2) 49 bytes >{0}< [entry] [rendered] +chunk {3} e2.js (e2) 49 bytes >{1}< [entry] [rendered] [4] ./e2.js 49 bytes {3} [built] single entry ./e2 e2 -chunk {4} b.js (b) 49 bytes <{1}> >{0}< [rendered] +chunk {4} b.js (b) 49 bytes <{0}> >{1}< [rendered] [2] ./module-b.js 49 bytes {4} [built] import() ./module-b [0] ./module-a.js 1:0-47" `; @@ -950,29 +958,29 @@ Entrypoint e2 = e2.js chunk {0} y.js (y) 0 bytes <{3}> <{4}> [rendered] [3] ./module-y.js 0 bytes {0} [built] import() ./module-y [0] ./module-x.js 1:0-47 -chunk {1} c.js (c) 49 bytes <{4}> <{5}> >{2}< [rendered] - [2] ./module-c.js 49 bytes {1} [built] - import() ./module-c [4] ./module-b.js 1:0-47 - import() ./module-c [6] ./e2.js 2:0-47 -chunk {2} a.js (a) 49 bytes <{1}> <{3}> >{5}< [rendered] - [1] ./module-a.js 49 bytes {2} [built] +chunk {1} a.js (a) 49 bytes <{2}> <{3}> >{5}< [rendered] + [1] ./module-a.js 49 bytes {1} [built] import() ./module-a [2] ./module-c.js 1:0-47 import() ./module-a [5] ./e1.js 2:0-47 -chunk {3} e1.js (e1) 119 bytes >{0}< >{2}< [entry] [rendered] +chunk {2} c.js (c) 49 bytes <{4}> <{5}> >{1}< [rendered] + [2] ./module-c.js 49 bytes {2} [built] + import() ./module-c [4] ./module-b.js 1:0-47 + import() ./module-c [6] ./e2.js 2:0-47 +chunk {3} e1.js (e1) 119 bytes >{0}< >{1}< [entry] [rendered] [0] ./module-x.js 49 bytes {3} {4} [built] import() ./module-x [4] ./module-b.js 2:0-20 harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 [5] ./e1.js 70 bytes {3} [built] single entry ./e1 e1 -chunk {4} e2.js (e2) 119 bytes >{0}< >{1}< [entry] [rendered] +chunk {4} e2.js (e2) 119 bytes >{0}< >{2}< [entry] [rendered] [0] ./module-x.js 49 bytes {3} {4} [built] import() ./module-x [4] ./module-b.js 2:0-20 harmony side effect evaluation ./module-x [5] ./e1.js 1:0-20 harmony side effect evaluation ./module-x [6] ./e2.js 1:0-20 [6] ./e2.js 70 bytes {4} [built] single entry ./e2 e2 -chunk {5} b.js (b) 179 bytes <{2}> >{1}< [rendered] +chunk {5} b.js (b) 179 bytes <{1}> >{2}< [rendered] [4] ./module-b.js 179 bytes {5} [built] import() ./module-b [1] ./module-a.js 1:0-47" `; @@ -1213,8 +1221,8 @@ chunk {1} main.js (main) 12 bytes >{0}< [entry] [rendered] exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` "Asset Size Chunks Chunk Names - 0.js 730 bytes 0, 5 [emitted] - 1.js 730 bytes 1, 4 [emitted] + 0.js 730 bytes 0, 4 [emitted] + 1.js 730 bytes 1, 5 [emitted] 2.js 730 bytes 2, 3 [emitted] 3.js 661 bytes 3 [emitted] 4.js 661 bytes 4 [emitted] @@ -1225,77 +1233,77 @@ e3.js 9.46 KiB 8 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js -chunk {0} 0.js 37 bytes <{7}> <{8}> [rendered] - [2] ./d.js 9 bytes {0} {6} [built] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {1} 1.js 37 bytes <{6}> <{8}> [rendered] - [3] ./f.js 9 bytes {1} {7} [built] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {2} 2.js 37 bytes <{6}> <{7}> [rendered] - [4] ./h.js 9 bytes {2} {8} [built] - [7] ./async3.js 28 bytes {2} {3} [built] -chunk {3} 3.js 28 bytes <{8}> [rendered] - [7] ./async3.js 28 bytes {2} {3} [built] +chunk {0} 0.js 37 bytes <{6}> <{8}> [rendered] + [3] ./f.js 9 bytes {0} {7} [built] + [6] ./async2.js 28 bytes {0} {4} [built] +chunk {1} 1.js 37 bytes <{6}> <{7}> [rendered] + [4] ./h.js 9 bytes {1} {8} [built] + [7] ./async3.js 28 bytes {1} {5} [built] +chunk {2} 2.js 37 bytes <{7}> <{8}> [rendered] + [2] ./d.js 9 bytes {2} {6} [built] + [5] ./async1.js 28 bytes {2} {3} [built] +chunk {3} 3.js 28 bytes <{6}> [rendered] + [5] ./async1.js 28 bytes {2} {3} [built] chunk {4} 4.js 28 bytes <{7}> [rendered] - [6] ./async2.js 28 bytes {1} {4} [built] -chunk {5} 5.js 28 bytes <{6}> [rendered] - [5] ./async1.js 28 bytes {0} {5} [built] -chunk {6} e1.js (e1) 152 bytes >{1}< >{2}< >{5}< [entry] [rendered] + [6] ./async2.js 28 bytes {0} {4} [built] +chunk {5} 5.js 28 bytes <{8}> [rendered] + [7] ./async3.js 28 bytes {1} {5} [built] +chunk {6} e1.js (e1) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [2] ./d.js 9 bytes {0} {6} [built] + [2] ./d.js 9 bytes {2} {6} [built] [8] ./e1.js 116 bytes {6} [built] [9] ./c.js 9 bytes {6} [built] -chunk {7} e2.js (e2) 152 bytes >{0}< >{2}< >{4}< [entry] [rendered] +chunk {7} e2.js (e2) 152 bytes >{1}< >{2}< >{4}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [3] ./f.js 9 bytes {1} {7} [built] + [3] ./f.js 9 bytes {0} {7} [built] [10] ./e2.js 116 bytes {7} [built] [11] ./e.js 9 bytes {7} [built] -chunk {8} e3.js (e3) 152 bytes >{0}< >{1}< >{3}< [entry] [rendered] +chunk {8} e3.js (e3) 152 bytes >{0}< >{2}< >{5}< [entry] [rendered] [0] ./b.js 9 bytes {6} {7} {8} [built] [1] ./a.js 9 bytes {6} {7} {8} [built] - [4] ./h.js 9 bytes {2} {8} [built] + [4] ./h.js 9 bytes {1} {8} [built] [12] ./e3.js 116 bytes {8} [built] [13] ./g.js 9 bytes {8} [built]" `; exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` " Asset Size Chunks Chunk Names -async3.js 818 bytes 0 [emitted] async3 -async1.js 818 bytes 1 [emitted] async1 -async2.js 818 bytes 2 [emitted] async2 +async1.js 818 bytes 0 [emitted] async1 +async2.js 818 bytes 1 [emitted] async2 +async3.js 818 bytes 2 [emitted] async3 e1.js 9.31 KiB 3 [emitted] e1 e2.js 9.33 KiB 4 [emitted] e2 e3.js 9.35 KiB 5 [emitted] e3 Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js -chunk {0} async3.js (async3) 89 bytes <{2}> <{5}> >{1}< [rendered] - [4] ./h.js 9 bytes {0} {5} [built] - [7] ./async3.js 80 bytes {0} [built] -chunk {1} async1.js (async1) 89 bytes <{0}> <{3}> >{2}< [rendered] - [2] ./d.js 9 bytes {1} {3} [built] - [5] ./async1.js 80 bytes {1} [built] -chunk {2} async2.js (async2) 89 bytes <{1}> <{4}> >{0}< [rendered] - [3] ./f.js 9 bytes {2} {4} [built] - [6] ./async2.js 80 bytes {2} [built] -chunk {3} e1.js (e1) 144 bytes >{1}< [entry] [rendered] +chunk {0} async1.js (async1) 89 bytes <{2}> <{3}> >{1}< [rendered] + [2] ./d.js 9 bytes {0} {3} [built] + [5] ./async1.js 80 bytes {0} [built] +chunk {1} async2.js (async2) 89 bytes <{0}> <{4}> >{2}< [rendered] + [3] ./f.js 9 bytes {1} {4} [built] + [6] ./async2.js 80 bytes {1} [built] +chunk {2} async3.js (async3) 89 bytes <{1}> <{5}> >{0}< [rendered] + [4] ./h.js 9 bytes {2} {5} [built] + [7] ./async3.js 80 bytes {2} [built] +chunk {3} e1.js (e1) 144 bytes >{0}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [2] ./d.js 9 bytes {1} {3} [built] + [2] ./d.js 9 bytes {0} {3} [built] [8] ./e1.js 108 bytes {3} [built] [9] ./c.js 9 bytes {3} [built] -chunk {4} e2.js (e2) 144 bytes >{2}< [entry] [rendered] +chunk {4} e2.js (e2) 144 bytes >{1}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [3] ./f.js 9 bytes {2} {4} [built] + [3] ./f.js 9 bytes {1} {4} [built] [10] ./e2.js 108 bytes {4} [built] [11] ./e.js 9 bytes {4} [built] -chunk {5} e3.js (e3) 144 bytes >{0}< [entry] [rendered] +chunk {5} e3.js (e3) 144 bytes >{2}< [entry] [rendered] [0] ./b.js 9 bytes {3} {4} {5} [built] [1] ./a.js 9 bytes {3} {4} {5} [built] - [4] ./h.js 9 bytes {0} {5} [built] + [4] ./h.js 9 bytes {2} {5} [built] [12] ./e3.js 108 bytes {5} [built] [13] ./g.js 9 bytes {5} [built]" `; @@ -1429,25 +1437,25 @@ Child child: `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"Hash: 5410f0485ae94208c671 +"Hash: 8d1bfb62ba8ed42918d6 Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names cir1.js 299 bytes 0 [emitted] cir1 ab.js 183 bytes 1 [emitted] ab - abd.js 277 bytes 2, 1 [emitted] abd + abd.js 268 bytes 2, 1 [emitted] abd cir2.js 299 bytes 3 [emitted] cir2 main.js 9.09 KiB 4 [emitted] main -cir2 from cir1.js 359 bytes 5, 3 [emitted] cir2 from cir1 - chunk.js 190 bytes 6, 7 [emitted] chunk - ac in ab.js 130 bytes 7 [emitted] ac in ab + ac in ab.js 130 bytes 5 [emitted] ac in ab + chunk.js 190 bytes 6, 5 [emitted] chunk +cir2 from cir1.js 359 bytes 7, 3 [emitted] cir2 from cir1 Entrypoint main = main.js -chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> >{5}< [rendered] +chunk {0} cir1.js (cir1) 81 bytes <{3}> <{4}> >{7}< [rendered] > [3] ./circular2.js 1:0-79 > [3] ./circular2.js 1:0-79 > [8] ./index.js 13:0-54 [2] ./circular1.js 81 bytes {0} [built] -chunk {1} ab.js (ab) 0 bytes <{4}> >{7}< [rendered] +chunk {1} ab.js (ab) 0 bytes <{4}> >{5}< [rendered] > [8] ./index.js 1:0-6:8 [0] ./modules/a.js 0 bytes {1} {2} [built] [1] ./modules/b.js 0 bytes {1} {2} [built] @@ -1455,27 +1463,27 @@ chunk {2} abd.js (abd) 0 bytes <{4}> >{6}< [rendered] > [8] ./index.js 8:0-11:9 [0] ./modules/a.js 0 bytes {1} {2} [built] [1] ./modules/b.js 0 bytes {1} {2} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] + [5] ./modules/d.js 0 bytes {2} {6} [built] chunk {3} cir2.js (cir2) 81 bytes <{4}> >{0}< [rendered] > [8] ./index.js 14:0-54 - [3] ./circular2.js 81 bytes {3} {5} [built] + [3] ./circular2.js 81 bytes {3} {7} [built] chunk {4} main.js (main) 523 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] > ./index main [4] ./modules/f.js 0 bytes {4} [built] [8] ./index.js 523 bytes {4} [built] -chunk {5} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> [rendered] - > [2] ./circular1.js 1:0-79 - > [2] ./circular1.js 1:0-79 - [3] ./circular2.js 81 bytes {3} {5} [built] - [7] ./modules/e.js 0 bytes {5} [built] -chunk {6} chunk.js (chunk) 0 bytes <{2}> <{7}> [rendered] +chunk {5} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] + > [8] ./index.js 2:1-5:15 + [6] ./modules/c.js 0 bytes {5} {6} [built] +chunk {6} chunk.js (chunk) 0 bytes <{2}> <{5}> [rendered] > [8] ./index.js 3:2-4:13 > [8] ./index.js 9:1-10:12 - [5] ./modules/c.js 0 bytes {6} {7} [built] - [6] ./modules/d.js 0 bytes {2} {6} [built] -chunk {7} ac in ab.js (ac in ab) 0 bytes <{1}> >{6}< [rendered] - > [8] ./index.js 2:1-5:15 - [5] ./modules/c.js 0 bytes {6} {7} [built]" + [5] ./modules/d.js 0 bytes {2} {6} [built] + [6] ./modules/c.js 0 bytes {5} {6} [built] +chunk {7} cir2 from cir1.js (cir2 from cir1) 81 bytes <{0}> [rendered] + > [2] ./circular1.js 1:0-79 + > [2] ./circular1.js 1:0-79 + [3] ./circular2.js 81 bytes {3} {7} [built] + [7] ./modules/e.js 0 bytes {7} [built]" `; exports[`StatsTestCases should print correct stats for parse-error 1`] = ` @@ -1748,17 +1756,17 @@ chunk {6} inner2.js (inner2) 0 bytes <{0}> [rendered]" `; exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` -"chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] +"chunk {0} a.js (a) 136 bytes <{3}> >{4}< >{5}< (prefetch: {4} {5}) [rendered] chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] -chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] +chunk {2} c.js (c) 134 bytes <{3}> >{10}< >{9}< (preload: {9} {10}) [rendered] chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] -chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] -chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] +chunk {4} a1.js (a1) 0 bytes <{0}> [rendered] +chunk {5} a2.js (a2) 0 bytes <{0}> [rendered] chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] chunk {7} b2.js (b2) 0 bytes <{1}> [rendered] chunk {8} b3.js (b3) 0 bytes <{1}> [rendered] -chunk {9} a1.js (a1) 0 bytes <{0}> [rendered] -chunk {10} a2.js (a2) 0 bytes <{0}> [rendered]" +chunk {9} c1.js (c1) 0 bytes <{2}> [rendered] +chunk {10} c2.js (c2) 0 bytes <{2}> [rendered]" `; exports[`StatsTestCases should print correct stats for preload 1`] = ` @@ -1767,7 +1775,7 @@ exports[`StatsTestCases should print correct stats for preload 1`] = ` normal.js 130 bytes 1 [emitted] normal preloaded2.js 127 bytes 2 [emitted] preloaded2 preloaded3.js 130 bytes 3 [emitted] preloaded3 - main.js 9.87 KiB 4 [emitted] main + main.js 9.86 KiB 4 [emitted] main inner.js 136 bytes 5 [emitted] inner inner2.js 201 bytes 6 [emitted] inner2 Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) @@ -2078,9 +2086,9 @@ Entrypoint entry = entry.js `; exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` -"Hash: a786614ea171d67e9632b9989eac65394295ae64 +"Hash: 4fe44d37d6d451751f0a83f3311f89e78104b088 Child - Hash: a786614ea171d67e9632 + Hash: 4fe44d37d6d451751f0a Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Entrypoint first = vendor.js first.js @@ -2091,13 +2099,13 @@ Child [3] ./common.js 37 bytes {4} {5} [built] [4] ./lazy_shared.js 31 bytes {0} [built] [5] ./vendor.js 25 bytes {3} [built] - [6] ./lazy_first.js 55 bytes {2} [built] - [7] ./lazy_second.js 55 bytes {1} [built] + [6] ./lazy_first.js 55 bytes {1} [built] + [7] ./lazy_second.js 55 bytes {2} [built] [8] ./first.js 207 bytes {4} [built] [9] ./module_first.js 31 bytes {4} [built] [10] ./second.js 177 bytes {5} [built] Child - Hash: b9989eac65394295ae64 + Hash: 83f3311f89e78104b088 Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Entrypoint first = vendor.js first.js @@ -2110,7 +2118,7 @@ Child [3] ./vendor.js 25 bytes {3} [built] [4] ./lazy_shared.js 31 bytes {0} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import()), ./second.js (referenced with import()) - [5] ./lazy_second.js 55 bytes {1} [built] + [5] ./lazy_second.js 55 bytes {2} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./second.js (referenced with import()) [6] ./second.js 177 bytes {5} [built] ModuleConcatenation bailout: Module is an entry point @@ -2120,7 +2128,7 @@ Child | ./first.js 207 bytes [built] | ModuleConcatenation bailout: Module is an entry point | ./module_first.js 31 bytes [built] - [8] ./lazy_first.js 55 bytes {2} [built] + [8] ./lazy_first.js 55 bytes {1} [built] ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./first.js (referenced with import())" `; @@ -2158,14 +2166,14 @@ Entrypoint main = main.js harmony import specifier ./components [3] ./foo.js 3:20-25 (skipped side-effect-free modules) harmony side effect evaluation ./CompA [7] ./components/src/CompAB/index.js 1:0-43 harmony export imported specifier ./CompA [7] ./components/src/CompAB/index.js 1:0-43 -[5] ./components/src/CompC/CompC.js 33 bytes [built] - [no exports used] - harmony side effect evaluation ./CompC [6] ./components/src/CompC/index.js 1:0-34 - harmony export imported specifier ./CompC [6] ./components/src/CompC/index.js 1:0-34 -[6] ./components/src/CompC/index.js 34 bytes [built] +[5] ./components/src/CompC/index.js 34 bytes [built] [no exports used] harmony side effect evaluation ./CompC [2] ./components/src/index.js 2:0-43 harmony export imported specifier ./CompC [2] ./components/src/index.js 2:0-43 +[6] ./components/src/CompC/CompC.js 33 bytes [built] + [no exports used] + harmony side effect evaluation ./CompC [5] ./components/src/CompC/index.js 1:0-34 + harmony export imported specifier ./CompC [5] ./components/src/CompC/index.js 1:0-34 [7] ./components/src/CompAB/index.js 87 bytes [built] [no exports used] harmony side effect evaluation ./CompAB [2] ./components/src/index.js 1:0-40 @@ -2220,53 +2228,53 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` Entrypoint a = default/a.js Entrypoint b = default/b.js Entrypoint c = default/c.js - chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c) + chunk {0} default/vendors~async-a~async-b~async-c.js (vendors~async-a~async-b~async-c) 20 bytes <{9}> ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] - chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={5}= ={6}= ={7}= ={8}= >{2}< >{4}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) + chunk {1} default/async-a~async-b~async-c.js (async-a~async-b~async-c) 20 bytes <{9}> ={0}= ={2}= ={3}= ={4}= ={5}= ={6}= ={8}= >{2}< >{7}< [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./d.js 20 bytes {1} {10} {11} {12} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{4}> <{9}> ={0}= ={1}= ={3}= ={5}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={5}= ={6}= >{2}< >{4}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b) + chunk {3} default/vendors~async-a~async-b.js (vendors~async-a~async-b) 20 bytes <{9}> ={0}= ={1}= ={2}= ={4}= ={5}= >{2}< >{7}< [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b) > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - chunk {4} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {4} [built] - chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{4}< [rendered] + chunk {4} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{7}< [rendered] > ./a [8] ./index.js 1:0-47 - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {5} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [5] ./b.js 72 bytes {6} {11} [built] - chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] + [5] ./b.js 72 bytes {5} {11} [built] + chunk {6} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={8}= [rendered] > ./c [8] ./index.js 3:0-47 - [6] ./c.js 72 bytes {7} {12} [built] - chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={7}= [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c) + [6] ./c.js 72 bytes {6} {12} [built] + chunk {7} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{4}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {7} [built] + chunk {8} default/vendors~async-c.js (vendors~async-c) 20 bytes <{9}> ={0}= ={1}= ={2}= ={6}= [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c) > ./c [8] ./index.js 3:0-47 [4] ./node_modules/z.js 20 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{5}< >{6}< >{7}< >{8}< [entry] [rendered] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{8}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{4}< [entry] [rendered] + chunk {10} default/a.js (a) 216 bytes >{2}< >{7}< [entry] [rendered] > ./a a [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [7] ./a.js + 1 modules 156 bytes {5} {10} [built] + [7] ./a.js + 1 modules 156 bytes {4} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 152 bytes [entry] [rendered] @@ -2275,20 +2283,20 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [3] ./node_modules/y.js 20 bytes {3} {10} {11} [built] - [5] ./b.js 72 bytes {6} {11} [built] + [5] ./b.js 72 bytes {5} {11} [built] chunk {12} default/c.js (c) 152 bytes [entry] [rendered] > ./c c [0] ./d.js 20 bytes {1} {10} {11} {12} [built] [1] ./node_modules/x.js 20 bytes {0} {10} {11} {12} [built] [2] ./f.js 20 bytes {2} {11} {12} [built] [4] ./node_modules/z.js 20 bytes {8} {12} [built] - [6] ./c.js 72 bytes {7} {12} [built] + [6] ./c.js 72 bytes {6} {12} [built] Child all-chunks: Entrypoint main = default/main.js Entrypoint a = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a~async-a~async-b~async-c~b~c.js default/a.js Entrypoint b = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~a~async-a~async-b~b.js default/a~async-a~async-b~async-c~b~c.js default/b.js Entrypoint c = default/vendors~a~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/a~async-a~async-b~async-c~b~c.js default/c.js - chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~a~async-a~async-b~async-c~b~c) + chunk {0} default/vendors~a~async-a~async-b~async-c~b~c.js (vendors~a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -2296,7 +2304,7 @@ Child all-chunks: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} [built] - chunk {1} default/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) + chunk {1} default/a~async-a~async-b~async-c~b~c.js (a~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={10}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: default) (name: a~async-a~async-b~async-c~b~c) > ./a a > ./b b > ./c c @@ -2304,109 +2312,109 @@ Child all-chunks: > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./d.js 20 bytes {1} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~a~async-a~async-b~b) + chunk {3} default/vendors~a~async-a~async-b~b.js (vendors~a~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={10}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~a~async-a~async-b~b) > ./a a > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c~c) + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{5}< [entry] [rendered] + chunk {10} default/a.js (a) 156 bytes ={0}= ={1}= ={3}= >{2}< >{8}< [entry] [rendered] > ./a a - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 92 bytes ={0}= ={1}= ={3}= [entry] [rendered] > ./b b [0] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} default/c.js (c) 92 bytes ={0}= ={1}= ={4}= [entry] [rendered] > ./c c [0] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] Child manual: Entrypoint main = default/main.js Entrypoint a = default/vendors.js default/a.js Entrypoint b = default/vendors.js default/b.js Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={1}= ={2}= ={3}= ={6}= ={7}= ={8}= >{4}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a a > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} [built] - [3] ./node_modules/y.js 20 bytes {0} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] + [2] ./node_modules/x.js 20 bytes {0} [built] + [3] ./node_modules/y.js 20 bytes {0} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [9] multi x y z 52 bytes {0} [built] + chunk {1} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{4}< [rendered] > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + chunk {2} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] + chunk {3} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] + chunk {4} default/async-g.js (async-g) 54 bytes <{0}> <{1}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [10] ./g.js 34 bytes {4} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered] + chunk {6} default/a.js (a) 176 bytes ={0}= >{4}< [entry] [rendered] > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] Child name-too-long: Entrypoint main = main.js Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccc~50ebc41f.js vendors~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~async-a~async-b~async-c~bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb~cccccccccccccc~18066793.js async-a.js aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js @@ -2478,126 +2486,126 @@ Child custom-chunks-filter: Entrypoint a = default/a.js Entrypoint b = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-a~async-b~b.js default/async-a~async-b~async-c~b~c.js default/b.js Entrypoint c = default/vendors~async-a~async-b~async-c~b~c.js default/vendors~async-c~c.js default/async-a~async-b~async-c~b~c.js default/c.js - chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c~b~c) + chunk {0} default/vendors~async-a~async-b~async-c~b~c.js (vendors~async-a~async-b~async-c~b~c) 20 bytes <{9}> ={1}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~async-c~b~c) > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [2] ./node_modules/x.js 20 bytes {0} {10} [built] - chunk {1} default/async-a~async-b~async-c~b~c.js (async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={11}= ={12}= ={2}= ={3}= ={4}= ={6}= ={7}= ={8}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c~b~c) + chunk {1} default/async-a~async-b~async-c~b~c.js (async-a~async-b~async-c~b~c) 20 bytes <{9}> ={0}= ={11}= ={12}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: default) (name: async-a~async-b~async-c~b~c) > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [1] ./d.js 20 bytes {1} {10} [built] - chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{6}> <{9}> ={0}= ={1}= ={3}= ={4}= ={5}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) + chunk {2} default/async-b~async-c~async-g.js (async-b~async-c~async-g) 20 bytes <{0}> <{1}> <{10}> <{3}> <{5}> <{9}> ={0}= ={1}= ={3}= ={4}= ={6}= ={7}= ={8}= [rendered] split chunk (cache group: default) (name: async-b~async-c~async-g) > ./g [] 6:0-47 > ./g [] 6:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 [0] ./f.js 20 bytes {2} {11} {12} [built] - chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={6}= ={7}= >{2}< >{5}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~b) + chunk {3} default/vendors~async-a~async-b~b.js (vendors~async-a~async-b~b) 20 bytes <{9}> ={0}= ={1}= ={11}= ={2}= ={5}= ={6}= >{2}< >{8}< [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-a~async-b~b) > ./b b > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 [3] ./node_modules/y.js 20 bytes {3} {10} [built] - chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={8}= [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c~c) + chunk {4} default/vendors~async-c~c.js (vendors~async-c~c) 20 bytes <{9}> ={0}= ={1}= ={12}= ={2}= ={7}= [initial] [rendered] split chunk (cache group: defaultVendors) (name: vendors~async-c~c) > ./c c > ./c [8] ./index.js 3:0-47 [7] ./node_modules/z.js 20 bytes {4} [built] - chunk {5} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{6}> ={2}= [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [9] ./g.js 34 bytes {5} [built] - chunk {6} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{5}< [rendered] + chunk {5} default/async-a.js (async-a) 156 bytes <{9}> ={0}= ={1}= ={3}= >{2}< >{8}< [rendered] > ./a [8] ./index.js 1:0-47 - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] - chunk {7} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] + chunk {6} default/async-b.js (async-b) 72 bytes <{9}> ={0}= ={1}= ={2}= ={3}= [rendered] > ./b [8] ./index.js 2:0-47 - [4] ./b.js 72 bytes {7} {11} [built] - chunk {8} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] + [4] ./b.js 72 bytes {6} {11} [built] + chunk {7} default/async-c.js (async-c) 72 bytes <{9}> ={0}= ={1}= ={2}= ={4}= [rendered] > ./c [8] ./index.js 3:0-47 - [5] ./c.js 72 bytes {8} {12} [built] - chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{6}< >{7}< >{8}< [entry] [rendered] + [5] ./c.js 72 bytes {7} {12} [built] + chunk {8} default/async-g.js (async-g) 34 bytes <{0}> <{1}> <{10}> <{3}> <{5}> ={2}= [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [9] ./g.js 34 bytes {8} [built] + chunk {9} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< >{4}< >{5}< >{6}< >{7}< [entry] [rendered] > ./ main [8] ./index.js 147 bytes {9} [built] - chunk {10} default/a.js (a) 216 bytes >{2}< >{5}< [entry] [rendered] + chunk {10} default/a.js (a) 216 bytes >{2}< >{8}< [entry] [rendered] > ./a a [1] ./d.js 20 bytes {1} {10} [built] [2] ./node_modules/x.js 20 bytes {0} {10} [built] [3] ./node_modules/y.js 20 bytes {3} {10} [built] - [6] ./a.js + 1 modules 156 bytes {6} {10} [built] + [6] ./a.js + 1 modules 156 bytes {5} {10} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {11} default/b.js (b) 92 bytes ={0}= ={1}= ={3}= [entry] [rendered] > ./b b [0] ./f.js 20 bytes {2} {11} {12} [built] - [4] ./b.js 72 bytes {7} {11} [built] + [4] ./b.js 72 bytes {6} {11} [built] chunk {12} default/c.js (c) 92 bytes ={0}= ={1}= ={4}= [entry] [rendered] > ./c c [0] ./f.js 20 bytes {2} {11} {12} [built] - [5] ./c.js 72 bytes {8} {12} [built] + [5] ./c.js 72 bytes {7} {12} [built] Child custom-chunks-filter-in-cache-groups: Entrypoint main = default/main.js Entrypoint a = default/a.js Entrypoint b = default/vendors.js default/b.js Entrypoint c = default/vendors.js default/c.js - chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={2}= ={3}= ={4}= ={7}= ={8}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={1}= ={2}= ={3}= ={7}= ={8}= >{4}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./b b > ./c c > ./a [8] ./index.js 1:0-47 > ./b [8] ./index.js 2:0-47 > ./c [8] ./index.js 3:0-47 - [2] ./node_modules/x.js 20 bytes {0} {6} [built] - [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [6] ./node_modules/z.js 20 bytes {0} [built] - [10] multi x y z 52 bytes {0} [built] - chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered] - > ./g [] 6:0-47 - > ./g [] 6:0-47 - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [9] ./g.js 34 bytes {1} [built] - chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered] - > ./a [8] ./index.js 1:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] - | ./a.js 121 bytes [built] - | ./e.js 20 bytes [built] - chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] - > ./b [8] ./index.js 2:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] - chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] - > ./c [8] ./index.js 3:0-47 - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built] - chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered] - > ./ main - [8] ./index.js 147 bytes {5} [built] - chunk {6} default/a.js (a) 216 bytes >{1}< [entry] [rendered] - > ./a a - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] [2] ./node_modules/x.js 20 bytes {0} {6} [built] [3] ./node_modules/y.js 20 bytes {0} {6} [built] - [7] ./a.js + 1 modules 156 bytes {2} {6} [built] + [6] ./node_modules/z.js 20 bytes {0} [built] + [9] multi x y z 52 bytes {0} [built] + chunk {1} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{4}< [rendered] + > ./a [8] ./index.js 1:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] + | ./a.js 121 bytes [built] + | ./e.js 20 bytes [built] + chunk {2} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered] + > ./b [8] ./index.js 2:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] + chunk {3} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered] + > ./c [8] ./index.js 3:0-47 + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built] + chunk {4} default/async-g.js (async-g) 54 bytes <{0}> <{1}> <{6}> [rendered] + > ./g [] 6:0-47 + > ./g [] 6:0-47 + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [10] ./g.js 34 bytes {4} [built] + chunk {5} default/main.js (main) 147 bytes >{0}< >{1}< >{2}< >{3}< [entry] [rendered] + > ./ main + [8] ./index.js 147 bytes {5} [built] + chunk {6} default/a.js (a) 216 bytes >{4}< [entry] [rendered] + > ./a a + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [2] ./node_modules/x.js 20 bytes {0} {6} [built] + [3] ./node_modules/y.js 20 bytes {0} {6} [built] + [7] ./a.js + 1 modules 156 bytes {1} {6} [built] | ./a.js 121 bytes [built] | ./e.js 20 bytes [built] chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered] > ./b b - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [4] ./b.js 72 bytes {3} {7} [built] + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [4] ./b.js 72 bytes {2} {7} [built] chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered] > ./c c - [0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built] - [1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built] - [5] ./c.js 72 bytes {4} {8} [built]" + [0] ./d.js 20 bytes {1} {2} {3} {6} {7} {8} [built] + [1] ./f.js 20 bytes {2} {3} {4} {7} {8} [built] + [5] ./c.js 72 bytes {3} {8} [built]" `; exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` diff --git a/test/configCases/chunk-index/order-multiple-entries/a.js b/test/configCases/chunk-index/order-multiple-entries/a.js new file mode 100644 index 000000000..7777e2e08 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/a.js @@ -0,0 +1 @@ +import "./shared"; \ No newline at end of file diff --git a/test/configCases/chunk-index/order-multiple-entries/async.js b/test/configCases/chunk-index/order-multiple-entries/async.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/b.js b/test/configCases/chunk-index/order-multiple-entries/b.js new file mode 100644 index 000000000..7777e2e08 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/b.js @@ -0,0 +1 @@ +import "./shared"; \ No newline at end of file diff --git a/test/configCases/chunk-index/order-multiple-entries/c.js b/test/configCases/chunk-index/order-multiple-entries/c.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/entry1.js b/test/configCases/chunk-index/order-multiple-entries/entry1.js new file mode 100644 index 000000000..32a5fa8c8 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/entry1.js @@ -0,0 +1,6 @@ +import "./a"; +import(/* webpackChunkName: "async" */ "./async"); +import "./b"; +import "./c"; + +it("should compile", () => {}); diff --git a/test/configCases/chunk-index/order-multiple-entries/entry2.js b/test/configCases/chunk-index/order-multiple-entries/entry2.js new file mode 100644 index 000000000..aa9ec2317 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/entry2.js @@ -0,0 +1,6 @@ +import "./c"; +import(/* webpackChunkName: "async" */ "./async"); +import "./b"; +import "./a"; + +it("should compile", () => {}); diff --git a/test/configCases/chunk-index/order-multiple-entries/shared.js b/test/configCases/chunk-index/order-multiple-entries/shared.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/chunk-index/order-multiple-entries/test.config.js b/test/configCases/chunk-index/order-multiple-entries/test.config.js new file mode 100644 index 000000000..65c1791bc --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle: function(i, options) { + return ["entry1.js", "entry2.js"]; + } +}; diff --git a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js new file mode 100644 index 000000000..52dd63192 --- /dev/null +++ b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js @@ -0,0 +1,95 @@ +/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../lib/Module")} Module */ + +module.exports = { + entry: { + entry1: "./entry1", + entry2: "./entry2" + }, + output: { + filename: "[name].js" + }, + plugins: [ + function() { + /** + * @param {Compilation} compilation compilation + * @returns {void} + */ + const handler = compilation => { + compilation.hooks.afterSeal.tap("testcase", () => { + const data = {}; + for (const [name, group] of compilation.namedChunkGroups) { + /** @type {Map} */ + const modules = new Map(); + const modules2 = new Map(); + for (const chunk of group.chunks) { + for (const module of chunk.modulesIterable) { + modules.set(module, group.getModuleIndex(module)); + modules2.set(module, group.getModuleIndex2(module)); + } + } + const sortedModules = Array.from(modules).sort((a, b) => { + return a[1] - b[1]; + }); + const sortedModules2 = Array.from(modules2).sort((a, b) => { + return a[1] - b[1]; + }); + const text = sortedModules + .map( + ([m, index]) => + `${index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + const text2 = sortedModules2 + .map( + ([m, index]) => + `${index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + data[name + "Index"] = text; + data[name + "Index2"] = text2; + } + expect(data).toEqual({ + entry1Index: + "0: ./entry1.js, 1: ./a.js, 2: ./shared.js, 3: ./b.js, 4: ./c.js", + entry1Index2: + "0: ./shared.js, 1: ./a.js, 2: ./b.js, 3: ./c.js, 4: ./entry1.js", + entry2Index: + "0: ./entry2.js, 1: ./c.js, 2: ./b.js, 3: ./shared.js, 4: ./a.js", + entry2Index2: + "0: ./c.js, 1: ./shared.js, 2: ./b.js, 3: ./a.js, 4: ./entry2.js", + asyncIndex: "0: ./async.js", + asyncIndex2: "0: ./async.js" + }); + const indicies = compilation.modules + .map( + m => + `${m.index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + const indicies2 = compilation.modules + .map( + m => + `${m.index2}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + expect(indicies).toEqual( + "2: ./shared.js, 4: ./c.js, 3: ./b.js, 1: ./a.js, 6: ./async.js, 5: ./entry2.js, 0: ./entry1.js" + ); + expect(indicies2).toEqual( + "0: ./shared.js, 3: ./c.js, 2: ./b.js, 1: ./a.js, 6: ./async.js, 5: ./entry2.js, 4: ./entry1.js" + ); + }); + }; + this.hooks.compilation.tap("testcase", handler); + } + ] +}; diff --git a/test/configCases/crossorigin/set-crossorigin/empty.js b/test/configCases/crossorigin/set-crossorigin/empty.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/configCases/crossorigin/set-crossorigin/index.js b/test/configCases/crossorigin/set-crossorigin/index.js new file mode 100644 index 000000000..6330978d1 --- /dev/null +++ b/test/configCases/crossorigin/set-crossorigin/index.js @@ -0,0 +1,67 @@ +it("should load script without crossorigin attribute (default)", function() { + const promise = import("./empty?a" /* webpackChunkName: "crossorigin-default" */); + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-default.web.js"); + expect(script.src).toBe("https://test.cases/path/crossorigin-default.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (relative)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "../"; + const promise = import("./empty?b" /* webpackChunkName: "crossorigin-relative" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-relative.web.js"); + expect(script.src).toBe("https://test.cases/crossorigin-relative.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (server relative)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "/server/"; + const promise = import("./empty?c" /* webpackChunkName: "crossorigin-server-relative" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-server-relative.web.js"); + expect(script.src).toBe("https://test.cases/server/crossorigin-server-relative.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script without crossorigin attribute (same origin)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "https://test.cases/"; + const promise = import("./empty?d" /* webpackChunkName: "crossorigin-same-origin" */); + __webpack_public_path__ = originalValue; + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-same-origin.web.js"); + expect(script.src).toBe("https://test.cases/crossorigin-same-origin.web.js"); + expect(script.crossOrigin).toBe(undefined); + + return promise; +}); + +it("should load script with crossorigin attribute anonymous (different origin)", function() { + var originalValue = __webpack_public_path__; + __webpack_public_path__ = "https://example.com/"; + const promise = import("./empty?e" /* webpackChunkName: "crossorigin-different-origin" */); + __webpack_public_path__ = originalValue; + + + var script = document.head._children.pop(); + __non_webpack_require__("./crossorigin-different-origin.web.js"); + expect(script.src).toBe("https://example.com/crossorigin-different-origin.web.js"); + expect(script.crossOrigin).toBe("anonymous"); + + return promise; +}); diff --git a/test/configCases/crossorigin/set-crossorigin/webpack.config.js b/test/configCases/crossorigin/set-crossorigin/webpack.config.js new file mode 100644 index 000000000..68eeb96a5 --- /dev/null +++ b/test/configCases/crossorigin/set-crossorigin/webpack.config.js @@ -0,0 +1,13 @@ +module.exports = { + target: "web", + output: { + chunkFilename: "[name].web.js", + crossOriginLoading: "anonymous" + }, + performance: { + hints: false + }, + optimization: { + minimize: false + } +}; diff --git a/test/configCases/optimization/hashed-module-ids/files/file1.js b/test/configCases/optimization/hashed-module-ids/files/file1.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file1.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file2.js b/test/configCases/optimization/hashed-module-ids/files/file2.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file2.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file3.js b/test/configCases/optimization/hashed-module-ids/files/file3.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file3.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file4.js b/test/configCases/optimization/hashed-module-ids/files/file4.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file4.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/files/file5.js b/test/configCases/optimization/hashed-module-ids/files/file5.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/files/file5.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/hashed-module-ids/index.js b/test/configCases/optimization/hashed-module-ids/index.js new file mode 100644 index 000000000..93aeb5474 --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/index.js @@ -0,0 +1,7 @@ +it("should have named modules ids", function() { + for (var i = 1; i <= 5; i++) { + var moduleId = require("./files/file" + i + ".js"); + + expect(moduleId).toMatch(/^[/=a-zA-Z0-9]{4,5}$/); + } +}); diff --git a/test/configCases/optimization/hashed-module-ids/webpack.config.js b/test/configCases/optimization/hashed-module-ids/webpack.config.js new file mode 100644 index 000000000..19d544d1d --- /dev/null +++ b/test/configCases/optimization/hashed-module-ids/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + optimization: { + hashedModuleIds: true + } +}; diff --git a/test/configCases/optimization/named-modules/files/file1.js b/test/configCases/optimization/named-modules/files/file1.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file1.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file2.js b/test/configCases/optimization/named-modules/files/file2.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file2.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file3.js b/test/configCases/optimization/named-modules/files/file3.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file3.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file4.js b/test/configCases/optimization/named-modules/files/file4.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file4.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/files/file5.js b/test/configCases/optimization/named-modules/files/file5.js new file mode 100644 index 000000000..3cec1b77a --- /dev/null +++ b/test/configCases/optimization/named-modules/files/file5.js @@ -0,0 +1 @@ +module.exports = module.id; diff --git a/test/configCases/optimization/named-modules/index.js b/test/configCases/optimization/named-modules/index.js new file mode 100644 index 000000000..082bc1bda --- /dev/null +++ b/test/configCases/optimization/named-modules/index.js @@ -0,0 +1,10 @@ +var path = require("path"); + +it("should have named modules ids", function() { + for (var i = 1; i <= 5; i++) { + var expectedModuleId = "file" + i + ".js"; + var moduleId = require("./files/file" + i + ".js"); + + expect(path.basename(moduleId)).toBe(expectedModuleId); + } +}); diff --git a/test/configCases/optimization/named-modules/webpack.config.js b/test/configCases/optimization/named-modules/webpack.config.js new file mode 100644 index 000000000..10572c1da --- /dev/null +++ b/test/configCases/optimization/named-modules/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + optimization: { + namedModules: true + } +}; diff --git a/test/configCases/split-chunks/runtime-chunk/a.js b/test/configCases/split-chunks/runtime-chunk/a.js index e13568489..fcae91623 100644 --- a/test/configCases/split-chunks/runtime-chunk/a.js +++ b/test/configCases/split-chunks/runtime-chunk/a.js @@ -2,7 +2,7 @@ it("should be able to load the split chunk on demand", () => { const promise = import(/* webpackChunkName: "shared" */ "./shared"); const script = document.head._children[0]; - expect(script.src).toBe("dep~b~shared.js"); + expect(script.src).toBe("https://test.cases/path/dep~b~shared.js"); __non_webpack_require__("./dep~b~shared.js"); diff --git a/test/configCases/web/prefetch-preload/index.js b/test/configCases/web/prefetch-preload/index.js index 2d393f55a..dec98a7cc 100644 --- a/test/configCases/web/prefetch-preload/index.js +++ b/test/configCases/web/prefetch-preload/index.js @@ -10,11 +10,11 @@ beforeEach(() => { afterEach(() => { __webpack_nonce__ = oldNonce; __webpack_public_path__ = oldPublicPath; -}) +}); it("should prefetch and preload child chunks on chunk load", () => { __webpack_nonce__ = "nonce"; - __webpack_public_path__ = "/public/path/"; + __webpack_public_path__ = "https://example.com/public/path/"; let link, script; diff --git a/test/helpers/FakeDocument.js b/test/helpers/FakeDocument.js index 0c9d80de0..680c51576 100644 --- a/test/helpers/FakeDocument.js +++ b/test/helpers/FakeDocument.js @@ -20,6 +20,8 @@ class FakeElement { this._type = type; this._children = []; this._attributes = Object.create(null); + this._src = undefined; + this._href = undefined; } appendChild(node) { @@ -33,4 +35,40 @@ class FakeElement { getAttribute(name) { return this._attributes[name]; } + + _toRealUrl(value) { + if (/^\//.test(value)) { + return `https://test.cases${value}`; + } else if (/^\.\.\//.test(value)) { + return `https://test.cases${value.substr(2)}`; + } else if (/^\.\//.test(value)) { + return `https://test.cases/path${value.substr(1)}`; + } else if (/^\w+:\/\//.test(value)) { + return value; + } else if (/^\/\//.test(value)) { + return `https:${value}`; + } else { + return `https://test.cases/path/${value}`; + } + } + + set src(value) { + if (this._type === "script") { + this._src = this._toRealUrl(value); + } + } + + get src() { + return this._src; + } + + set href(value) { + if (this._type === "link") { + this._href = this._toRealUrl(value); + } + } + + get href() { + return this._href; + } } diff --git a/test/statsCases/define-plugin/123.txt b/test/statsCases/define-plugin/123.txt new file mode 100644 index 000000000..190a18037 --- /dev/null +++ b/test/statsCases/define-plugin/123.txt @@ -0,0 +1 @@ +123 diff --git a/test/statsCases/define-plugin/321.txt b/test/statsCases/define-plugin/321.txt new file mode 100644 index 000000000..3ae0b938f --- /dev/null +++ b/test/statsCases/define-plugin/321.txt @@ -0,0 +1 @@ +321 diff --git a/test/statsCases/define-plugin/webpack.config.js b/test/statsCases/define-plugin/webpack.config.js index 999dc282d..32d87e4f8 100644 --- a/test/statsCases/define-plugin/webpack.config.js +++ b/test/statsCases/define-plugin/webpack.config.js @@ -1,4 +1,11 @@ var webpack = require("../../../"); +var fs = require("fs"); +var join = require("path").join; + +function read(path) { + return JSON.stringify(fs.readFileSync(join(__dirname, path), "utf8")); +} + module.exports = [ { mode: "production", @@ -18,5 +25,22 @@ module.exports = [ VALUE: "321" }) ] + }, + + { + mode: "production", + entry: "./index", + plugins: [ + new webpack.DefinePlugin({ + VALUE: webpack.DefinePlugin.runtimeValue(() => read("123.txt"), [ + "./123.txt" + ]) + }), + new webpack.DefinePlugin({ + VALUE: webpack.DefinePlugin.runtimeValue(() => read("321.txt"), [ + "./321.txt" + ]) + }) + ] } ]; diff --git a/test/watchCases/plugins/define-plugin/0/index.js b/test/watchCases/plugins/define-plugin/0/index.js new file mode 100644 index 000000000..182e0f038 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/index.js @@ -0,0 +1,17 @@ +it("should be able to use dynamic defines in watch mode", function() { + const module = require("./module"); + expect(module).toEqual({ + default: WATCH_STEP, + type: "string", + [Symbol.toStringTag]: "Module" + }); +}); + +it("should not update a define when dependencies list is missing", function() { + const module2 = require("./module2"); + expect(module2).toEqual({ + default: "0", + type: "string", + [Symbol.toStringTag]: "Module" + }); +}); diff --git a/test/watchCases/plugins/define-plugin/0/module.js b/test/watchCases/plugins/define-plugin/0/module.js new file mode 100644 index 000000000..272cd4dea --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/module.js @@ -0,0 +1,2 @@ +export default TEST_VALUE; +export const type = typeof TEST_VALUE; diff --git a/test/watchCases/plugins/define-plugin/0/module2.js b/test/watchCases/plugins/define-plugin/0/module2.js new file mode 100644 index 000000000..4bac84778 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/module2.js @@ -0,0 +1,2 @@ +export default TEST_VALUE2; +export const type = typeof TEST_VALUE2; diff --git a/test/watchCases/plugins/define-plugin/0/value.txt b/test/watchCases/plugins/define-plugin/0/value.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/0/value.txt @@ -0,0 +1 @@ +0 diff --git a/test/watchCases/plugins/define-plugin/1/value.txt b/test/watchCases/plugins/define-plugin/1/value.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/1/value.txt @@ -0,0 +1 @@ +1 diff --git a/test/watchCases/plugins/define-plugin/webpack.config.js b/test/watchCases/plugins/define-plugin/webpack.config.js new file mode 100644 index 000000000..113eb10e5 --- /dev/null +++ b/test/watchCases/plugins/define-plugin/webpack.config.js @@ -0,0 +1,22 @@ +const path = require("path"); +const fs = require("fs"); +const webpack = require("../../../../"); +const valueFile = path.resolve( + __dirname, + "../../../js/watch-src/plugins/define-plugin/value.txt" +); +module.exports = { + plugins: [ + new webpack.DefinePlugin({ + TEST_VALUE: webpack.DefinePlugin.runtimeValue( + () => { + return JSON.stringify(fs.readFileSync(valueFile, "utf-8").trim()); + }, + [valueFile] + ), + TEST_VALUE2: webpack.DefinePlugin.runtimeValue(() => { + return JSON.stringify(fs.readFileSync(valueFile, "utf-8").trim()); + }, []) + }) + ] +}; diff --git a/yarn.lock b/yarn.lock index bee3f7cbb..534a500cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1750,9 +1750,9 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a" +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0"