Merge tag 'v4.34.0' into next

4.34.0
This commit is contained in:
Tobias Koppers 2019-06-13 10:51:12 +02:00
commit 6db94536ad
55 changed files with 766 additions and 553 deletions

1
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1 @@
[Code of Conduct](https://js.foundation/community/code-of-conduct)

2
declarations.d.ts vendored
View File

@ -59,7 +59,7 @@ declare module "neo-async" {
}
export type AsyncAutoTasks<R extends Dictionary<any>, E> = {
[K in keyof R]: AsyncAutoTask<R[K], R, E>
[K in keyof R]: AsyncAutoTask<R[K], R, E>;
};
export type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
| AsyncAutoTaskFunctionWithoutDependencies<R1, E>

View File

@ -40,10 +40,10 @@ if (module.hot) {
"warning",
"[HMR] Cannot apply update. Need to do a full reload!"
);
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] " + log.formatError(err));
window.location.reload();
} else {
log("warning", "[HMR] Update failed: " + (err.stack || err.message));
log("warning", "[HMR] Update failed: " + log.formatError(err));
}
});
};

View File

@ -45,3 +45,15 @@ module.exports.groupEnd = logGroup(groupEnd);
module.exports.setLogLevel = function(level) {
logLevel = level;
};
module.exports.formatError = function(err) {
var message = err.message;
var stack = err.stack;
if (!stack) {
return message;
} else if (stack.indexOf(message) < 0) {
return message + "\n" + stack;
} else {
return stack;
}
};

View File

@ -72,12 +72,9 @@ if (module.hot) {
"warning",
"[HMR] Cannot check for update. Need to do a full reload!"
);
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] " + log.formatError(err));
} else {
log(
"warning",
"[HMR] Update check failed: " + (err.stack || err.message)
);
log("warning", "[HMR] Update check failed: " + log.formatError(err));
}
});
};

View File

@ -23,13 +23,10 @@ if (module.hot) {
var status = module.hot.status();
if (["abort", "fail"].indexOf(status) >= 0) {
log("warning", "[HMR] Cannot apply update.");
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] " + log.formatError(err));
log("warning", "[HMR] You need to restart the application!");
} else {
log(
"warning",
"[HMR] Update failed: " + (err.stack || err.message)
);
log("warning", "[HMR] Update failed: " + log.formatError(err));
}
});
}

View File

@ -37,7 +37,7 @@ if (module.hot) {
var status = module.hot.status();
if (["abort", "fail"].indexOf(status) >= 0) {
log("warning", "[HMR] Cannot apply update.");
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] " + log.formatError(err));
log("warning", "[HMR] You need to restart the application!");
} else {
log("warning", "[HMR] Update failed: " + (err.stack || err.message));

View File

@ -527,18 +527,14 @@ class ChunkGroup {
for (const child of chunk._children) {
if (!child._parents.has(chunk)) {
throw new Error(
`checkConstraints: child missing parent ${chunk.debugId} -> ${
child.debugId
}`
`checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}`
);
}
}
for (const parentChunk of chunk._parents) {
if (!parentChunk._children.has(chunk)) {
throw new Error(
`checkConstraints: parent missing child ${parentChunk.debugId} <- ${
chunk.debugId
}`
`checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}`
);
}
}

View File

@ -86,9 +86,7 @@ class CommonJsStuffPlugin {
"CommonJsStuffPlugin",
toConstantDependency(
parser,
`${RuntimeGlobals.moduleCache}[${
RuntimeGlobals.entryModuleId
}]`,
`${RuntimeGlobals.moduleCache}[${RuntimeGlobals.entryModuleId}]`,
[RuntimeGlobals.moduleCache, RuntimeGlobals.entryModuleId]
)
);

View File

@ -770,9 +770,7 @@ class Compilation {
const factory = this.dependencyFactories.get(dep.constructor);
if (factory === undefined) {
throw new Error(
`No module factory available for dependency type: ${
dep.constructor.name
}`
`No module factory available for dependency type: ${dep.constructor.name}`
);
}
let innerMap = dependencies.get(factory);
@ -1059,9 +1057,7 @@ class Compilation {
if (!moduleFactory) {
return callback(
new WebpackError(
`No dependency factory available for this dependency type: ${
dependency.constructor.name
}`
`No dependency factory available for this dependency type: ${dependency.constructor.name}`
)
);
}

View File

@ -465,9 +465,7 @@ class ContextModule extends Module {
if (typeof fakeMap === "number") {
return `return ${this.getReturn(fakeMap)};`;
}
return `return ${
RuntimeGlobals.createFakeNamespaceObject
}(id, ${fakeMapDataExpression})`;
return `return ${RuntimeGlobals.createFakeNamespaceObject}(id, ${fakeMapDataExpression})`;
}
/**
@ -741,9 +739,7 @@ module.exports = webpackAsyncContext;`;
const requestPrefix = hasNoChunk
? "Promise.resolve()"
: hasMultipleOrNoChunks
? `Promise.all(ids.slice(${chunksStartPosition}).map(${
RuntimeGlobals.ensureChunk
}))`
? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))`
: `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`;
const returnModuleObject = this.getReturnModuleObjectSource(
fakeMap,

View File

@ -10,7 +10,6 @@ const { SyncBailHook, HookMap } = require("tapable");
const vm = require("vm");
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
const StackedSetMap = require("./util/StackedSetMap");
const TrackingSet = require("./util/TrackingSet");
// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API
@ -37,8 +36,6 @@ const defaultParserOptions = {
// regexp to match at lease one "magic comment"
const webpackCommentRegExp = new RegExp(/(^|\W)webpack[A-Z]{1,}[A-Za-z]{1,}:/);
const EMPTY_ARRAY = [];
const EMPTY_COMMENT_OPTIONS = {
options: null,
errors: null
@ -855,6 +852,14 @@ class JavascriptParser {
}
}
// Block-Prewalking iterates the scope for block variable declarations
blockPrewalkStatements(statements) {
for (let index = 0, len = statements.length; index < len; index++) {
const statement = statements[index];
this.blockPrewalkStatement(statement);
}
}
// Walking iterates the statements and expressions and processes them
walkStatements(statements) {
for (let index = 0, len = statements.length; index < len; index++) {
@ -868,9 +873,6 @@ class JavascriptParser {
case "BlockStatement":
this.prewalkBlockStatement(statement);
break;
case "ClassDeclaration":
this.prewalkClassDeclaration(statement);
break;
case "DoWhileStatement":
this.prewalkDoWhileStatement(statement);
break;
@ -922,6 +924,23 @@ class JavascriptParser {
}
}
blockPrewalkStatement(statement) {
switch (statement.type) {
case "VariableDeclaration":
this.blockPrewalkVariableDeclaration(statement);
break;
case "ExportDefaultDeclaration":
this.blockPrewalkExportDefaultDeclaration(statement);
break;
case "ExportNamedDeclaration":
this.blockPrewalkExportNamedDeclaration(statement);
break;
case "ClassDeclaration":
this.blockPrewalkClassDeclaration(statement);
break;
}
}
walkStatement(statement) {
if (this.hooks.statement.call(statement) !== undefined) return;
switch (statement.type) {
@ -991,7 +1010,11 @@ class JavascriptParser {
}
walkBlockStatement(statement) {
this.walkStatements(statement.body);
this.inBlockScope(() => {
const body = statement.body;
this.blockPrewalkStatements(body);
this.walkStatements(body);
});
}
walkExpressionStatement(statement) {
@ -1109,20 +1132,30 @@ class JavascriptParser {
}
walkForStatement(statement) {
if (statement.init) {
if (statement.init.type === "VariableDeclaration") {
this.walkStatement(statement.init);
} else {
this.walkExpression(statement.init);
this.inBlockScope(() => {
if (statement.init) {
if (statement.init.type === "VariableDeclaration") {
this.blockPrewalkVariableDeclaration(statement.init);
this.walkStatement(statement.init);
} else {
this.walkExpression(statement.init);
}
}
}
if (statement.test) {
this.walkExpression(statement.test);
}
if (statement.update) {
this.walkExpression(statement.update);
}
this.walkStatement(statement.body);
if (statement.test) {
this.walkExpression(statement.test);
}
if (statement.update) {
this.walkExpression(statement.update);
}
const body = statement.body;
if (body.type === "BlockStatement") {
// no need to add additional scope
this.blockPrewalkStatements(body.body);
this.walkStatements(body.body);
} else {
this.walkStatement(body);
}
});
}
prewalkForInStatement(statement) {
@ -1133,13 +1166,23 @@ class JavascriptParser {
}
walkForInStatement(statement) {
if (statement.left.type === "VariableDeclaration") {
this.walkVariableDeclaration(statement.left);
} else {
this.walkPattern(statement.left);
}
this.walkExpression(statement.right);
this.walkStatement(statement.body);
this.inBlockScope(() => {
if (statement.left.type === "VariableDeclaration") {
this.blockPrewalkVariableDeclaration(statement.left);
this.walkVariableDeclaration(statement.left);
} else {
this.walkPattern(statement.left);
}
this.walkExpression(statement.right);
const body = statement.body;
if (body.type === "BlockStatement") {
// no need to add additional scope
this.blockPrewalkStatements(body.body);
this.walkStatements(body.body);
} else {
this.walkStatement(body);
}
});
}
prewalkForOfStatement(statement) {
@ -1153,13 +1196,23 @@ class JavascriptParser {
}
walkForOfStatement(statement) {
if (statement.left.type === "VariableDeclaration") {
this.walkVariableDeclaration(statement.left);
} else {
this.walkPattern(statement.left);
}
this.walkExpression(statement.right);
this.walkStatement(statement.body);
this.inBlockScope(() => {
if (statement.left.type === "VariableDeclaration") {
this.blockPrewalkVariableDeclaration(statement.left);
this.walkVariableDeclaration(statement.left);
} else {
this.walkPattern(statement.left);
}
this.walkExpression(statement.right);
const body = statement.body;
if (body.type === "BlockStatement") {
// no need to add additional scope
this.blockPrewalkStatements(body.body);
this.walkStatements(body.body);
} else {
this.walkStatement(body);
}
});
}
// Declarations
@ -1173,7 +1226,7 @@ class JavascriptParser {
walkFunctionDeclaration(statement) {
const wasTopLevel = this.scope.topLevelScope;
this.scope.topLevelScope = false;
this.inScope(statement.params, () => {
this.inFunctionScope(true, statement.params, () => {
for (const param of statement.params) {
this.walkPattern(param);
}
@ -1214,6 +1267,33 @@ class JavascriptParser {
}
}
enterDeclaration(declaration, onIdent) {
switch (declaration.type) {
case "VariableDeclaration":
for (const declarator of declaration.declarations) {
switch (declarator.type) {
case "VariableDeclarator": {
this.enterPattern(declarator.id, onIdent);
break;
}
}
}
break;
case "FunctionDeclaration":
this.enterPattern(declaration.id, onIdent);
break;
case "ClassDeclaration":
this.enterPattern(declaration.id, onIdent);
break;
}
}
blockPrewalkExportNamedDeclaration(statement) {
if (statement.declaration) {
this.blockPrewalkStatement(statement.declaration);
}
}
prewalkExportNamedDeclaration(statement) {
let source;
if (statement.source) {
@ -1226,16 +1306,11 @@ class JavascriptParser {
if (
!this.hooks.exportDeclaration.call(statement, statement.declaration)
) {
const originalDefinitions = this.scope.definitions;
const tracker = new TrackingSet(this.scope.definitions);
this.scope.definitions = tracker;
this.prewalkStatement(statement.declaration);
const newDefs = Array.from(tracker.getAddedItems());
this.scope.definitions = originalDefinitions;
for (let index = newDefs.length - 1; index >= 0; index--) {
const def = newDefs[index];
this.hooks.exportSpecifier.call(statement, def, def, index);
}
let index = 0;
this.enterDeclaration(statement.declaration, def => {
this.hooks.exportSpecifier.call(statement, def, def, index++);
});
}
}
if (statement.specifiers) {
@ -1277,18 +1352,24 @@ class JavascriptParser {
}
}
blockPrewalkExportDefaultDeclaration(statement) {
if (statement.declaration.type === "ClassDeclaration") {
this.blockPrewalkClassDeclaration(statement.declaration);
}
}
prewalkExportDefaultDeclaration(statement) {
if (statement.declaration.id) {
const originalDefinitions = this.scope.definitions;
const tracker = new TrackingSet(this.scope.definitions);
this.scope.definitions = tracker;
this.prewalkStatement(statement.declaration);
const newDefs = Array.from(tracker.getAddedItems());
this.scope.definitions = originalDefinitions;
for (let index = 0, len = newDefs.length; index < len; index++) {
const def = newDefs[index];
this.hooks.exportSpecifier.call(statement, def, "default");
}
this.prewalkStatement(statement.declaration);
if (
statement.declaration.id &&
statement.declaration.type !== "FunctionExpression" &&
statement.declaration.type !== "ClassExpression"
) {
this.hooks.exportSpecifier.call(
statement,
statement.declaration.id.name,
"default"
);
}
}
@ -1332,12 +1413,20 @@ class JavascriptParser {
}
prewalkVariableDeclaration(statement) {
if (statement.kind !== "var") return;
this._prewalkVariableDeclaration(statement, this.hooks.varDeclarationVar);
}
blockPrewalkVariableDeclaration(statement) {
if (statement.kind === "var") return;
const hookMap =
statement.kind === "const"
? this.hooks.varDeclarationConst
: statement.kind === "let"
? this.hooks.varDeclarationLet
: this.hooks.varDeclarationVar;
: this.hooks.varDeclarationLet;
this._prewalkVariableDeclaration(statement, hookMap);
}
_prewalkVariableDeclaration(statement, hookMap) {
for (const declarator of statement.declarations) {
switch (declarator.type) {
case "VariableDeclarator": {
@ -1386,7 +1475,7 @@ class JavascriptParser {
}
}
prewalkClassDeclaration(statement) {
blockPrewalkClassDeclaration(statement) {
if (statement.id) {
this.scope.renames.set(statement.id.name, null);
this.scope.definitions.add(statement.id.name);
@ -1416,11 +1505,15 @@ class JavascriptParser {
}
walkCatchClause(catchClause) {
// Error binding is optional in catch clause since ECMAScript 2019
const errorBinding =
catchClause.param === null ? EMPTY_ARRAY : [catchClause.param];
this.inScope(errorBinding, () => {
this.inBlockScope(() => {
// Error binding is optional in catch clause since ECMAScript 2019
if (catchClause.param !== null) {
this.enterPattern(catchClause.param, ident => {
this.scope.renames.set(ident, null);
this.scope.definitions.add(ident);
});
this.walkPattern(catchClause.param);
}
this.prewalkStatement(catchClause.body);
this.walkStatement(catchClause.body);
});
@ -1603,7 +1696,7 @@ class JavascriptParser {
scopeParams.push(expression.id.name);
}
this.inScope(scopeParams, () => {
this.inFunctionScope(true, scopeParams, () => {
for (const param of expression.params) {
this.walkPattern(param);
}
@ -1621,7 +1714,7 @@ class JavascriptParser {
walkArrowFunctionExpression(expression) {
const wasTopLevel = this.scope.topLevelScope;
this.scope.topLevelScope = wasTopLevel ? "arrow" : false;
this.inScope(expression.params, () => {
this.inFunctionScope(false, expression.params, () => {
for (const param of expression.params) {
this.walkPattern(param);
}
@ -1797,7 +1890,7 @@ class JavascriptParser {
scopeParams.push(functionExpression.id.name);
}
this.inScope(scopeParams, () => {
this.inFunctionScope(true, scopeParams, () => {
if (renameThis) {
this.scope.renames.set("this", renameThis);
}
@ -1912,6 +2005,12 @@ class JavascriptParser {
}
}
/**
* @deprecated
* @param {any} params scope params
* @param {function(): void} fn inner function
* @returns {void}
*/
inScope(params, fn) {
const oldScope = this.scope;
this.scope = {
@ -1925,22 +2024,60 @@ class JavascriptParser {
this.scope.renames.set("this", null);
for (const param of params) {
if (typeof param !== "string") {
this.enterPattern(param, (param, pattern) => {
const hook = this.hooks.pattern.get(param);
if (!hook || hook.call(pattern) !== true) {
this.scope.renames.set(param, null);
this.scope.definitions.add(param);
}
});
} else if (param) {
this.scope.renames.set(param, null);
this.scope.definitions.add(param);
this.enterPatterns(params, (ident, pattern) => {
const hook = pattern && this.hooks.pattern.get(ident);
if (!hook || hook.call(pattern) !== true) {
this.scope.renames.set(ident, null);
this.scope.definitions.add(ident);
}
}
});
fn();
this.scope = oldScope;
}
inFunctionScope(hasThis, params, fn) {
const oldScope = this.scope;
this.scope = {
topLevelScope: oldScope.topLevelScope,
inTry: false,
inShorthand: false,
isStrict: oldScope.isStrict,
definitions: oldScope.definitions.createChild(),
renames: oldScope.renames.createChild()
};
if (hasThis) {
this.scope.renames.set("this", null);
}
this.enterPatterns(params, (ident, pattern) => {
const hook = pattern && this.hooks.pattern.get(ident);
if (!hook || hook.call(pattern) !== true) {
this.scope.renames.set(ident, null);
this.scope.definitions.add(ident);
}
});
fn();
this.scope = oldScope;
}
inBlockScope(fn) {
const oldScope = this.scope;
this.scope = {
topLevelScope: oldScope.topLevelScope,
inTry: oldScope.inTry,
inShorthand: false,
isStrict: oldScope.isStrict,
definitions: oldScope.definitions.createChild(),
renames: oldScope.renames.createChild()
};
fn();
this.scope = oldScope;
}
@ -1955,6 +2092,16 @@ class JavascriptParser {
}
}
enterPatterns(patterns, onIdent) {
for (const pattern of patterns) {
if (typeof pattern !== "string") {
this.enterPattern(pattern, onIdent);
} else if (pattern) {
onIdent(pattern);
}
}
}
enterPattern(pattern, onIdent) {
if (!pattern) return;
switch (pattern.type) {
@ -2156,6 +2303,7 @@ class JavascriptParser {
if (this.hooks.program.call(ast, comments) === undefined) {
this.detectStrictMode(ast.body);
this.prewalkStatements(ast.body);
this.blockPrewalkStatements(ast.body);
this.walkStatements(ast.body);
}
this.scope = oldScope;

View File

@ -136,9 +136,7 @@ module.exports = class MainTemplate {
const moduleId = chunkGraph.getModuleId(entryModule);
let moduleIdExpr = JSON.stringify(moduleId);
if (runtimeRequirements.has(RuntimeGlobals.entryModuleId)) {
moduleIdExpr = `${
RuntimeGlobals.entryModuleId
} = ${moduleIdExpr}`;
moduleIdExpr = `${RuntimeGlobals.entryModuleId} = ${moduleIdExpr}`;
}
buf.push(`${mayReturn}__webpack_require__(${moduleIdExpr});`);
}
@ -230,9 +228,7 @@ module.exports = class MainTemplate {
)
? Template.asString([
"var execOptions = { id: moduleId, module: module, factory: modules[moduleId], require: __webpack_require__ };",
`${
RuntimeGlobals.interceptModuleExecution
}.forEach(function(handler) { handler(execOptions); });`,
`${RuntimeGlobals.interceptModuleExecution}.forEach(function(handler) { handler(execOptions); });`,
"module = execOptions.module;",
"execOptions.factory.call(module.exports, module, module.exports, execOptions.require);"
])

View File

@ -464,9 +464,7 @@ class ExportInfo {
}
}
throw new Error(
`Unexpected flags for canMangle ${this.canMangleProvide} ${
this.canMangleUse
}`
`Unexpected flags for canMangle ${this.canMangleProvide} ${this.canMangleUse}`
);
}
@ -541,9 +539,7 @@ class ExportInfo {
break;
}
throw new Error(
`Unexpected flags for getRenameInfo ${this.canMangleProvide} ${
this.canMangleUse
}`
`Unexpected flags for getRenameInfo ${this.canMangleProvide} ${this.canMangleUse}`
);
}
}

View File

@ -12,12 +12,22 @@ class ModuleParseError extends WebpackError {
/**
* @param {string} source source code
* @param {Error&any} err the parse error
* @param {string[]} loaders the loaders used
*/
constructor(source, err) {
constructor(source, err, loaders) {
let message = "Module parse failed: " + (err && err.message);
let loc = undefined;
message += "\nYou may need an appropriate loader to handle this file type.";
if (loaders.length >= 1) {
message += `\nFile was processed with these loaders:${loaders
.map(loader => `\n * ${loader}`)
.join("")}`;
message +=
"\nYou may need an additional loader to handle the result of these loaders.";
} else {
message +=
"\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders";
}
if (
err &&
@ -31,7 +41,7 @@ class ModuleParseError extends WebpackError {
// binary file
message += "\n(Source code omitted for this binary file)";
} else {
const sourceLines = source.split("\n");
const sourceLines = source.split(/\r?\n/);
const start = Math.max(0, lineNumber - 3);
const linesBefore = sourceLines.slice(start, lineNumber - 1);
const theLine = sourceLines[lineNumber - 1];

View File

@ -469,7 +469,6 @@ class NormalModule extends Module {
markModuleAsErrored(error) {
// Restore build meta from successful build to keep importing state
this.buildMeta = Object.assign({}, this._lastSuccessfulBuildMeta);
this.error = error;
this.errors.push(error);
}
@ -576,7 +575,10 @@ class NormalModule extends Module {
const handleParseError = e => {
const source = /** @type {string} */ (this._source.source());
const error = new ModuleParseError(source, e);
const loaders = this.loaders.map(item =>
contextify(options.context, item.loader)
);
const error = new ModuleParseError(source, e, loaders);
this.markModuleAsErrored(error);
this._initBuildHash(compilation);
return callback();

View File

@ -578,9 +578,7 @@ class NormalModuleFactory extends ModuleFactory {
err.message +
"\n" +
"BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" +
` You need to specify '${
item.loader
}-loader' instead of '${item.loader}',\n` +
` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` +
" see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed";
}
callback(err);

View File

@ -399,35 +399,23 @@ class RuntimeTemplate {
} else if (exportsType === "named") {
runtimeRequirements.add(RuntimeGlobals.createFakeNamespaceObject);
if (header) {
getModuleFunction = `function() { ${header}return ${
RuntimeGlobals.createFakeNamespaceObject
}(${moduleIdExpr}, 3); }`;
getModuleFunction = `function() { ${header}return ${RuntimeGlobals.createFakeNamespaceObject}(${moduleIdExpr}, 3); }`;
} else {
getModuleFunction = `${
RuntimeGlobals.createFakeNamespaceObject
}.bind(__webpack_require__, ${comment}${idExpr}, 3)`;
getModuleFunction = `${RuntimeGlobals.createFakeNamespaceObject}.bind(__webpack_require__, ${comment}${idExpr}, 3)`;
}
} else if (strict) {
runtimeRequirements.add(RuntimeGlobals.createFakeNamespaceObject);
if (header) {
getModuleFunction = `function() { ${header}return ${
RuntimeGlobals.createFakeNamespaceObject
}(${moduleIdExpr}, 1); }`;
getModuleFunction = `function() { ${header}return ${RuntimeGlobals.createFakeNamespaceObject}(${moduleIdExpr}, 1); }`;
} else {
getModuleFunction = `${
RuntimeGlobals.createFakeNamespaceObject
}.bind(__webpack_require__, ${comment}${idExpr}, 1)`;
getModuleFunction = `${RuntimeGlobals.createFakeNamespaceObject}.bind(__webpack_require__, ${comment}${idExpr}, 1)`;
}
} else {
runtimeRequirements.add(RuntimeGlobals.createFakeNamespaceObject);
if (header) {
getModuleFunction = `function() { ${header}return ${
RuntimeGlobals.createFakeNamespaceObject
}(${moduleIdExpr}, 7); }`;
getModuleFunction = `function() { ${header}return ${RuntimeGlobals.createFakeNamespaceObject}(${moduleIdExpr}, 7); }`;
} else {
getModuleFunction = `${
RuntimeGlobals.createFakeNamespaceObject
}.bind(__webpack_require__, ${comment}${idExpr}, 7)`;
getModuleFunction = `${RuntimeGlobals.createFakeNamespaceObject}.bind(__webpack_require__, ${comment}${idExpr}, 7)`;
}
}
@ -491,20 +479,14 @@ class RuntimeTemplate {
if (!exportsType && !originModule.buildMeta.strictHarmonyModule) {
runtimeRequirements.add(RuntimeGlobals.compatGetDefaultExport);
content += `/* harmony import */ ${optDeclaration}${importVar}_default = /*#__PURE__*/${
RuntimeGlobals.compatGetDefaultExport
}(${importVar});\n`;
content += `/* harmony import */ ${optDeclaration}${importVar}_default = /*#__PURE__*/${RuntimeGlobals.compatGetDefaultExport}(${importVar});\n`;
}
if (exportsType === "named") {
runtimeRequirements.add(RuntimeGlobals.createFakeNamespaceObject);
if (Array.isArray(chunkGraph.moduleGraph.getProvidedExports(module))) {
content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/${
RuntimeGlobals.createFakeNamespaceObject
}(${moduleId}, 1);\n`;
content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/${RuntimeGlobals.createFakeNamespaceObject}(${moduleId}, 1);\n`;
} else {
content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/${
RuntimeGlobals.createFakeNamespaceObject
}(${moduleId});\n`;
content += `${optDeclaration}${importVar}_namespace = /*#__PURE__*/${RuntimeGlobals.createFakeNamespaceObject}(${moduleId});\n`;
}
}
return content;
@ -567,9 +549,7 @@ class RuntimeTemplate {
);
} else {
runtimeRequirements.add(RuntimeGlobals.createFakeNamespaceObject);
return `/*#__PURE__*/${
RuntimeGlobals.createFakeNamespaceObject
}(${importVar})`;
return `/*#__PURE__*/${RuntimeGlobals.createFakeNamespaceObject}(${importVar})`;
}
}
}

View File

@ -97,9 +97,7 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends NullD
// has function range but no array range
if (dep.functionRange && !dep.arrayRange) {
const startBlock = `${promise}.then((`;
const endBlock = `).bind(exports, __webpack_require__, exports, module)).catch(${
RuntimeGlobals.uncaughtErrorHandler
})`;
const endBlock = `).bind(exports, __webpack_require__, exports, module)).catch(${RuntimeGlobals.uncaughtErrorHandler})`;
runtimeRequirements.add(RuntimeGlobals.uncaughtErrorHandler);
source.replace(dep.outerRange[0], dep.functionRange[0] - 1, startBlock);

View File

@ -835,9 +835,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
initFragments.push(
new InitFragment(
content +
`${
RuntimeGlobals.definePropertyGetter
}(${exportsName}, __WEBPACK_IMPORT_KEY__, function(key) { return ${importVar}[key]; }.bind(0, __WEBPACK_IMPORT_KEY__));\n`,
`${RuntimeGlobals.definePropertyGetter}(${exportsName}, __WEBPACK_IMPORT_KEY__, function(key) { return ${importVar}[key]; }.bind(0, __WEBPACK_IMPORT_KEY__));\n`,
InitFragment.STAGE_HARMONY_IMPORTS,
dep.sourceOrder
)

View File

@ -107,16 +107,16 @@ class HarmonyImportDependency extends ModuleDependency {
// It's not an harmony module
if (
moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule &&
(ids.length === 0 || ids[0] !== "default")
(ids.length > 0 && ids[0] !== "default")
) {
// In strict harmony modules we only support the default export
const exportName =
ids.length > 0
? `the named export ${ids.map(id => `'${id}'`).join(".")}`
: "the namespace object";
return [
new HarmonyLinkingError(
`Can't import ${exportName} ${additionalMessage} from non EcmaScript module (only default export is available)`
`Can't import the named export ${ids
.map(id => `'${id}'`)
.join(
"."
)} ${additionalMessage} from non EcmaScript module (only default export is available)`
)
];
}

View File

@ -45,9 +45,7 @@ class ImportParserPlugin {
const { comment } = e;
parser.state.module.warnings.push(
new CommentCompilationWarning(
`Compilation error while processing magic comment(-s): /*${
comment.value
}*/: ${e.message}`,
`Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`,
comment.loc
)
);
@ -59,9 +57,7 @@ class ImportParserPlugin {
if (typeof importOptions.webpackIgnore !== "boolean") {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackIgnore\` expected a boolean, but received: ${
importOptions.webpackIgnore
}.`,
`\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`,
expr.loc
)
);
@ -76,9 +72,7 @@ class ImportParserPlugin {
if (typeof importOptions.webpackChunkName !== "string") {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackChunkName\` expected a string, but received: ${
importOptions.webpackChunkName
}.`,
`\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`,
expr.loc
)
);
@ -90,9 +84,7 @@ class ImportParserPlugin {
if (typeof importOptions.webpackMode !== "string") {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackMode\` expected a string, but received: ${
importOptions.webpackMode
}.`,
`\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`,
expr.loc
)
);
@ -108,9 +100,7 @@ class ImportParserPlugin {
} else {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackPrefetch\` expected true or a number, but received: ${
importOptions.webpackPrefetch
}.`,
`\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`,
expr.loc
)
);
@ -124,9 +114,7 @@ class ImportParserPlugin {
} else {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackPreload\` expected true or a number, but received: ${
importOptions.webpackPreload
}.`,
`\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`,
expr.loc
)
);
@ -139,9 +127,7 @@ class ImportParserPlugin {
) {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackInclude\` expected a regular expression, but received: ${
importOptions.webpackInclude
}.`,
`\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`,
expr.loc
)
);
@ -156,9 +142,7 @@ class ImportParserPlugin {
) {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
`\`webpackExclude\` expected a regular expression, but received: ${
importOptions.webpackExclude
}.`,
`\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`,
expr.loc
)
);

View File

@ -51,9 +51,7 @@ class LoaderPlugin {
if (factory === undefined) {
return callback(
new Error(
`No module factory available for dependency type: ${
dep.constructor.name
}`
`No module factory available for dependency type: ${dep.constructor.name}`
)
);
}

View File

@ -80,9 +80,7 @@ ModuleDecoratorDependency.Template = class ModuleDecoratorDependencyTemplate ext
runtimeRequirements.add(dep.decorator);
initFragments.push(
new InitFragment(
`/* module decorator */ ${module.moduleArgument} = ${dep.decorator}(${
module.moduleArgument
});\n`,
`/* module decorator */ ${module.moduleArgument} = ${dep.decorator}(${module.moduleArgument});\n`,
InitFragment.STAGE_PROVIDES,
0,
`module decorator ${chunkGraph.getModuleId(module)}`

View File

@ -90,9 +90,7 @@ RequireEnsureDependency.Template = class RequireEnsureDependencyTemplate extends
source.replace(
contentRange[1],
range[1] - 1,
`).bind(null, __webpack_require__)).catch(${
RuntimeGlobals.uncaughtErrorHandler
})`
`).bind(null, __webpack_require__)).catch(${RuntimeGlobals.uncaughtErrorHandler})`
);
}
}

View File

@ -63,9 +63,7 @@ class WebAssemblyImportDependency extends ModuleDependency {
) {
return [
new UnsupportedWebAssemblyFeatureError(
`Import "${this.name}" from "${this.request}" with ${
this.onlyDirectImport
} can only be used for direct wasm to wasm dependencies`
`Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies`
)
];
}

View File

@ -34,9 +34,7 @@ class ChunkModuleIdRangePlugin {
);
if (!chunk) {
throw new Error(
`ChunkModuleIdRangePlugin: Chunk with name '${
options.name
}"' was not found`
`ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found`
);
}

View File

@ -68,9 +68,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
"var promise = new Promise(function(resolve, reject) {",
Template.indent([
"installedChunkData = installedChunks[chunkId] = [resolve, reject];",
`var filename = require('path').join(__dirname, ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId));`,
`var filename = require('path').join(__dirname, ${RuntimeGlobals.getChunkScriptFilename}(chunkId));`,
"require('fs').readFile(filename, 'utf-8', function(err, content) {",
Template.indent([
"if(err) return reject(err);",
@ -82,9 +80,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
Template.indent([
`${
RuntimeGlobals.moduleFactories
}[moduleId] = moreModules[moduleId];`
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
]),
"}"
]),
@ -142,9 +138,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"return new Promise(function(resolve, reject) {",
Template.indent([
`var filename = require('path').join(__dirname, ${
RuntimeGlobals.getChunkUpdateScriptFilename
}(chunkId));`,
`var filename = require('path').join(__dirname, ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`,
"require('fs').readFile(filename, 'utf-8', function(err, content) {",
Template.indent([
"if(err) return reject(err);",
@ -172,9 +166,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
]),
"}",
"",
`${
RuntimeGlobals.hmrDownloadUpdateHandlers
}.readFileVm = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
`${RuntimeGlobals.hmrDownloadUpdateHandlers}.readFileVm = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
Template.indent([
"applyHandlers.push(function(options) {",
Template.indent([
@ -223,9 +215,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"return new Promise(function(resolve, reject) {",
Template.indent([
`var filename = require('path').join(__dirname, ${
RuntimeGlobals.getUpdateManifestFilename
}());`,
`var filename = require('path').join(__dirname, ${RuntimeGlobals.getUpdateManifestFilename}());`,
"require('fs').readFile(filename, 'utf-8', function(err, content) {",
Template.indent([
"if(err) {",

View File

@ -59,17 +59,13 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
? "if(true) { // all chunks have JS"
: `if(${hasJsMatcher("chunkId")}) {`,
Template.indent([
`var chunk = require("./" + ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId));`,
`var chunk = require("./" + ${RuntimeGlobals.getChunkScriptFilename}(chunkId));`,
"var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;",
"for(var moduleId in moreModules) {",
Template.indent([
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
Template.indent([
`${
RuntimeGlobals.moduleFactories
}[moduleId] = moreModules[moduleId];`
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
]),
"}"
]),
@ -107,9 +103,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
"var currentUpdateRuntime;",
"function loadUpdateChunk(chunkId, updatedModulesList) {",
Template.indent([
`var update = require("./" + ${
RuntimeGlobals.getChunkUpdateScriptFilename
}(chunkId));`,
`var update = require("./" + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`,
"var updatedModules = update.modules;",
"var runtime = update.runtime;",
"for(var moduleId in updatedModules) {",
@ -126,9 +120,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
]),
"}",
"",
`${
RuntimeGlobals.hmrDownloadUpdateHandlers
}.require = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
`${RuntimeGlobals.hmrDownloadUpdateHandlers}.require = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
Template.indent([
"applyHandlers.push(function(options) {",
Template.indent([
@ -177,9 +169,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"return Promise.resolve().then(function() {",
Template.indent([
`return require("./" + ${
RuntimeGlobals.getUpdateManifestFilename
}());`
`return require("./" + ${RuntimeGlobals.getUpdateManifestFilename}());`
]),
'}).catch(function(err) { if(err.code !== "MODULE_NOT_FOUND") throw err; });'
]),

View File

@ -946,23 +946,17 @@ class ConcatenatedModule extends Module {
if (info.interopNamespaceObjectUsed) {
if (info.module.buildMeta.exportsType === "named") {
result.add(
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/${
RuntimeGlobals.createFakeNamespaceObject
}(${info.name}, 2);\n`
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/${RuntimeGlobals.createFakeNamespaceObject}(${info.name}, 2);\n`
);
} else if (!info.module.buildMeta.exportsType) {
result.add(
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/${
RuntimeGlobals.createFakeNamespaceObject
}(${info.name});\n`
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/${RuntimeGlobals.createFakeNamespaceObject}(${info.name});\n`
);
}
}
if (info.interopDefaultAccessUsed) {
result.add(
`var ${info.interopDefaultAccessName} = /*#__PURE__*/${
RuntimeGlobals.compatGetDefaultExport
}(${info.name});\n`
`var ${info.interopDefaultAccessName} = /*#__PURE__*/${RuntimeGlobals.compatGetDefaultExport}(${info.name});\n`
);
}
break;
@ -1328,9 +1322,7 @@ class HarmonyImportSpecifierDependencyConcatenatedTemplate extends DependencyTem
const exportData = Buffer.from(JSON.stringify(ids), "utf-8").toString(
"hex"
);
content = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_${exportData}${callFlag}${strictFlag}__`;
content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`;
}
if (dep.shorthand) {
content = dep.name + ": " + content;
@ -1527,23 +1519,17 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate extends Depen
? "_strict"
: "";
if (def.ids.length === 0) {
finalName = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_ns${strictFlag}__`;
finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`;
} else {
const exportData = Buffer.from(
JSON.stringify(def.ids),
"utf-8"
).toString("hex");
finalName = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_${exportData}${strictFlag}__`;
finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${strictFlag}__`;
}
const exportsName = this.rootModule.exportsArgument;
const content =
`/* concated harmony reexport */ ${
RuntimeGlobals.definePropertyGetter
}(` +
`/* concated harmony reexport */ ${RuntimeGlobals.definePropertyGetter}(` +
`${exportsName}, ${JSON.stringify(used)}, ` +
`function() { return ${finalName}; });\n`;
initFragments.push(

View File

@ -682,9 +682,7 @@ module.exports = class SplitChunksPlugin {
compilation.errors.push(
new WebpackError(
"SplitChunksPlugin\n" +
`Cache group "${
cacheGroup.key
}" conflicts with existing chunk.\n` +
`Cache group "${cacheGroup.key}" conflicts with existing chunk.\n` +
`Both have the same name "${name}".\n` +
"Use a different name for the cache group.\n" +
'HINT: You can omit "name" to automatically create a name.\n' +

View File

@ -159,9 +159,7 @@ class ObjectMiddleware extends SerializerMiddleware {
if (serializers.has(Constructor)) {
throw new Error(
`ObjectMiddleware.register: serializer for ${
Constructor.name
} is already registered`
`ObjectMiddleware.register: serializer for ${Constructor.name} is already registered`
);
}
@ -187,9 +185,7 @@ class ObjectMiddleware extends SerializerMiddleware {
static registerNotSerializable(Constructor) {
if (serializers.has(Constructor)) {
throw new Error(
`ObjectMiddleware.registerNotSerializable: serializer for ${
Constructor.name
} is already registered`
`ObjectMiddleware.registerNotSerializable: serializer for ${Constructor.name} is already registered`
);
}

View File

@ -134,7 +134,7 @@ const DEFAULTS = {
publicPath: OFF_FOR_TO_STRING,
excludeModules: () => [],
excludeAssets: () => [],
maxModules: (o, { forToString }) => (forToString ? 15 : Infinity),
maxModules: (o, { forToString }) => ((forToString ? 15 : Infinity)),
modulesSort: () => "id",
chunksSort: () => "id",
assetsSort: () => "name",

View File

@ -135,7 +135,7 @@ const SIMPLE_PRINTERS = {
"asset.size": (
size,
{ asset: { isOverSizeLimit }, yellow, green, formatSize }
) => (isOverSizeLimit ? yellow(formatSize(size)) : formatSize(size)),
) => ((isOverSizeLimit ? yellow(formatSize(size)) : formatSize(size))),
"asset.emitted": (emitted, { green, formatFlag }) =>
emitted ? green(formatFlag("emitted")) : undefined,
"asset.isOverSizeLimit": (isOverSizeLimit, { yellow, formatFlag }) =>
@ -317,7 +317,8 @@ const SIMPLE_PRINTERS = {
rendered ? green(formatFlag("rendered")) : undefined,
"chunk.recorded": (recorded, { formatFlag, green }) =>
recorded ? green(formatFlag("recorded")) : undefined,
"chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined),
"chunk.reason": (reason, { yellow }) =>
(reason ? yellow(reason) : undefined),
"chunk.rootModules": (modules, context) => {
let maxModuleId = 0;
for (const module of modules) {
@ -707,7 +708,7 @@ const SIMPLE_ELEMENT_JOINERS = {
if (maxModuleId >= 10) prefix += " ";
}
return (
prefix +
(prefix +
joinExplicitNewLine(
items.filter(item => {
switch (item.element) {
@ -726,13 +727,13 @@ const SIMPLE_ELEMENT_JOINERS = {
return true;
}),
indenter
)
))
);
},
chunk: items => {
let hasEntry = false;
return (
"chunk " +
("chunk " +
joinExplicitNewLine(
items.filter(item => {
switch (item.element) {
@ -746,7 +747,7 @@ const SIMPLE_ELEMENT_JOINERS = {
return true;
}),
" "
)
))
);
},
"chunk.childrenByOrder[]": items => `(${joinOneLine(items)})`,
@ -766,8 +767,8 @@ const SIMPLE_ELEMENT_JOINERS = {
break;
case "resolvedModule":
return (
moduleReason.module !== moduleReason.resolvedModule &&
item.content
(moduleReason.module !== moduleReason.resolvedModule &&
item.content)
);
}
return true;

View File

@ -50,9 +50,7 @@ class ClassSerializer {
const hash = context.read();
if (this.hash !== hash)
throw new Error(
`Version mismatch for ${this.Constructor.name}: ${hash} !== ${
this.hash
}`
`Version mismatch for ${this.Constructor.name}: ${hash} !== ${this.hash}`
);
if (typeof this.Constructor.deserialize === "function") {
return this.Constructor.deserialize(context);

View File

@ -30,7 +30,7 @@ register(
CachedSource,
CURRENT_MODULE,
"webpack-sources/CachedSource",
new class CachedSourceSerializer {
new (class CachedSourceSerializer {
/**
* @param {CachedSource} source the cached source to be serialized
* @param {ObjectSerializerContext} context context
@ -56,14 +56,14 @@ register(
source._cachedMaps = read();
return source;
}
}()
})()
);
register(
RawSource,
CURRENT_MODULE,
"webpack-sources/RawSource",
new class RawSourceSerializer {
new (class RawSourceSerializer {
/**
* @param {RawSource} source the raw source to be serialized
* @param {ObjectSerializerContext} context context
@ -82,14 +82,14 @@ register(
const source = read();
return new RawSource(source);
}
}()
})()
);
register(
ConcatSource,
CURRENT_MODULE,
"webpack-sources/ConcatSource",
new class ConcatSourceSerializer {
new (class ConcatSourceSerializer {
/**
* @param {ConcatSource} source the concat source to be serialized
* @param {ObjectSerializerContext} context context
@ -109,14 +109,14 @@ register(
source.children = children;
return source;
}
}()
})()
);
register(
PrefixSource,
CURRENT_MODULE,
"webpack-sources/PrefixSource",
new class PrefixSourceSerializer {
new (class PrefixSourceSerializer {
/**
* @param {PrefixSource} source the prefix source to be serialized
* @param {ObjectSerializerContext} context context
@ -134,14 +134,14 @@ register(
deserialize({ read }) {
return new PrefixSource(read(), read());
}
}()
})()
);
register(
ReplaceSource,
CURRENT_MODULE,
"webpack-sources/ReplaceSource",
new class ReplaceSourceSerializer {
new (class ReplaceSourceSerializer {
/**
* @param {ReplaceSource} source the replace source to be serialized
* @param {ObjectSerializerContext} context context
@ -175,14 +175,14 @@ register(
}
return source;
}
}()
})()
);
register(
OriginalSource,
CURRENT_MODULE,
"webpack-sources/OriginalSource",
new class OriginalSourceSerializer {
new (class OriginalSourceSerializer {
/**
* @param {OriginalSource} source the original source to be serialized
* @param {ObjectSerializerContext} context context
@ -200,14 +200,14 @@ register(
deserialize({ read }) {
return new OriginalSource(read(), read());
}
}()
})()
);
register(
SourceLocation,
CURRENT_MODULE,
"acorn/SourceLocation",
new class SourceLocationSerializer {
new (class SourceLocationSerializer {
/**
* @param {SourceLocation} loc the location to be serialized
* @param {ObjectSerializerContext} context context
@ -236,14 +236,14 @@ register(
}
};
}
}()
})()
);
register(
Position,
CURRENT_MODULE,
"acorn/Position",
new class PositionSerializer {
new (class PositionSerializer {
/**
* @param {Position} pos the position to be serialized
* @param {ObjectSerializerContext} context context
@ -264,14 +264,14 @@ register(
column: read()
};
}
}()
})()
);
register(
SourceMapSource,
CURRENT_MODULE,
"webpack-sources/SourceMapSource",
new class SourceMapSourceSerializer {
new (class SourceMapSourceSerializer {
/**
* @param {SourceMapSource} source the source map source to be serialized
* @param {ObjectSerializerContext} context context
@ -292,5 +292,5 @@ register(
const map = read();
return new SourceMapSource(source, "unknown", map);
}
}()
})()
);

View File

@ -134,9 +134,8 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
: undefined;
const instantiateCall =
`${RuntimeGlobals.instantiateWasm}(${module.exportsArgument}, ${
module.moduleArgument
}.i` + (importsObj ? `, ${importsObj})` : `)`);
`${RuntimeGlobals.instantiateWasm}(${module.exportsArgument}, ${module.moduleArgument}.i` +
(importsObj ? `, ${importsObj})` : `)`);
return new RawSource(
Template.asString([

View File

@ -335,9 +335,7 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule {
"}",
"promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {",
Template.indent([
`return ${
RuntimeGlobals.wasmInstances
}[wasmModuleId] = (res.instance || res).exports;`
`return ${RuntimeGlobals.wasmInstances}[wasmModuleId] = (res.instance || res).exports;`
]),
"}));"
]),

View File

@ -60,9 +60,7 @@ class WasmFinalizeExportsPlugin {
// 4. error
/** @type {TODO} */
const error = new UnsupportedWebAssemblyFeatureError(
`Export "${name}" with ${
jsIncompatibleExports[name]
} can only be used for direct wasm to wasm dependencies\n` +
`Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies\n` +
`It's used from ${connection.originModule.readableIdentifier(
compilation.requestShortener
)} at ${formatLocation(connection.dependency.loc)}.`

View File

@ -168,9 +168,7 @@ class WebAssemblyJavascriptGenerator extends Generator {
[
'"use strict";',
"// Instantiate WebAssembly module",
`var wasmExports = ${RuntimeGlobals.wasmInstances}[${
module.moduleArgument
}.i];`,
`var wasmExports = ${RuntimeGlobals.wasmInstances}[${module.moduleArgument}.i];`,
exportsInfo.otherExportsInfo.used !== UsageState.Unused
? `${RuntimeGlobals.makeNamespaceObject}(${module.exportsArgument});`

View File

@ -153,9 +153,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
"promises.push(installedChunkData[2] = promise);",
"",
"// start chunk loading",
`var url = ${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId);`,
`var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`,
"var loadingEnded = function() { if(installedChunks[chunkId]) return installedChunks[chunkId][1]; if(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined; };",
jsonpScript.call("", chunk),
"document.head.appendChild(script);"
@ -232,9 +230,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"waitingUpdateResolves[chunkId] = resolve;",
"// start update chunk loading",
`var url = ${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getChunkUpdateScriptFilename
}(chunkId);`,
`var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId);`,
"var loadingEnded = function() {",
Template.indent([
"if(waitingUpdateResolves[chunkId]) {",
@ -276,9 +272,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
]),
"};",
"",
`${
RuntimeGlobals.hmrDownloadUpdateHandlers
}.jsonp = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
`${RuntimeGlobals.hmrDownloadUpdateHandlers}.jsonp = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
Template.indent([
"applyHandlers.push(function(options) {",
Template.indent([
@ -325,9 +319,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
`${RuntimeGlobals.hmrDownloadManifest} = function() {`,
Template.indent([
'if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");',
`return fetch(${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getUpdateManifestFilename
}()).then(function(response) {`,
`return fetch(${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getUpdateManifestFilename}()).then(function(response) {`,
Template.indent([
"if(response.status === 404) return; // no update available",
'if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);',
@ -427,9 +419,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
Template.indent(
`${
RuntimeGlobals.moduleFactories
}[moduleId] = moreModules[moduleId];`
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
),
"}"
]),

View File

@ -121,6 +121,7 @@ class JsonpTemplatePlugin {
"var errorType = event && (event.type === 'load' ? 'missing' : event.type);",
"var realSrc = event && event.target && event.target.src;",
"error.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"error.name = 'ChunkLoadError';",
"error.type = errorType;",
"error.request = realSrc;",
"reportError(error);"
@ -154,9 +155,7 @@ class JsonpTemplatePlugin {
"}",
'link.rel = "preload";',
'link.as = "script";',
`link.href = ${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId);`,
`link.href = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`,
crossOriginLoading
? Template.asString([
"if (link.href.indexOf(window.location.origin + '/') !== 0) {",
@ -184,9 +183,7 @@ class JsonpTemplatePlugin {
"}",
'link.rel = "prefetch";',
'link.as = "script";',
`link.href = ${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId);`
`link.href = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`
]);
});

View File

@ -57,9 +57,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent([
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
Template.indent(
`${
RuntimeGlobals.moduleFactories
}[moduleId] = moreModules[moduleId];`
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
),
"}"
]),
@ -69,9 +67,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
Template.indent("installedChunks[chunkIds.pop()] = 1;")
]),
"};",
`importScripts(${
RuntimeGlobals.getChunkScriptFilename
}(chunkId));`,
`importScripts(${RuntimeGlobals.getChunkScriptFilename}(chunkId));`,
"",
withHmr
? "if(currentUpdateChunks && currentUpdateChunks[chunkId]) loadUpdateChunk(chunkId);"
@ -110,16 +106,12 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
]),
"};",
"// start update chunk loading",
`importScripts(${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getChunkUpdateScriptFilename
}(chunkId));`,
`importScripts(${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`,
'if(!success) throw new Error("Loading update chunk failed for unknown reason");'
]),
"}",
"",
`${
RuntimeGlobals.hmrDownloadUpdateHandlers
}.jsonp = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
`${RuntimeGlobals.hmrDownloadUpdateHandlers}.jsonp = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`,
Template.indent([
"applyHandlers.push(function(options) {",
Template.indent([
@ -167,9 +159,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
`${RuntimeGlobals.hmrDownloadManifest} = function() {`,
Template.indent([
'if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");',
`return fetch(${RuntimeGlobals.publicPath} + ${
RuntimeGlobals.getUpdateManifestFilename
}()).then(function(response) {`,
`return fetch(${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getUpdateManifestFilename}()).then(function(response) {`,
Template.indent([
"if(response.status === 404) return; // no update available",
'if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);',

View File

@ -279,9 +279,7 @@ describe("BenchmarkTestCases", function() {
describe(`${testName} create benchmarks`, function() {
baselines.forEach(baseline => {
let baselineStats = null;
it(`should benchmark ${baseline.name} (${
baseline.rev
})`, function(done) {
it(`should benchmark ${baseline.name} (${baseline.rev})`, function(done) {
const outputDirectory = path.join(
__dirname,
"js",
@ -332,14 +330,10 @@ describe("BenchmarkTestCases", function() {
}, 180000);
if (baseline.name !== "HEAD") {
it(`HEAD should not be slower than ${baseline.name} (${
baseline.rev
})`, function() {
it(`HEAD should not be slower than ${baseline.name} (${baseline.rev})`, function() {
if (baselineStats.maxConfidence < headStats.minConfidence) {
throw new Error(
`HEAD (${headStats.text}) is slower than ${baseline.name} (${
baselineStats.text
}) (90% confidence)`
`HEAD (${headStats.text}) is slower than ${baseline.name} (${baselineStats.text}) (90% confidence)`
);
} else if (
baselineStats.minConfidence > headStats.maxConfidence

View File

@ -332,7 +332,7 @@ Object {
"errors": Array [
Object {
"loc": "2:12",
"message": "Module parse failed: Unexpected token (2:12)\\nYou may need an appropriate loader to handle this file type.\\n| window.foo = {\\n> bar: true,;\\n| };\\n| ",
"message": "Module parse failed: Unexpected token (2:12)\\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\\n| window.foo = {\\n> bar: true,;\\n| };\\n| ",
"moduleId": 0,
"moduleIdentifier": "<cwd>/test/fixtures/errors/has-syntax-error.js",
"moduleName": "./has-syntax-error.js",
@ -682,6 +682,155 @@ Object {
],
"warnings": Array [],
}
`);
});
const identityLoader = path.resolve(
__dirname,
"fixtures/errors/identity-loader.js"
);
const addCommentLoader = path.resolve(
__dirname,
"fixtures/errors/add-comment-loader.js"
);
it("should show loader used if it is present when module parsing fails", async () => {
await expect(
compile({
mode: "development",
entry: "./abc.html",
module: {
rules: [
{
test: /\.html$/,
use: [{ loader: identityLoader }]
}
]
}
})
).resolves.toMatchInlineSnapshot(`
Object {
"errors": Array [
Object {
"loc": "1:0",
"message": "Module parse failed: Unexpected token (1:0)\\nFile was processed with these loaders:\\n * ./identity-loader.js\\nYou may need an additional loader to handle the result of these loaders.\\n> <!DOCTYPE html>\\n| <html>\\n| <body>",
"moduleId": "./abc.html",
"moduleIdentifier": "<cwd>/test/fixtures/errors/identity-loader.js!<cwd>/test/fixtures/errors/abc.html",
"moduleName": "./abc.html",
"moduleTrace": Array [],
},
],
"warnings": Array [],
}
`);
});
it("should show all loaders used if they are in config when module parsing fails", async () => {
await expect(
compile({
mode: "development",
entry: "./abc.html",
module: {
rules: [
{
test: /\.html$/,
use: [{ loader: identityLoader }, { loader: addCommentLoader }]
}
]
}
})
).resolves.toMatchInlineSnapshot(`
Object {
"errors": Array [
Object {
"loc": "1:0",
"message": "Module parse failed: Unexpected token (1:0)\\nFile was processed with these loaders:\\n * ./identity-loader.js\\n * ./add-comment-loader.js\\nYou may need an additional loader to handle the result of these loaders.\\n> <!DOCTYPE html>\\n| <html>\\n| <body>",
"moduleId": "./abc.html",
"moduleIdentifier": "<cwd>/test/fixtures/errors/identity-loader.js!<cwd>/test/fixtures/errors/add-comment-loader.js!<cwd>/test/fixtures/errors/abc.html",
"moduleName": "./abc.html",
"moduleTrace": Array [],
},
],
"warnings": Array [],
}
`);
});
it("should show all loaders used if use is a string", async () => {
await expect(
compile({
mode: "development",
entry: "./abc.html",
module: {
rules: [
{ test: /\.html$/, use: identityLoader },
{ test: /\.html$/, use: addCommentLoader }
]
}
})
).resolves.toMatchInlineSnapshot(`
Object {
"errors": Array [
Object {
"loc": "1:0",
"message": "Module parse failed: Unexpected token (1:0)\\nFile was processed with these loaders:\\n * ./identity-loader.js\\n * ./add-comment-loader.js\\nYou may need an additional loader to handle the result of these loaders.\\n> <!DOCTYPE html>\\n| <html>\\n| <body>",
"moduleId": "./abc.html",
"moduleIdentifier": "<cwd>/test/fixtures/errors/identity-loader.js!<cwd>/test/fixtures/errors/add-comment-loader.js!<cwd>/test/fixtures/errors/abc.html",
"moduleName": "./abc.html",
"moduleTrace": Array [],
},
],
"warnings": Array [],
}
`);
});
it("should show 'no loaders are configured to process this file' if loaders are not included in config when module parsing fails", async () => {
await expect(
compile({
mode: "development",
entry: "./abc.html",
module: {}
})
).resolves.toMatchInlineSnapshot(`
Object {
"errors": Array [
Object {
"loc": "1:0",
"message": "Module parse failed: Unexpected token (1:0)\\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\\n> <!DOCTYPE html>\\n| <html>\\n| <body>",
"moduleId": "./abc.html",
"moduleIdentifier": "<cwd>/test/fixtures/errors/abc.html",
"moduleName": "./abc.html",
"moduleTrace": Array [],
},
],
"warnings": Array [],
}
`);
});
it("should show 'source code omitted for this binary file' when module parsing fails for binary files", async () => {
const folder = path.join(__dirname, "/fixtures");
await expect(
compile({
mode: "development",
entry: path.resolve(folder, "./font.ttf"),
module: {}
})
).resolves.toMatchInlineSnapshot(`
Object {
"errors": Array [
Object {
"loc": "1:0",
"message": "Module parse failed: Unexpected character '' (1:0)\\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\\n(Source code omitted for this binary file)",
"moduleId": "../font.ttf",
"moduleIdentifier": "<cwd>/test/fixtures/font.ttf",
"moduleName": "../font.ttf",
"moduleTrace": Array [],
},
],
"warnings": Array [],
}
`);
});
});

View File

@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = `
"Hash: 07f09ed3dcd1d1946bd907f09ed3dcd1d1946bd9
"Hash: de949c9d9484ba4c4d9cde949c9d9484ba4c4d9c
Child fitting:
Hash: 07f09ed3dcd1d1946bd9
Hash: de949c9d9484ba4c4d9c
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
@ -11,9 +11,9 @@ Child fitting:
501a16e2f184bd3b8ea5.js 1.07 KiB {785} [emitted]
b655127fd4eca55a90aa.js 1.92 KiB {394} [emitted]
bac8938bfd9c34df221b.js 1.92 KiB {102} [emitted]
e32ad31d248831ad16ae.js 12.4 KiB {10} [emitted]
Entrypoint main = b655127fd4eca55a90aa.js bac8938bfd9c34df221b.js e32ad31d248831ad16ae.js
chunk {10} e32ad31d248831ad16ae.js 1.87 KiB (javascript) 6.08 KiB (runtime) [entry] [rendered]
c314b0668fd09d460211.js 12.5 KiB {10} [emitted]
Entrypoint main = b655127fd4eca55a90aa.js bac8938bfd9c34df221b.js c314b0668fd09d460211.js
chunk {10} c314b0668fd09d460211.js 1.87 KiB (javascript) 6.11 KiB (runtime) [entry] [rendered]
> ./index main
[10] ./index.js 111 bytes {10} [built]
[390] ./e.js 899 bytes {10} [built]
@ -31,7 +31,7 @@ Child fitting:
> ./g [10] ./index.js 7:0-13
[785] ./g.js 916 bytes {785} [built]
Child content-change:
Hash: 07f09ed3dcd1d1946bd9
Hash: de949c9d9484ba4c4d9c
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
@ -39,9 +39,9 @@ Child content-change:
501a16e2f184bd3b8ea5.js 1.07 KiB {785} [emitted]
b655127fd4eca55a90aa.js 1.92 KiB {394} [emitted]
bac8938bfd9c34df221b.js 1.92 KiB {102} [emitted]
e32ad31d248831ad16ae.js 12.4 KiB {10} [emitted]
Entrypoint main = b655127fd4eca55a90aa.js bac8938bfd9c34df221b.js e32ad31d248831ad16ae.js
chunk {10} e32ad31d248831ad16ae.js 1.87 KiB (javascript) 6.08 KiB (runtime) [entry] [rendered]
c314b0668fd09d460211.js 12.5 KiB {10} [emitted]
Entrypoint main = b655127fd4eca55a90aa.js bac8938bfd9c34df221b.js c314b0668fd09d460211.js
chunk {10} c314b0668fd09d460211.js 1.87 KiB (javascript) 6.11 KiB (runtime) [entry] [rendered]
> ./index main
[10] ./index.js 111 bytes {10} [built]
[390] ./e.js 899 bytes {10} [built]
@ -61,29 +61,29 @@ Child content-change:
`;
exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = `
"Hash: edf7fcc0f0bf2f566a6c
"Hash: 1e4c9837ccb1a4c4032d
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
Asset Size Chunks Chunk Names
035ce1d102419ee4897b.js 1020 bytes {701} [emitted]
16900b517974daeac4dc.js 9.15 KiB {179} [emitted] main
1ffcc984ad7d7c92ab0b.js 1.92 KiB {594} [emitted]
2d925701a76fac28b8cc.js 1.92 KiB {817} [emitted]
4717957e3d668ff4f9e8.js 1.92 KiB {591} [emitted]
49dd7266942f0ed4ae64.js 1020 bytes {847} [emitted]
61fe00576946c9f2606d.js 1.92 KiB {454} [emitted]
958e1156a215cbffe4a7.js 9.2 KiB {179} [emitted] main
b18de3d2b973b820ea21.js 1.92 KiB {294}, {701} [emitted]
bac8938bfd9c34df221b.js 1.92 KiB {102} [emitted]
c0e562c433da5d2d3cb7.js 1.92 KiB {390}, {523} [emitted]
f2593c9acd7da73fffbe.js 1020 bytes {390} [emitted]
f50587036d9d0e61836c.js 1.92 KiB {613} [emitted]
Entrypoint main = 16900b517974daeac4dc.js
Entrypoint main = 958e1156a215cbffe4a7.js
chunk {102} bac8938bfd9c34df221b.js 1.76 KiB [rendered] [recorded] aggressive splitted
> ./c ./d ./e [942] ./index.js 3:0-30
[460] ./c.js 899 bytes {102} {591} [built]
[767] ./d.js 899 bytes {102} {817} [built]
chunk {179} 16900b517974daeac4dc.js (main) 248 bytes (javascript) 4.17 KiB (runtime) [entry] [rendered]
chunk {179} 958e1156a215cbffe4a7.js (main) 248 bytes (javascript) 4.21 KiB (runtime) [entry] [rendered]
> ./index main
[942] ./index.js 248 bytes {179} [built]
+ 4 hidden chunk modules
@ -132,7 +132,7 @@ chunk {847} 49dd7266942f0ed4ae64.js 899 bytes [rendered]
exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = `
"Entrypoint main = main.js
chunk {179} main.js (main) 515 bytes (javascript) 3.86 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered]
chunk {179} main.js (main) 515 bytes (javascript) 3.9 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered]
> ./ main
[10] ./index.js 515 bytes {179} [built]
+ 4 hidden root modules
@ -164,7 +164,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
+ 1 hidden dependent module
chunk {179} disabled/main.js (main) 147 bytes (javascript) 4.8 KiB (runtime) [entry] [rendered]
chunk {179} disabled/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -181,7 +181,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto
[363] ./c.js + 1 modules 107 bytes {383} {459} [built]
+ 3 hidden root modules
+ 3 hidden dependent modules
chunk {786} disabled/a.js (a) 216 bytes (javascript) 4.75 KiB (runtime) [entry] [rendered]
chunk {786} disabled/a.js (a) 216 bytes (javascript) 4.78 KiB (runtime) [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -203,7 +203,7 @@ Child default:
chunk {137} default/async-g.js (async-g) 34 bytes [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -236,7 +236,7 @@ Child default:
chunk {769} default/769.js 20 bytes [rendered] split chunk (cache group: defaultVendors)
> ./c [10] ./index.js 3:0-47
[769] ./node_modules/z.js 20 bytes {459} {769} [built]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.8 KiB (runtime) [entry] [rendered]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -262,7 +262,7 @@ Child vendors:
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
+ 1 hidden dependent module
chunk {179} vendors/main.js (main) 147 bytes (javascript) 4.8 KiB (runtime) [entry] [rendered]
chunk {179} vendors/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -286,7 +286,7 @@ Child vendors:
[460] ./c.js 72 bytes {383} {459} [built]
+ 2 hidden root modules
+ 2 hidden dependent modules
chunk {786} vendors/a.js (a) 176 bytes (javascript) 5.69 KiB (runtime) [entry] [rendered]
chunk {786} vendors/a.js (a) 176 bytes (javascript) 5.73 KiB (runtime) [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -316,7 +316,7 @@ Child multiple-vendors:
chunk {137} multiple-vendors/async-g.js (async-g) 34 bytes [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} multiple-vendors/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
chunk {179} multiple-vendors/main.js (main) 147 bytes (javascript) 4.87 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -348,7 +348,7 @@ Child multiple-vendors:
> ./c [10] ./index.js 3:0-47
> ./c c
[769] ./node_modules/z.js 20 bytes {769} [built]
chunk {786} multiple-vendors/a.js (a) 156 bytes (javascript) 5.75 KiB (runtime) [entry] [rendered]
chunk {786} multiple-vendors/a.js (a) 156 bytes (javascript) 5.78 KiB (runtime) [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -374,7 +374,7 @@ Child all:
chunk {137} all/async-g.js (async-g) 34 bytes [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} all/main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
chunk {179} all/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -414,7 +414,7 @@ Child all:
> ./c [10] ./index.js 3:0-47
> ./c c
[769] ./node_modules/z.js 20 bytes {769} [built]
chunk {786} all/a.js (a) 156 bytes (javascript) 5.73 KiB (runtime) [entry] [rendered]
chunk {786} all/a.js (a) 156 bytes (javascript) 5.77 KiB (runtime) [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -458,7 +458,7 @@ chunk {1} main1.js (main1) 136 bytes (javascript) 279 bytes (runtime) [entry] [r
`;
exports[`StatsTestCases should print correct stats for chunks 1`] = `
"Hash: 9c723a3041e7ba750018
"Hash: 48f3c2931714a9877313
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
@ -466,9 +466,9 @@ PublicPath: (none)
460.bundle.js 311 bytes {460} [emitted]
524.bundle.js 220 bytes {524} [emitted]
996.bundle.js 147 bytes {996} [emitted]
bundle.js 7.65 KiB {179} [emitted] main
bundle.js 7.7 KiB {179} [emitted] main
Entrypoint main = bundle.js
chunk {179} bundle.js (main) 73 bytes (javascript) 3.87 KiB (runtime) >{460}< >{996}< [entry] [rendered]
chunk {179} bundle.js (main) 73 bytes (javascript) 3.9 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
[10] ./index.js 51 bytes {179} [built]
entry ./index main
@ -498,13 +498,13 @@ chunk {996} 996.bundle.js 22 bytes <{179}> [rendered]
`;
exports[`StatsTestCases should print correct stats for chunks-development 1`] = `
"Hash: 55cb822b60c3838ac164
"Hash: c7b0c651342b76d06f43
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
Asset Size Chunks Chunk Names
b_js.bundle.js 364 bytes {b_js} [emitted]
bundle.js 8.22 KiB {main} [emitted] main
bundle.js 8.27 KiB {main} [emitted] main
c_js.bundle.js 573 bytes {c_js} [emitted]
d_js-e_js.bundle.js 760 bytes {d_js-e_js} [emitted]
Entrypoint main = bundle.js
@ -526,7 +526,7 @@ chunk {d_js-e_js} d_js-e_js.bundle.js 60 bytes <{c_js}> [rendered]
[./e.js] 38 bytes {d_js-e_js} [built]
require.ensure item ./e [./c.js] 1:0-52
[./index.js] Xms -> [./c.js] Xms -> Xms (resolving: Xms, restoring: Xms, integration: Xms, building: Xms, storing: Xms)
chunk {main} bundle.js (main) 3.87 KiB (runtime) 73 bytes (javascript) >{b_js}< >{c_js}< [entry] [rendered]
chunk {main} bundle.js (main) 3.91 KiB (runtime) 73 bytes (javascript) >{b_js}< >{c_js}< [entry] [rendered]
> ./index main
[./a.js] 22 bytes {main} [built]
cjs require ./a [./e.js] 1:0-14
@ -542,7 +542,7 @@ exports[`StatsTestCases should print correct stats for circular-correctness 1`]
"Entrypoint main = bundle.js
chunk {128} 128.bundle.js (b) 49 bytes <{179}> <{459}> >{459}< [rendered]
[548] ./module-b.js 49 bytes {128} [built]
chunk {179} bundle.js (main) 98 bytes (javascript) 5.11 KiB (runtime) >{128}< >{786}< [entry] [rendered]
chunk {179} bundle.js (main) 98 bytes (javascript) 5.15 KiB (runtime) >{128}< >{786}< [entry] [rendered]
[10] ./index.js 98 bytes {179} [built]
+ 7 hidden chunk modules
chunk {459} 459.bundle.js (c) 98 bytes <{128}> <{786}> >{128}< >{786}< [rendered]
@ -999,7 +999,7 @@ Entrypoint e2 = e2.js
chunk {128} b.js (b) 49 bytes <{786}> >{459}< [rendered]
[548] ./module-b.js 49 bytes {128} [built]
import() ./module-b [662] ./module-a.js 1:0-47
chunk {257} e1.js (e1) 49 bytes (javascript) 5.14 KiB (runtime) >{786}< [entry] [rendered]
chunk {257} e1.js (e1) 49 bytes (javascript) 5.17 KiB (runtime) >{786}< [entry] [rendered]
[481] ./e1.js 49 bytes {257} [built]
entry ./e1 e1
+ 7 hidden chunk modules
@ -1007,7 +1007,7 @@ chunk {459} c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered]
[65] ./module-c.js 49 bytes {459} [built]
import() ./module-c [120] ./e2.js 1:0-47
import() ./module-c [548] ./module-b.js 1:0-47
chunk {621} e2.js (e2) 49 bytes (javascript) 5.14 KiB (runtime) >{459}< [entry] [rendered]
chunk {621} e2.js (e2) 49 bytes (javascript) 5.17 KiB (runtime) >{459}< [entry] [rendered]
[120] ./e2.js 49 bytes {621} [built]
entry ./e2 e2
+ 7 hidden chunk modules
@ -1023,7 +1023,7 @@ Entrypoint e2 = e2.js
chunk {128} b.js (b) 179 bytes <{786}> >{459}< [rendered]
[548] ./module-b.js 179 bytes {128} [built]
import() ./module-b [662] ./module-a.js 1:0-47
chunk {257} e1.js (e1) 119 bytes (javascript) 5.47 KiB (runtime) >{786}< >{892}< [entry] [rendered]
chunk {257} e1.js (e1) 119 bytes (javascript) 5.5 KiB (runtime) >{786}< >{892}< [entry] [rendered]
[456] ./module-x.js 49 bytes {257} {621} [built]
harmony side effect evaluation ./module-x [120] ./e2.js 1:0-20
harmony side effect evaluation ./module-x [481] ./e1.js 1:0-20
@ -1035,7 +1035,7 @@ chunk {459} c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered]
[65] ./module-c.js 49 bytes {459} [built]
import() ./module-c [120] ./e2.js 2:0-47
import() ./module-c [548] ./module-b.js 1:0-47
chunk {621} e2.js (e2) 119 bytes (javascript) 5.47 KiB (runtime) >{459}< >{892}< [entry] [rendered]
chunk {621} e2.js (e2) 119 bytes (javascript) 5.5 KiB (runtime) >{459}< >{892}< [entry] [rendered]
[120] ./e2.js 70 bytes {621} [built]
entry ./e2 e2
[456] ./module-x.js 49 bytes {257} {621} [built]
@ -1073,7 +1073,7 @@ chunk {id-equals-name_js0} id-equals-name_js0.js 1 bytes [rendered]
[./id-equals-name.js] 1 bytes {id-equals-name_js0} [built]
chunk {id-equals-name_js_3} id-equals-name_js_3.js 1 bytes [rendered]
[./id-equals-name.js?3] 1 bytes {id-equals-name_js_3} [built]
chunk {main} main.js (main) 5.43 KiB (runtime) 639 bytes (javascript) [entry] [rendered]
chunk {main} main.js (main) 5.47 KiB (runtime) 639 bytes (javascript) [entry] [rendered]
[./index.js] 639 bytes {main} [built]
+ 8 hidden root modules
chunk {tree} tree.js (tree) 43 bytes [rendered]
@ -1087,14 +1087,14 @@ chunk {trees} trees.js (trees) 71 bytes [rendered]
`;
exports[`StatsTestCases should print correct stats for import-context-filter 1`] = `
"Hash: 9c0581e86fd499608326
"Hash: 647ae626bf6eb0d68896
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
398.js 320 bytes {398} [emitted]
544.js 320 bytes {544} [emitted]
718.js 320 bytes {718} [emitted]
entry.js 8.93 KiB {497} [emitted] entry
entry.js 8.98 KiB {497} [emitted] entry
Entrypoint entry = entry.js
[389] ./templates lazy ^\\\\.\\\\/.*$ include: \\\\.js$ exclude: \\\\.noimport\\\\.js$ namespace object 160 bytes {497} [optional] [built]
[398] ./templates/bar.js 38 bytes {398} [optional] [built]
@ -1105,12 +1105,12 @@ Entrypoint entry = entry.js
`;
exports[`StatsTestCases should print correct stats for import-weak 1`] = `
"Hash: 70e0e9aff201170049c7
"Hash: 94627bb4b8c9def4b4a3
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
836.js 147 bytes {836} [emitted]
entry.js 9.7 KiB {497} [emitted] entry
entry.js 9.75 KiB {497} [emitted] entry
Entrypoint entry = entry.js
[594] ./entry.js 120 bytes {497} [built]
[836] ./modules/b.js 22 bytes {836} [built]
@ -1142,7 +1142,7 @@ Compilation error while processing magic comment(-s): /* webpackPrefetch: nope *
`;
exports[`StatsTestCases should print correct stats for issue-7577 1`] = `
"Hash: ee71e92c425768e31996f7d4f5f5ea4a4e51f90cde88673ad2161e9d116a
"Hash: ee71e92c425768e31996f7d4f5f5ea4a4e51f90c20baa71cf13e3ee9f58d
Child
Hash: ee71e92c425768e31996
Time: Xms
@ -1168,16 +1168,16 @@ Child
[./node_modules/vendor.js] 23 bytes {vendors-node_modules_vendor_js} [built]
+ 4 hidden modules
Child
Hash: de88673ad2161e9d116a
Hash: 20baa71cf13e3ee9f58d
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
c-all-b_js-89c3127ba563ffa436dc.js 502 bytes {all-b_js} [emitted]
c-all-c_js-936472833753792cc303.js 369 bytes {all-c_js} [emitted]
c-main-74481bfa6b28e9e83c8f.js 164 bytes {main} [emitted] main
c-runtime~main-9eb6c987f0f9e3a06084.js 10.8 KiB {runtime~main} [emitted] runtime~main
c-runtime~main-d3dcac2e7f2fc3da0cdd.js 10.8 KiB {runtime~main} [emitted] runtime~main
c-vendors-node_modules_vendor_js-a7aa3079a16cbae3f591.js 194 bytes {vendors-node_modules_vendor_js} [emitted]
Entrypoint main = c-runtime~main-9eb6c987f0f9e3a06084.js c-all-c_js-936472833753792cc303.js c-main-74481bfa6b28e9e83c8f.js (prefetch: c-vendors-node_modules_vendor_js-a7aa3079a16cbae3f591.js c-all-b_js-89c3127ba563ffa436dc.js)
Entrypoint main = c-runtime~main-d3dcac2e7f2fc3da0cdd.js c-all-c_js-936472833753792cc303.js c-main-74481bfa6b28e9e83c8f.js (prefetch: c-vendors-node_modules_vendor_js-a7aa3079a16cbae3f591.js c-all-b_js-89c3127ba563ffa436dc.js)
[./b.js] 17 bytes {all-b_js} [built]
[./c.js] 61 bytes {all-c_js} [built]
[./node_modules/vendor.js] 23 bytes {vendors-node_modules_vendor_js} [built]
@ -1185,7 +1185,7 @@ Child
`;
exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = `
"Hash: 750fed6497e61cba45beeda05b9b75f628ba705922eb42039655ba5e2a0baccdc504b51a31c2594d
"Hash: 750fed6497e61cba45bea521668daa9bc73cff9e7412b78028c74e60f2ef1c1357d555bededaa2ad
Child 1 chunks:
Hash: 750fed6497e61cba45be
Time: Xms
@ -1202,14 +1202,14 @@ Child 1 chunks:
[996] ./b.js 22 bytes {179} [built]
+ 3 hidden chunk modules
Child 2 chunks:
Hash: eda05b9b75f628ba7059
Hash: a521668daa9bc73cff9e
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
459.bundle.js 673 bytes {459} [emitted] c
bundle.js 9.54 KiB {179} [emitted] main
bundle.js 9.59 KiB {179} [emitted] main
Entrypoint main = bundle.js
chunk {179} bundle.js (main) 101 bytes (javascript) 5.11 KiB (runtime) >{459}< [entry] [rendered]
chunk {179} bundle.js (main) 101 bytes (javascript) 5.15 KiB (runtime) >{459}< [entry] [rendered]
[10] ./index.js 101 bytes {179} [built]
+ 7 hidden chunk modules
chunk {459} 459.bundle.js (c) 118 bytes <{179}> <{459}> >{459}< [rendered]
@ -1219,15 +1219,15 @@ Child 2 chunks:
[847] ./a.js 22 bytes {459} [built]
[996] ./b.js 22 bytes {459} [built]
Child 3 chunks:
Hash: 22eb42039655ba5e2a0b
Hash: 7412b78028c74e60f2ef
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
459.bundle.js 527 bytes {459} [emitted] c
524.bundle.js 220 bytes {524} [emitted]
bundle.js 9.54 KiB {179} [emitted] main
bundle.js 9.59 KiB {179} [emitted] main
Entrypoint main = bundle.js
chunk {179} bundle.js (main) 101 bytes (javascript) 5.11 KiB (runtime) >{459}< [entry] [rendered]
chunk {179} bundle.js (main) 101 bytes (javascript) 5.15 KiB (runtime) >{459}< [entry] [rendered]
[10] ./index.js 101 bytes {179} [built]
+ 7 hidden chunk modules
chunk {459} 459.bundle.js (c) 74 bytes <{179}> >{524}< [rendered]
@ -1238,16 +1238,16 @@ Child 3 chunks:
[390] ./e.js 22 bytes {524} [built]
[767] ./d.js 22 bytes {524} [built]
Child 4 chunks:
Hash: accdc504b51a31c2594d
Hash: 1c1357d555bededaa2ad
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
394.bundle.js 220 bytes {394} [emitted]
459.bundle.js 381 bytes {459} [emitted] c
524.bundle.js 220 bytes {524} [emitted]
bundle.js 9.54 KiB {179} [emitted] main
bundle.js 9.59 KiB {179} [emitted] main
Entrypoint main = bundle.js
chunk {179} bundle.js (main) 101 bytes (javascript) 5.11 KiB (runtime) >{394}< >{459}< [entry] [rendered]
chunk {179} bundle.js (main) 101 bytes (javascript) 5.15 KiB (runtime) >{394}< >{459}< [entry] [rendered]
[10] ./index.js 101 bytes {179} [built]
+ 7 hidden chunk modules
chunk {394} 394.bundle.js 44 bytes <{179}> [rendered]
@ -1316,14 +1316,14 @@ Entrypoint main = main.js
`;
exports[`StatsTestCases should print correct stats for module-assets 1`] = `
"Hash: b838419139ebdaa10ca9
"Hash: 7f53bd765857c39e8e47
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint main = main.js
chunk {48} 48.js 68 bytes [rendered]
[48] ./node_modules/a/index.js 17 bytes {48} [built]
[461] ./node_modules/a/1.png 51 bytes {48} [built] [1 asset]
chunk {179} main.js (main) 12 bytes (javascript) 4.73 KiB (runtime) [entry] [rendered]
chunk {179} main.js (main) 12 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered]
[10] ./index.js 12 bytes {179} [built]
+ 7 hidden chunk modules
[10] ./index.js 12 bytes {179} [built]
@ -1340,15 +1340,15 @@ exports[`StatsTestCases should print correct stats for module-deduplication 1`]
593.js 677 bytes {593} [emitted]
716.js 735 bytes {172}, {716} [emitted]
923.js 735 bytes {114}, {923} [emitted]
e1.js 10.1 KiB {257} [emitted] e1
e2.js 10.1 KiB {621} [emitted] e2
e3.js 10.1 KiB {144} [emitted] e3
e1.js 10.2 KiB {257} [emitted] e1
e2.js 10.2 KiB {621} [emitted] e2
e3.js 10.2 KiB {144} [emitted] e3
Entrypoint e1 = e1.js
Entrypoint e2 = e2.js
Entrypoint e3 = e3.js
chunk {114} 114.js 28 bytes [rendered]
[114] ./async1.js 28 bytes {114} {923} [built]
chunk {144} e3.js (e3) 152 bytes (javascript) 4.73 KiB (runtime) [entry] [rendered]
chunk {144} e3.js (e3) 152 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered]
[307] ./h.js 9 bytes {144} {326} [built]
[509] ./e3.js 116 bytes {144} [built]
[785] ./g.js 9 bytes {144} [built]
@ -1357,7 +1357,7 @@ chunk {144} e3.js (e3) 152 bytes (javascript) 4.73 KiB (runtime) [entry] [render
+ 7 hidden chunk modules
chunk {172} 172.js 28 bytes [rendered]
[172] ./async2.js 28 bytes {172} {716} [built]
chunk {257} e1.js (e1) 152 bytes (javascript) 4.73 KiB (runtime) [entry] [rendered]
chunk {257} e1.js (e1) 152 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered]
[460] ./c.js 9 bytes {257} [built]
[481] ./e1.js 116 bytes {257} [built]
[767] ./d.js 9 bytes {257} {923} [built]
@ -1369,7 +1369,7 @@ chunk {326} 326.js 37 bytes [rendered]
[326] ./async3.js 28 bytes {326} {593} [built]
chunk {593} 593.js 28 bytes [rendered]
[326] ./async3.js 28 bytes {326} {593} [built]
chunk {621} e2.js (e2) 152 bytes (javascript) 4.73 KiB (runtime) [entry] [rendered]
chunk {621} e2.js (e2) 152 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered]
[120] ./e2.js 116 bytes {621} [built]
[390] ./e.js 9 bytes {621} [built]
[568] ./f.js 9 bytes {621} {716} [built]
@ -1395,14 +1395,14 @@ async3.js 825 bytes {611} [emitted] async3
Entrypoint e1 = e1.js
Entrypoint e2 = e2.js
Entrypoint e3 = e3.js
chunk {144} e3.js (e3) 144 bytes (javascript) 4.77 KiB (runtime) [entry] [rendered]
chunk {144} e3.js (e3) 144 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
[307] ./h.js 9 bytes {144} {611} [built]
[509] ./e3.js 108 bytes {144} [built]
[785] ./g.js 9 bytes {144} [built]
[847] ./a.js 9 bytes {144} {257} {621} [built]
[996] ./b.js 9 bytes {144} {257} {621} [built]
+ 7 hidden chunk modules
chunk {257} e1.js (e1) 144 bytes (javascript) 4.77 KiB (runtime) [entry] [rendered]
chunk {257} e1.js (e1) 144 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
[460] ./c.js 9 bytes {257} [built]
[481] ./e1.js 108 bytes {257} [built]
[767] ./d.js 9 bytes {257} {515} [built]
@ -1415,7 +1415,7 @@ chunk {515} async1.js (async1) 89 bytes [rendered]
chunk {611} async3.js (async3) 89 bytes [rendered]
[307] ./h.js 9 bytes {144} {611} [built]
[326] ./async3.js 80 bytes {611} [built]
chunk {621} e2.js (e2) 144 bytes (javascript) 4.77 KiB (runtime) [entry] [rendered]
chunk {621} e2.js (e2) 144 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
[120] ./e2.js 108 bytes {621} [built]
[390] ./e.js 9 bytes {621} [built]
[568] ./f.js 9 bytes {621} {989} [built]
@ -1470,8 +1470,8 @@ Entrypoint main = main.js
exports[`StatsTestCases should print correct stats for module-trace-disabled-in-error 1`] = `
"Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
main.js 2 KiB {179} main
Asset Size Chunks Chunk Names
main.js 2.1 KiB {179} main
Entrypoint main = main.js
[10] ./index.js 19 bytes {179} [built]
[195] ./not-existing.js 26 bytes {179} [built]
@ -1483,7 +1483,7 @@ Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-di
ERROR in ./parse-error.js 3:4
Module parse failed: Unexpected token (3:4)
You may need an appropriate loader to handle this file type.
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| Here
| could
> be :)
@ -1495,8 +1495,8 @@ You may need an appropriate loader to handle this file type.
exports[`StatsTestCases should print correct stats for module-trace-enabled-in-error 1`] = `
"Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
main.js 2 KiB {179} main
Asset Size Chunks Chunk Names
main.js 2.1 KiB {179} main
Entrypoint main = main.js
[10] ./index.js 19 bytes {179} [built]
[195] ./not-existing.js 26 bytes {179} [built]
@ -1510,7 +1510,7 @@ Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/module-trace-en
ERROR in ./parse-error.js 3:4
Module parse failed: Unexpected token (3:4)
You may need an appropriate loader to handle this file type.
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| Here
| could
> be :)
@ -1531,7 +1531,7 @@ exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] =
> ./a [10] ./index.js 1:0-47
> ./b [10] ./index.js 2:0-47
[52] ./shared.js 133 bytes {52} [built]
chunk {179} main.js (main) 146 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
chunk {179} main.js (main) 146 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 146 bytes {179} [built]
+ 7 hidden root modules
@ -1557,7 +1557,7 @@ Child
> ./a [10] ./index.js 1:0-47
> ./b [10] ./index.js 2:0-47
[52] ./shared.js 133 bytes {52} [built]
chunk {179} main.js (main) 146 bytes (javascript) 4.81 KiB (runtime) [entry] [rendered]
chunk {179} main.js (main) 146 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered]
> ./ main
[10] ./index.js 146 bytes {179} [built]
+ 7 hidden root modules
@ -1592,11 +1592,11 @@ Entrypoint entry = vendor.js entry.js
`;
exports[`StatsTestCases should print correct stats for named-chunks-plugin-async 1`] = `
"Hash: 917f7d57676d66d930c8
"Hash: 1a5c8a67f4efa36169a8
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
entry.js 9.41 KiB {entry} [emitted] entry
entry.js 9.46 KiB {entry} [emitted] entry
modules_a_js.js 312 bytes {modules_a_js} [emitted]
modules_b_js.js 158 bytes {modules_b_js} [emitted]
Entrypoint entry = entry.js
@ -1633,7 +1633,7 @@ Child child:
`;
exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = `
"Hash: 0e0e3790d3df2b13e237
"Hash: 76af1230c05d7555e704
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -1644,13 +1644,13 @@ Built at: Thu Jan 01 1970 00:00:00 GMT
cir1.js 321 bytes {592} [emitted] cir1
cir2 from cir1.js 370 bytes {288}, {289} [emitted] cir2 from cir1
cir2.js 321 bytes {289} [emitted] cir2
main.js 8.45 KiB {179} [emitted] main
main.js 8.5 KiB {179} [emitted] main
Entrypoint main = main.js
chunk {90} ab.js (ab) 2 bytes <{179}> >{753}< [rendered]
> [10] ./index.js 1:0-6:8
[836] ./modules/b.js 1 bytes {90} {374} [built]
[839] ./modules/a.js 1 bytes {90} {374} [built]
chunk {179} main.js (main) 524 bytes (javascript) 3.96 KiB (runtime) >{90}< >{289}< >{374}< >{592}< [entry] [rendered]
chunk {179} main.js (main) 524 bytes (javascript) 4 KiB (runtime) >{90}< >{289}< >{374}< >{592}< [entry] [rendered]
> ./index main
[10] ./index.js 523 bytes {179} [built]
[544] ./modules/f.js 1 bytes {179} [built]
@ -1683,7 +1683,7 @@ chunk {753} ac in ab.js (ac in ab) 1 bytes <{90}> >{284}< [rendered]
exports[`StatsTestCases should print correct stats for parse-error 1`] = `
" Asset Size Chunks Chunk Names
main.js 4.34 KiB {179} main
main.js 4.44 KiB {179} main
Entrypoint main = main.js
[535] ./index.js + 1 modules 35 bytes {179} [built]
[996] ./b.js 55 bytes {179} [built] [failed] [1 error]
@ -1691,7 +1691,7 @@ Entrypoint main = main.js
ERROR in ./b.js 6:7
Module parse failed: Unexpected token (6:7)
You may need an appropriate loader to handle this file type.
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| includes
| a
> parser )
@ -1948,7 +1948,7 @@ prefetched2.js 119 bytes {379} [emitted] prefetched2
prefetched3.js 119 bytes {220} [emitted] prefetched3
Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js)
chunk {30} normal.js (normal) 1 bytes <{179}> [rendered]
chunk {179} main.js (main) 436 bytes (javascript) 6.2 KiB (runtime) >{30}< >{220}< >{379}< >{505}< (prefetch: {379} {505} {220}) [entry] [rendered]
chunk {179} main.js (main) 436 bytes (javascript) 6.24 KiB (runtime) >{30}< >{220}< >{379}< >{505}< (prefetch: {379} {505} {220}) [entry] [rendered]
chunk {220} prefetched3.js (prefetched3) 1 bytes <{179}> [rendered]
chunk {379} prefetched2.js (prefetched2) 1 bytes <{179}> [rendered]
chunk {505} prefetched.js (prefetched) 228 bytes <{179}> >{641}< >{746}< (prefetch: {641} {746}) [rendered]
@ -1963,7 +1963,7 @@ chunk {76} c1.js (c1) 1 bytes <{459}> [rendered]
chunk {128} b.js (b) 203 bytes <{179}> >{132}< >{751}< >{978}< (prefetch: {751} {132}) (preload: {978}) [rendered]
chunk {132} b3.js (b3) 1 bytes <{128}> [rendered]
chunk {178} a2.js (a2) 1 bytes <{786}> [rendered]
chunk {179} main.js (main) 195 bytes (javascript) 6.49 KiB (runtime) >{128}< >{459}< >{786}< (prefetch: {786} {128} {459}) [entry] [rendered]
chunk {179} main.js (main) 195 bytes (javascript) 6.53 KiB (runtime) >{128}< >{459}< >{786}< (prefetch: {786} {128} {459}) [entry] [rendered]
chunk {459} c.js (c) 134 bytes <{179}> >{3}< >{76}< (preload: {76} {3}) [rendered]
chunk {751} b1.js (b1) 1 bytes <{128}> [rendered]
chunk {786} a.js (a) 136 bytes <{179}> >{74}< >{178}< (prefetch: {74} {178}) [rendered]
@ -1974,14 +1974,14 @@ exports[`StatsTestCases should print correct stats for preload 1`] = `
" Asset Size Chunks Chunk Names
inner.js 119 bytes {746} [emitted] inner
inner2.js 164 bytes {641} [emitted] inner2
main.js 11.6 KiB {179} [emitted] main
main.js 11.7 KiB {179} [emitted] main
normal.js 118 bytes {30} [emitted] normal
preloaded.js 544 bytes {851} [emitted] preloaded
preloaded2.js 118 bytes {363} [emitted] preloaded2
preloaded3.js 117 bytes {355} [emitted] preloaded3
Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js)
chunk {30} normal.js (normal) 1 bytes [rendered]
chunk {179} main.js (main) 424 bytes (javascript) 6.12 KiB (runtime) (preload: {363} {851} {355}) [entry] [rendered]
chunk {179} main.js (main) 424 bytes (javascript) 6.16 KiB (runtime) (preload: {363} {851} {355}) [entry] [rendered]
chunk {355} preloaded3.js (preloaded3) 1 bytes [rendered]
chunk {363} preloaded2.js (preloaded2) 1 bytes [rendered]
chunk {641} inner2.js (inner2) 2 bytes [rendered]
@ -1990,7 +1990,7 @@ chunk {851} preloaded.js (preloaded) 226 bytes (preload: {641} {746}) [rendered]
`;
exports[`StatsTestCases should print correct stats for preset-detailed 1`] = `
"Hash: e10d62cab489fd2607c6
"Hash: e144b5c692f359fe416b
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
@ -1998,9 +1998,9 @@ PublicPath: (none)
460.js 311 bytes {460} [emitted]
524.js 220 bytes {524} [emitted]
996.js 147 bytes {996} [emitted]
main.js 7.64 KiB {179} [emitted] main
main.js 7.69 KiB {179} [emitted] main
Entrypoint main = main.js
chunk {179} main.js (main) 73 bytes (javascript) 3.86 KiB (runtime) >{460}< >{996}< [entry] [rendered]
chunk {179} main.js (main) 73 bytes (javascript) 3.9 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
chunk {460} 460.js 54 bytes <{179}> >{524}< [rendered]
> ./c [10] ./index.js 3:0-16
@ -2026,7 +2026,7 @@ webpack/runtime/ensure chunk 350 bytes {179} [runtime]
webpack/runtime/get javascript chunk filename 172 bytes {179} [runtime]
[no exports]
[used exports unknown]
webpack/runtime/jsonp chunk loading 3.32 KiB {179} [runtime]
webpack/runtime/jsonp chunk loading 3.36 KiB {179} [runtime]
[no exports]
[used exports unknown]
webpack/runtime/publicPath 27 bytes {179} [runtime]
@ -2063,14 +2063,14 @@ exports[`StatsTestCases should print correct stats for preset-none-array 1`] = `
exports[`StatsTestCases should print correct stats for preset-none-error 1`] = `""`;
exports[`StatsTestCases should print correct stats for preset-normal 1`] = `
"Hash: e10d62cab489fd2607c6
"Hash: e144b5c692f359fe416b
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
460.js 311 bytes {460} [emitted]
524.js 220 bytes {524} [emitted]
996.js 147 bytes {996} [emitted]
main.js 7.64 KiB {179} [emitted] main
main.js 7.69 KiB {179} [emitted] main
Entrypoint main = main.js
[10] ./index.js 51 bytes {179} [built]
[390] ./e.js 22 bytes {524} [built]
@ -2146,7 +2146,7 @@ Entrypoints:
`;
exports[`StatsTestCases should print correct stats for preset-verbose 1`] = `
"Hash: e10d62cab489fd2607c6
"Hash: e144b5c692f359fe416b
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
PublicPath: (none)
@ -2154,9 +2154,9 @@ PublicPath: (none)
460.js 311 bytes {460} [emitted]
524.js 220 bytes {524} [emitted]
996.js 147 bytes {996} [emitted]
main.js 7.64 KiB {179} [emitted] main
main.js 7.69 KiB {179} [emitted] main
Entrypoint main = main.js
chunk {179} main.js (main) 73 bytes (javascript) 3.86 KiB (runtime) >{460}< >{996}< [entry] [rendered]
chunk {179} main.js (main) 73 bytes (javascript) 3.9 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
[10] ./index.js 51 bytes {179} [depth 0] [built]
ModuleConcatenation bailout: Module is not an ECMAScript module
@ -2172,7 +2172,7 @@ chunk {179} main.js (main) 73 bytes (javascript) 3.86 KiB (runtime) >{460}< >{99
webpack/runtime/get javascript chunk filename 172 bytes {179} [runtime]
[no exports]
[used exports unknown]
webpack/runtime/jsonp chunk loading 3.32 KiB {179} [runtime]
webpack/runtime/jsonp chunk loading 3.36 KiB {179} [runtime]
[no exports]
[used exports unknown]
webpack/runtime/publicPath 27 bytes {179} [runtime]
@ -2256,7 +2256,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration
Asset Size Chunks Chunk Names
505.js 758 bytes {505} [emitted]
main1.js 568 bytes {909} [emitted] main1
runtime.js 8.75 KiB {666} [emitted] runtime
runtime.js 8.8 KiB {666} [emitted] runtime
Entrypoint main1 = runtime.js main1.js
[68] ./main1.js 66 bytes {909} [built]
[460] ./c.js 20 bytes {505} [built]
@ -2267,7 +2267,7 @@ Child manifest is named entry:
Asset Size Chunks Chunk Names
505.js 758 bytes {505} [emitted]
main1.js 568 bytes {909} [emitted] main1
manifest.js 8.99 KiB {700} [emitted] manifest
manifest.js 9.04 KiB {700} [emitted] manifest
Entrypoint main1 = manifest.js main1.js
Entrypoint manifest = manifest.js
[68] ./main1.js 66 bytes {909} [built]
@ -2289,7 +2289,7 @@ Entrypoint e2 = runtime.js e2.js"
`;
exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1`] = `
"Hash: e4fd2a856be58d136249
"Hash: 1d9ddee6d747795b5c8b
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint index = index.js
@ -2319,9 +2319,9 @@ Entrypoint entry = entry.js
`;
exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = `
"Hash: 480eedeb62f9790427830b0453c70b9973de2428
"Hash: 6aedb7431098670b8480d69784d6d58815dc5161
Child
Hash: 480eedeb62f979042783
Hash: 6aedb7431098670b8480
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint first = vendor.js first.js
@ -2339,7 +2339,7 @@ Child
[965] ./vendor.js 25 bytes {736} [built]
+ 10 hidden modules
Child
Hash: 0b0453c70b9973de2428
Hash: d69784d6d58815dc5161
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint first = vendor.js first.js
@ -2366,12 +2366,12 @@ Child
`;
exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = `
"Hash: 68e1b7bc73adde79c9b2
"Hash: a9799fc9d42f147ee886
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
1.js 478 bytes {1} [emitted]
main.js 10.1 KiB {0} [emitted] main
main.js 10.2 KiB {0} [emitted] main
Entrypoint main = main.js
[0] ./main.js + 1 modules 231 bytes {0} [built]
harmony side effect evaluation ./CompB ./components/src/CompAB/index.js 2:0-43
@ -2483,7 +2483,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = `
chunk {137} default/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2516,7 +2516,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = `
chunk {769} default/769.js 20 bytes <{179}> ={282}= ={383}= ={568}= ={767}= [rendered] split chunk (cache group: defaultVendors)
> ./c [10] ./index.js 3:0-47
[769] ./node_modules/z.js 20 bytes {459} {769} [built]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.8 KiB (runtime) >{137}< >{568}< [entry] [rendered]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.84 KiB (runtime) >{137}< >{568}< [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -2541,7 +2541,7 @@ Child all-chunks:
chunk {137} default/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2581,7 +2581,7 @@ Child all-chunks:
> ./c [10] ./index.js 3:0-47
> ./c c
[769] ./node_modules/z.js 20 bytes {769} [built]
chunk {786} default/a.js (a) 156 bytes (javascript) 5.74 KiB (runtime) ={282}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered]
chunk {786} default/a.js (a) 156 bytes (javascript) 5.77 KiB (runtime) ={282}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -2611,7 +2611,7 @@ Child manual:
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
+ 1 hidden dependent module
chunk {179} default/main.js (main) 147 bytes (javascript) 4.82 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2650,7 +2650,7 @@ Child manual:
[460] ./c.js 72 bytes {383} {459} [built]
+ 2 hidden root modules
+ 2 hidden dependent modules
chunk {786} default/a.js (a) 176 bytes (javascript) 5.74 KiB (runtime) ={216}= >{137}< [entry] [rendered]
chunk {786} default/a.js (a) 176 bytes (javascript) 5.77 KiB (runtime) ={216}= >{137}< [entry] [rendered]
> ./a a
> x a
> y a
@ -2670,7 +2670,7 @@ Child name-too-long:
chunk {137} async-g.js (async-g) 34 bytes <{282}> <{751}> <{767}> <{794}> <{954}> ={568}= [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
chunk {179} main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2700,7 +2700,7 @@ Child name-too-long:
chunk {658} cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 2.56 KiB ={282}= ={383}= ={568}= ={767}= ={769}= [entry] [rendered]
> ./c cccccccccccccccccccccccccccccc
2 root modules
chunk {751} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 5.72 KiB ={282}= ={767}= ={794}= ={954}= >{137}< >{568}< [entry] [rendered]
chunk {751} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 5.76 KiB ={282}= ={767}= ={794}= ={954}= >{137}< >{568}< [entry] [rendered]
> ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
7 root modules
chunk {766} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 2.56 KiB ={282}= ={334}= ={568}= ={767}= ={954}= [entry] [rendered]
@ -2741,7 +2741,7 @@ Child custom-chunks-filter:
chunk {137} default/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered]
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.81 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2779,7 +2779,7 @@ Child custom-chunks-filter:
> ./c [10] ./index.js 3:0-47
> ./c c
[769] ./node_modules/z.js 20 bytes {769} [built]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.8 KiB (runtime) >{137}< >{568}< [entry] [rendered]
chunk {786} default/a.js (a) 216 bytes (javascript) 4.84 KiB (runtime) >{137}< >{568}< [entry] [rendered]
> ./a a
[761] ./a.js + 1 modules 156 bytes {786} {794} [built]
+ 7 hidden root modules
@ -2809,7 +2809,7 @@ Child custom-chunks-filter-in-cache-groups:
> ./g ./a.js 6:0-47
[785] ./g.js 34 bytes {137} [built]
+ 1 hidden dependent module
chunk {179} default/main.js (main) 147 bytes (javascript) 4.82 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -2844,7 +2844,7 @@ Child custom-chunks-filter-in-cache-groups:
[460] ./c.js 72 bytes {383} {459} [built]
+ 2 hidden root modules
+ 2 hidden dependent modules
chunk {786} default/a.js (a) 236 bytes (javascript) 4.75 KiB (runtime) >{137}< [entry] [rendered]
chunk {786} default/a.js (a) 236 bytes (javascript) 4.79 KiB (runtime) >{137}< [entry] [rendered]
> ./a a
> x a
> y a
@ -2891,7 +2891,7 @@ chunk {common-node_modules_y_js} common-node_modules_y_js.js 20 bytes <{main}> =
chunk {common-node_modules_z_js} common-node_modules_z_js.js 20 bytes <{main}> ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b)
> ./c [10] ./index.js 3:0-47
[769] ./node_modules/z.js 20 bytes {common-node_modules_z_js} [built]
chunk {main} main.js (main) 147 bytes (javascript) 4.73 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered]
chunk {main} main.js (main) 147 bytes (javascript) 4.77 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {main} [built]
+ 7 hidden root modules"
@ -2907,7 +2907,7 @@ chunk {137} async-g.js (async-g) 101 bytes <{179}> [rendered]
> ./g [10] ./index.js 7:0-47
[785] ./g.js 34 bytes {137} [built]
+ 1 hidden dependent module
chunk {179} main.js (main) 343 bytes (javascript) 4.85 KiB (runtime) >{31}< >{137}< >{206}< >{334}< >{383}< >{449}< >{794}< >{804}< [entry] [rendered]
chunk {179} main.js (main) 343 bytes (javascript) 4.89 KiB (runtime) >{31}< >{137}< >{206}< >{334}< >{383}< >{449}< >{794}< >{804}< [entry] [rendered]
> ./ main
[10] ./index.js 343 bytes {179} [built]
+ 7 hidden root modules
@ -2938,7 +2938,7 @@ chunk {804} 804.js 134 bytes <{179}> ={334}= ={794}= [rendered] split chunk (cac
exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = `
"Entrypoint main = main.js
chunk {179} main.js (main) 147 bytes (javascript) 4.2 KiB (runtime) >{282}< >{334}< >{383}< >{543}< >{794}< [entry] [rendered]
chunk {179} main.js (main) 147 bytes (javascript) 4.23 KiB (runtime) >{282}< >{334}< >{383}< >{543}< >{794}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 5 hidden root modules
@ -2965,7 +2965,7 @@ chunk {794} async-a.js (async-a) 19 bytes <{179}> ={282}= ={543}= [rendered]
exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = `
"Entrypoint main = vendors.js main.js
chunk {179} main.js (main) 110 bytes (javascript) 5.12 KiB (runtime) ={216}= >{334}< >{794}< [entry] [rendered]
chunk {179} main.js (main) 110 bytes (javascript) 5.16 KiB (runtime) ={216}= >{334}< >{794}< [entry] [rendered]
> ./ main
[10] ./index.js 110 bytes {179} [built]
+ 5 hidden root modules
@ -2986,7 +2986,7 @@ exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1
"Entrypoint a = 282.js a.js
Entrypoint b = b.js
Chunk Group c = 282.js c.js
chunk {128} b.js (b) 43 bytes (javascript) 4.16 KiB (runtime) >{282}< >{459}< [entry] [rendered]
chunk {128} b.js (b) 43 bytes (javascript) 4.19 KiB (runtime) >{282}< >{459}< [entry] [rendered]
> ./b b
[996] ./b.js 43 bytes {128} [built]
+ 5 hidden root modules
@ -3005,7 +3005,7 @@ chunk {786} a.js (a) 12 bytes (javascript) 2.54 KiB (runtime) ={282}= [entry] [r
exports[`StatsTestCases should print correct stats for split-chunks-keep-remaining-size 1`] = `
"Entrypoint main = default/main.js
chunk {179} default/main.js (main) 147 bytes (javascript) 4.8 KiB (runtime) >{334}< >{383}< >{794}< >{821}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.83 KiB (runtime) >{334}< >{383}< >{794}< >{821}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden chunk modules
@ -3321,7 +3321,7 @@ Child zero-min:
[732] ./node_modules/small.js?2 67 bytes {869} [built]
Child max-async-size:
Entrypoint main = max-async-size-main.js
chunk {179} max-async-size-main.js (main) 2.47 KiB (javascript) 4.84 KiB (runtime) >{342}< >{385}< >{820}< >{920}< [entry] [rendered]
chunk {179} max-async-size-main.js (main) 2.47 KiB (javascript) 4.88 KiB (runtime) >{342}< >{385}< >{820}< >{920}< [entry] [rendered]
> ./async main
[855] ./async/index.js 386 bytes {179} [built]
+ 7 hidden root modules
@ -3429,7 +3429,7 @@ chunk {118} default/118.js 110 bytes <{179}> ={334}= ={383}= [rendered] split ch
> ./c [10] ./index.js 3:0-47
[568] ./f.js 67 bytes {118} [built]
[767] ./d.js 43 bytes {118} {794} [built]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.8 KiB (runtime) >{118}< >{334}< >{383}< >{794}< [entry] [rendered]
chunk {179} default/main.js (main) 147 bytes (javascript) 4.83 KiB (runtime) >{118}< >{334}< >{383}< >{794}< [entry] [rendered]
> ./ main
[10] ./index.js 147 bytes {179} [built]
+ 7 hidden root modules
@ -3508,7 +3508,7 @@ WARNING in Terser Plugin: Dropping unused function someUnRemoteUsedFunction5 [./
`;
exports[`StatsTestCases should print correct stats for wasm-explorer-examples-sync 1`] = `
"Hash: 6320d1106f38d42868c5
"Hash: 8c3293703d1d55ebe60f
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -3533,7 +3533,7 @@ chunk {325} 325.bundle.js, 256e72dd8b9a83a6e45b.module.wasm, 1d55f77c08cd19684f1
[287] ./popcnt.wasm 50 bytes (javascript) 120 bytes (webassembly) {325} [built]
[325] ./tests.js 1.44 KiB {325} [built]
[819] ./testFunction.wasm 50 bytes (javascript) 154 bytes (webassembly) {325} [built]
chunk {520} bundle.js (main-1df31ce3) 586 bytes (javascript) 5.15 KiB (runtime) [entry] [rendered]
chunk {520} bundle.js (main-1df31ce3) 586 bytes (javascript) 5.19 KiB (runtime) [entry] [rendered]
[10] ./index.js 586 bytes {520} [built]
+ 7 hidden chunk modules
chunk {526} 526.bundle.js 34 bytes [rendered] split chunk (cache group: defaultVendors)

View File

@ -5,15 +5,6 @@ module.exports = [
[
/Can't import the named export 'data' \(imported as 'data'\) from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the namespace object \(imported as 'star'\) from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the namespace object \(imported as 'star'\) from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the namespace object \(reexported as 'ns'\) from non EcmaScript module \(only default export is available\)/
],
[
/Can't import the named export 'data' \(reexported as 'data'\) from non EcmaScript module \(only default export is available\)/
]

View File

@ -0,0 +1,76 @@
import ok from "./module";
// This should not leak an "ok" declaration into this scope
export default (function ok() {});
it("should allow block scopes", () => {
expect(ok).toBe("ok");
if (true) {
const ok = "no";
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
{
let ok = "no";
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
{
class ok {}
expect(new ok()).toBeInstanceOf(ok);
}
expect(ok).toBe("ok");
for (let ok = "no", once = true; once; once = !once) {
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
for (const ok of ["no"]) {
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
for (const ok in { no: 1 }) {
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
try {
throw "no";
} catch (ok) {
expect(ok).toBe("no");
}
expect(ok).toBe("ok");
});
it("should allow function scopes in block scopes", () => {
let f;
{
f = () => {
expect(ok).toBe("no");
};
const ok = "no";
}
f();
});
it("should not block scope vars (for)", () => {
expect(ok).toBe(undefined);
for (var ok = "no", once = true; once; once = !once) {
expect(ok).toBe("no");
}
expect(ok).toBe("no");
});
it("should not block scope vars (for-of)", () => {
expect(ok).toBe(undefined);
for (var ok of ["no"]) {
expect(ok).toBe("no");
}
expect(ok).toBe("no");
});
it("should not block scope vars (for-in)", () => {
expect(ok).toBe(undefined);
for (var ok in { no: 1 }) {
expect(ok).toBe("no");
}
expect(ok).toBe("no");
});

View File

@ -0,0 +1 @@
export default "ok";

6
test/fixtures/errors/abc.html vendored Normal file
View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<h1>I love webpack :)</h1>
</body>
</html>

View File

@ -0,0 +1,3 @@
module.exports = function(source) {
return source + "// some comment";
};

View File

@ -0,0 +1,3 @@
module.exports = function(source) {
return source;
};

BIN
test/fixtures/font.ttf vendored Normal file

Binary file not shown.

View File

@ -137,9 +137,7 @@ for (const filePath of allFiles) {
}
if (match.index !== pos) {
console.log(
`${filePath}: Unexpected code at ${pos}-${match.index}, expected ${
current.title
}`
`${filePath}: Unexpected code at ${pos}-${match.index}, expected ${current.title}`
);
process.exitCode = 1;
pos = match.index;

View File

@ -373,9 +373,9 @@
integrity sha512-MeatbbUsZ80BEsKPXby6pUZjUM9ZuHIpWElN0siopih3fvnlpX2O9L6D5+dzDIb36lf9tM/8U4PVdLQ+L4qr4A==
"@types/node@^10.12.21":
version "10.14.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9"
integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==
version "10.14.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.9.tgz#2e8d678039d27943ce53a1913386133227fd9066"
integrity sha512-NelG/dSahlXYtSoVPErrp06tYFrvzj8XLWmKA+X8x0W//4MqbUyZu++giUG/v0bjAT6/Qxa8IjodrfdACyb0Fg==
"@types/prettier@^1.16.1":
version "1.16.1"
@ -800,7 +800,7 @@ async@1.x:
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
async@^2.5.0, async@^2.6.1:
async@^2.6.1:
version "2.6.2"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381"
integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==
@ -1249,12 +1249,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"
commander@^2.14.1, commander@^2.9.0, commander@~2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
commander@^2.19.0:
commander@^2.14.1, commander@^2.19.0, commander@^2.9.0, commander@~2.20.0:
version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
@ -1344,9 +1339,9 @@ cosmiconfig@^5.0.7, cosmiconfig@^5.2.0:
parse-json "^4.0.0"
coveralls@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8"
integrity sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==
version "3.0.4"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.4.tgz#f50233c9c62fd0973f710fce85fd19dba24cff4b"
integrity sha512-eyqUWA/7RT0JagiL0tThVhjbIjoiEUyWCjtUJoOPcWoeofP5WK/jb2OJYoBFrR6DvplR+AxOyuBqk4JHkk5ykA==
dependencies:
growl "~> 1.10.0"
js-yaml "^3.11.0"
@ -2079,11 +2074,6 @@ find-cache-dir@^2.1.0:
make-dir "^2.0.0"
pkg-dir "^3.0.0"
find-parent-dir@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54"
integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=
find-up@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
@ -2284,21 +2274,10 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
handlebars@^4.0.1:
version "4.1.0"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a"
integrity sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==
dependencies:
async "^2.5.0"
optimist "^0.6.1"
source-map "^0.6.1"
optionalDependencies:
uglify-js "^3.1.4"
handlebars@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.1.tgz#6e4e41c18ebe7719ae4d38e5aca3d32fa3dd23d3"
integrity sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==
handlebars@^4.0.1, handlebars@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==
dependencies:
neo-async "^2.6.0"
optimist "^0.6.1"
@ -3242,15 +3221,7 @@ js-stringify@^1.0.1:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.12.1, js-yaml@^3.13.0:
version "3.13.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.0.tgz#38ee7178ac0eea2c97ff6d96fff4b18c7d8cf98e"
integrity sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
js-yaml@^3.13.1:
js-yaml@3.x, js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.12.1, js-yaml@^3.13.0, js-yaml@^3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
@ -3482,9 +3453,9 @@ levn@^0.3.0, levn@~0.3.0:
type-check "~0.3.2"
lint-staged@^8.0.4:
version "8.1.7"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.7.tgz#a8988bc83bdffa97d04adb09dbc0b1f3a58fa6fc"
integrity sha512-egT0goFhIFoOGk6rasPngTFh2qDqxZddM0PwI58oi66RxCDcn5uDwxmiasWIF0qGnchHSYVJ8HPRD5LrFo7TKA==
version "8.2.0"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.0.tgz#3d4149a229580815c955047a7acd8f09054be5a9"
integrity sha512-DxguyxGOIfb67wZ6EOrqzjAbw6ZH9XK3YS74HO+erJf6+SAQeJJPN//GBOG5xhdt2THeuXjVPaHcCYOWGZwRbA==
dependencies:
chalk "^2.3.1"
commander "^2.14.1"
@ -3493,7 +3464,6 @@ lint-staged@^8.0.4:
dedent "^0.7.0"
del "^3.0.0"
execa "^1.0.0"
find-parent-dir "^0.3.0"
g-status "^2.0.2"
is-glob "^4.0.0"
is-windows "^1.0.2"
@ -4362,9 +4332,9 @@ prettier-linter-helpers@^1.0.0:
fast-diff "^1.1.2"
prettier@^1.14.3, prettier@^1.16.4:
version "1.16.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717"
integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
pretty-format@24.0.0:
version "24.0.0"
@ -5587,11 +5557,11 @@ uglify-js@^2.6.1:
uglify-to-browserify "~1.0.0"
uglify-js@^3.1.4:
version "3.5.2"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.2.tgz#dc0c7ac2da0a4b7d15e84266818ff30e82529474"
integrity sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg==
version "3.6.0"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==
dependencies:
commander "~2.19.0"
commander "~2.20.0"
source-map "~0.6.1"
uglify-to-browserify@~1.0.0: