merge used with usedExports

usedExports = false now means module is not used
This commit is contained in:
Tobias Koppers 2018-08-06 21:01:24 +02:00
parent c4e0a9f72e
commit d6cf42e4c2
18 changed files with 107 additions and 115 deletions

View File

@ -25,6 +25,7 @@ const isContained = (moduleUsedExports, newUsedExports) => {
if (newUsedExports === true) return false;
if (newUsedExports === false) return true;
if (moduleUsedExports === false) return false;
if (newUsedExports.length > moduleUsedExports.size) return false;
return newUsedExports.every(item => moduleUsedExports.has(item));
};
@ -46,7 +47,6 @@ class FlagDependencyUsagePlugin {
* @returns {void}
*/
const processModule = (module, usedExports) => {
module.setUsed(moduleGraph, true);
let ue = module.getUsedExports(moduleGraph);
if (ue === true) return;
if (usedExports === true) {
@ -67,15 +67,14 @@ class FlagDependencyUsagePlugin {
}
}
} else {
if (ue !== null) return;
module.setUsedExports(moduleGraph, (ue = false));
if (ue !== false) return;
module.setUsedExports(moduleGraph, (ue = new SortableSet()));
}
// for a module without side effects we stop tracking usage here when no export is used
// This module won't be evaluated in this case
if (module.factoryMeta.sideEffectFree) {
if (ue === false) return;
if (ue && ue !== true && ue.size === 0) return;
if (ue !== true && ue.size === 0) return;
}
queue.push([module, module, ue]);
@ -106,20 +105,17 @@ class FlagDependencyUsagePlugin {
if (!reference) return;
const referenceModule = reference.module;
const importedNames = reference.importedNames;
const oldUsed = referenceModule.getUsed(moduleGraph);
const oldUsedExports = referenceModule.getUsedExports(moduleGraph);
if (
!oldUsed ||
(importedNames &&
(!oldUsedExports ||
!isContained(oldUsedExports, importedNames)))
!oldUsedExports ||
!isContained(oldUsedExports, importedNames)
) {
processModule(referenceModule, importedNames);
}
};
for (const module of modules) {
module.setUsed(moduleGraph, false);
module.setUsedExports(moduleGraph, false);
}
/** @type {[Module, DependenciesBlock, UsedExports][]} */

View File

@ -29,7 +29,6 @@ class FlagInitialModulesAsUsedPlugin {
return;
}
for (const module of chunk.modulesIterable) {
module.setUsed(moduleGraph, true);
module.setUsedExports(moduleGraph, true);
moduleGraph.addExtraReason(module, this.explanation);
}

View File

@ -78,6 +78,8 @@ class FunctionModuleTemplatePlugin {
const usedExports = module.getUsedExports(moduleGraph);
if (usedExports === true) {
source.add(Template.toComment("all exports used") + "\n");
} else if (usedExports === false) {
source.add(Template.toComment("module unused") + "\n");
} else if (usedExports) {
if (usedExports.size === 0) {
source.add(Template.toComment("no exports used") + "\n");

View File

@ -42,13 +42,13 @@ class JsonGenerator extends Generator {
}
if (
Array.isArray(module.buildMeta.providedExports) &&
!module.isUsed(moduleGraph, "default")
!module.isExportUsed(moduleGraph, "default")
) {
// Only some exports are used: We can optimize here, by only generating a part of the JSON
const reducedJson = {};
for (const exportName of module.buildMeta.providedExports) {
if (exportName === "default") continue;
const used = module.isUsed(moduleGraph, exportName);
const used = module.getUsedName(moduleGraph, exportName);
if (typeof used === "string") {
reducedJson[used] = data[exportName];
}

View File

@ -45,7 +45,6 @@ const SortableSet = require("./util/SortableSet");
const EMPTY_RESOLVE_OPTIONS = {};
const optimizationBailoutSymbol = Symbol("optimization bailout");
const usedExportsSymbol = Symbol("used exports");
const usedSymbol = Symbol("used");
let debugId = 1000;
@ -163,27 +162,14 @@ class Module extends DependenciesBlock {
return list;
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @returns {null | boolean} the used exports
*/
getUsed(moduleGraph) {
const value = moduleGraph.getMeta(this)[usedSymbol];
return value === undefined ? null : value;
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @param {null | boolean} used the used status
* @returns {void}
*/
setUsed(moduleGraph, used) {
moduleGraph.getMeta(this)[usedSymbol] = used;
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @returns {false | true | SortableSet<string> | null} the used exports
* false: module is not used at all.
* true: the module namespace/object export is used.
* SortableSet<string>: these export names are used.
* empty SortableSet<string>: module is used but no export.
* null: unknown, worst case should be assumed.
*/
getUsedExports(moduleGraph) {
const value = moduleGraph.getMeta(this)[usedExportsSymbol];
@ -400,32 +386,51 @@ class Module extends DependenciesBlock {
/**
* @param {ModuleGraph} moduleGraph the module graph
* @param {string=} exportName a name of an export
* @returns {string | boolean} true, when no "exportName" is provided and the module is used.
* false, when module or referenced export is unused.
* string, the mangled export name when used.
* @returns {boolean} true, if the module is used
*/
isUsed(moduleGraph, exportName) {
const used = this.getUsed(moduleGraph);
if (!exportName) return used !== false;
isModuleUsed(moduleGraph) {
return this.getUsedExports(moduleGraph) !== false;
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @param {string} exportName a name of an export
* @returns {boolean} true, if the export is used
*/
isExportUsed(moduleGraph, exportName) {
const usedExports = this.getUsedExports(moduleGraph);
if (used === null || usedExports === null) return exportName;
if (!used) return false;
if (!usedExports) return false;
if (usedExports === true) return exportName;
if (usedExports === null || usedExports === true) return true;
if (usedExports === false) return false;
return usedExports.has(exportName);
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @param {string} exportName a name of an export
* @returns {string | false} false, when module or referenced export is unused.
* string, the mangled export name when used.
*/
getUsedName(moduleGraph, exportName) {
const usedExports = this.getUsedExports(moduleGraph);
if (usedExports === null || usedExports === true) return exportName;
if (usedExports === false) return false;
if (!usedExports.has(exportName)) return false;
let idx = usedExports.getFromUnorderedCache(getIndexMap).get(exportName);
if (idx < 0) return false;
// Mangle export name if possible
if (this.isProvided(exportName)) {
if (this.buildMeta.exportsType === "namespace") {
const idx = usedExports
.getFromUnorderedCache(getIndexMap)
.get(exportName);
return Template.numberToIdentifer(idx);
}
if (
this.buildMeta.exportsType === "named" &&
!usedExports.has("default")
) {
const idx = usedExports
.getFromUnorderedCache(getIndexMap)
.get(exportName);
return Template.numberToIdentifer(idx);
}
}

View File

@ -467,7 +467,7 @@ module.exports = class RuntimeTemplate {
}
if (exportName) {
const used = module.isUsed(moduleGraph, exportName);
const used = module.getUsedName(moduleGraph, exportName);
if (!used) {
const comment = Template.toNormalComment(`unused export ${exportName}`);
return `${comment} undefined`;

View File

@ -580,18 +580,13 @@ class Stats {
});
}
if (showUsedExports) {
const used = module.getUsed(moduleGraph);
if (used === true) {
const usedExports = module.getUsedExports(moduleGraph);
if (usedExports === null) {
obj.usedExports = null;
} else if (typeof usedExports === "boolean") {
obj.usedExports = usedExports;
} else {
obj.usedExports = Array.from(usedExports);
}
} else if (used === false) {
obj.usedExports = false;
const usedExports = module.getUsedExports(moduleGraph);
if (usedExports === null) {
obj.usedExports = null;
} else if (typeof usedExports === "boolean") {
obj.usedExports = usedExports;
} else {
obj.usedExports = Array.from(usedExports);
}
}
if (showProvidedExports) {
@ -1084,7 +1079,7 @@ class Stats {
if (module.usedExports === null) {
colors.cyan("[used exports unknown]");
} else if (module.usedExports === false) {
colors.cyan("[no exports used]");
colors.cyan("[module unused]");
} else if (
Array.isArray(module.usedExports) &&
module.usedExports.length === 0

View File

@ -47,7 +47,7 @@ HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTempla
*/
apply(dependency, source, { moduleGraph }) {
const dep = /** @type {HarmonyExportExpressionDependency} */ (dependency);
const used = dep.originModule.isUsed(moduleGraph, "default");
const used = dep.originModule.getUsedName(moduleGraph, "default");
const content = this.getContent(dep.originModule, used);
if (dep.range) {

View File

@ -35,14 +35,12 @@ const getHashValue = (moduleGraph, importedModule) => {
return "";
}
const used = importedModule.getUsed(moduleGraph);
const stringifiedUsed = JSON.stringify(used);
const usedExports = importedModule.getUsedExports(moduleGraph);
const stringifiedUsedExports = JSON.stringify(usedExports);
const stringifiedProvidedExports = JSON.stringify(
importedModule.buildMeta.providedExports
);
return stringifiedUsed + stringifiedUsedExports + stringifiedProvidedExports;
return stringifiedUsedExports + stringifiedProvidedExports;
};
class ExportMode {
@ -97,7 +95,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
getMode(moduleGraph, ignoreUnused) {
const name = this.name;
const id = this.id;
const used = this.originModule.isUsed(moduleGraph, name);
const used = this.originModule.getUsedName(moduleGraph, name);
const usedExports = this.originModule.getUsedExports(moduleGraph);
const importedModule = moduleGraph.getModule(this);
@ -492,7 +490,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
isUsed(dep, templateContext) {
const moduleGraph = templateContext.moduleGraph;
if (dep.name) {
return !!dep.originModule.isUsed(moduleGraph, dep.name);
return dep.originModule.isExportUsed(moduleGraph, dep.name);
} else {
const importedModule = templateContext.moduleGraph.getModule(dep);
const activeFromOtherStarExports = dep._discoverActiveExportsFromOtherStartExports(
@ -555,7 +553,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (default from non-harmony) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
importVar,
null
)
@ -566,7 +564,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (default from named exports) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
importVar,
""
)
@ -577,7 +575,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (fake namespace object from non-harmony) */ " +
this.getReexportFakeNamespaceObjectStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
importVar
)
);
@ -587,7 +585,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (non default export from non-harmony) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
"undefined",
""
)
@ -598,7 +596,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (default from non-harmony) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
importVar,
""
)
@ -609,7 +607,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (module object) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, mode.name),
module.getUsedName(moduleGraph, mode.name),
importVar,
""
)
@ -625,9 +623,9 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
"/* harmony reexport (safe) */ " +
this.getReexportStatement(
module,
module.isUsed(moduleGraph, item[0]),
module.getUsedName(moduleGraph, item[0]),
importVar,
importedModule.isUsed(moduleGraph, item[1])
importedModule.getUsedName(moduleGraph, item[1])
)
);
})

View File

@ -66,7 +66,7 @@ HarmonyExportSpecifierDependency.Template = class HarmonyExportSpecifierDependen
}
getContent(moduleGraph, dep) {
const used = dep.originModule.isUsed(moduleGraph, dep.name);
const used = dep.originModule.getUsedName(moduleGraph, dep.name);
if (!used) {
return `/* unused harmony export ${dep.name || "namespace"} */\n`;
}

View File

@ -166,7 +166,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
hash.update(
(importedModule &&
this.getId(moduleGraph) &&
importedModule.isUsed(moduleGraph, this.getId(moduleGraph))) + ""
importedModule.getUsedName(moduleGraph, this.getId(moduleGraph))) + ""
);
hash.update(
(importedModule &&
@ -174,11 +174,9 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
""
);
if (importedModule) {
const used = importedModule.getUsed(moduleGraph);
const usedExports = importedModule.getUsedExports(moduleGraph);
const stringifyUsed = JSON.stringify(used);
const stringifyUsedExports = JSON.stringify(usedExports);
hash.update(stringifyUsed + stringifyUsedExports + "");
hash.update(stringifyUsedExports);
}
}
}

View File

@ -79,7 +79,7 @@ const getExternalImport = (
asCall,
strictHarmonyModule
) => {
const used = importedModule.isUsed(moduleGraph, exportName);
const used = importedModule.getUsedName(moduleGraph, exportName);
if (!used) return "/* unused reexport */undefined";
const comment =
used !== exportName ? ` ${Template.toNormalComment(exportName)}` : "";
@ -149,7 +149,7 @@ const getFinalName = (
requestShortener,
strictHarmonyModule
);
} else if (!info.module.isUsed(moduleGraph, exportName)) {
} else if (!info.module.isExportUsed(moduleGraph, exportName)) {
return "/* unused export */ undefined";
}
const name = info.internalNames.get(directExport);
@ -324,7 +324,6 @@ class ConcatenatedModule extends Module {
this.depth = rootModule.depth;
// Info from Optimization
this.setUsed(moduleGraph, rootModule.getUsed(moduleGraph));
this.setUsedExports(moduleGraph, rootModule.getUsedExports(moduleGraph));
const modulesArray = Array.from(modules);
@ -1415,7 +1414,7 @@ class HarmonyExportExpressionDependencyConcatenatedTemplate extends DependencyTe
let content =
"/* harmony default export */ var __WEBPACK_MODULE_DEFAULT_EXPORT__ = ";
if (dep.originModule === this.rootModule) {
const used = dep.originModule.isUsed(moduleGraph, "default");
const used = dep.originModule.getUsedName(moduleGraph, "default");
const exportsName = dep.originModule.exportsArgument;
if (used) {
content += `${exportsName}[${JSON.stringify(used)}] = `;
@ -1505,7 +1504,7 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate extends Depen
const exportDefs = this.getExports(dep, { moduleGraph });
for (const def of exportDefs) {
const info = this.modulesMap.get(def.module);
const used = dep.originModule.isUsed(moduleGraph, def.name);
const used = dep.originModule.getUsedName(moduleGraph, def.name);
if (!used) {
source.insert(
-1,

View File

@ -388,7 +388,7 @@ class ModuleConcatenationPlugin {
// Modules that are not used can be ignored
if (
connection.originModule.factoryMeta.sideEffectFree &&
connection.originModule.getUsed(moduleGraph) === false
!connection.originModule.isModuleUsed(moduleGraph)
)
continue;

View File

@ -47,7 +47,7 @@ const generateImportObject = (moduleGraph, module, mangle) => {
const importedModule = moduleGraph.getModule(dep);
const exportName = dep.name;
const usedName =
importedModule && importedModule.isUsed(moduleGraph, exportName);
importedModule && importedModule.getUsedName(moduleGraph, exportName);
const description = dep.description;
const direct = dep.onlyDirectImport;

View File

@ -256,7 +256,7 @@ const rewriteExportNames = ({
path.remove();
return;
}
const usedName = module.isUsed(moduleGraph, path.node.name);
const usedName = module.getUsedName(moduleGraph, path.node.name);
if (!usedName) {
path.remove();
return;

View File

@ -58,7 +58,7 @@ class WebAssemblyJavascriptGenerator extends Generator {
const exportName = dep.name;
const usedName =
moduleGraph.getModule(dep) &&
moduleGraph.getModule(dep).isUsed(moduleGraph, exportName);
moduleGraph.getModule(dep).getUsedName(moduleGraph, exportName);
if (moduleGraph.getModule(dep)) {
if (usedName) {
@ -81,7 +81,7 @@ class WebAssemblyJavascriptGenerator extends Generator {
}
if (dep instanceof WebAssemblyExportImportedDependency) {
importData.names.add(dep.name);
const usedName = module.isUsed(moduleGraph, dep.exportName);
const usedName = module.getUsedName(moduleGraph, dep.exportName);
if (usedName) {
const defineStatement = Template.asString([
`${module.exportsArgument}[${JSON.stringify(

View File

@ -41,7 +41,7 @@ const getUsedDependencies = (moduleGraph, module, mangle) => {
const exportName = dep.name;
// TODO add the following 3 lines when removing of ModuleExport is possible
// const importedModule = moduleGraph.getModule(dep);
// const usedName = importedModule && importedModule.isUsed(moduleGraph, exportName);
// const usedName = importedModule && importedModule.getUsedName(moduleGraph, exportName);
// if (usedName !== false) {
if (mangle) {
array.push({

View File

@ -645,9 +645,9 @@ Entrypoint entry-1 = vendor-1.js entry-1.js
`;
exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = `
"Hash: bb2e5f90771d3e455287f855579fc92cc132a7e7
"Hash: 137d627ba070d33cdda49a001f783027b840be9c
Child
Hash: bb2e5f90771d3e455287
Hash: 137d627ba070d33cdda4
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -660,7 +660,7 @@ Child
| ./submodule-a.js 59 bytes [built]
| ./submodule-b.js 59 bytes [built]
Child
Hash: f855579fc92cc132a7e7
Hash: 9a001f783027b840be9c
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -1124,7 +1124,7 @@ Compilation error while processing magic comment(-s): /* webpackPrefetch: true,
`;
exports[`StatsTestCases should print correct stats for issue-7577 1`] = `
"Hash: 343642fcbd3799129ba32c35ee2e2540e24d30f79bb497d4a15c1a430bc3
"Hash: 343642fcbd3799129ba3c304c0cf29920d9747260bd6e5e36b1ff9a17678
Child
Hash: 343642fcbd3799129ba3
Time: Xms
@ -1136,28 +1136,28 @@ Child
Entrypoint main = a-runtime~main-aa303e56a90b4559481f.js a-all~main-0034bb84916bcade4cc7.js a-main-14ee9c594789bd77b887.js
[0] ./a.js 18 bytes {all~main} [built]
Child
Hash: 2c35ee2e2540e24d30f7
Hash: c304c0cf29920d974726
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
b-all~main-a293363005660974db22.js 459 bytes all~main [emitted] all~main
b-main-1dc1f5a633a7b6c2376f.js 123 bytes main [emitted] main
b-runtime~main-937400e6bee421a9af47.js 6.05 KiB runtime~main [emitted] runtime~main
b-vendors~main-18b100868c1420a63ed1.js 172 bytes vendors~main [emitted] vendors~main
Entrypoint main = b-runtime~main-937400e6bee421a9af47.js b-vendors~main-18b100868c1420a63ed1.js b-all~main-a293363005660974db22.js b-main-1dc1f5a633a7b6c2376f.js
b-vendors~main-13c0fc262f08dee65613.js 172 bytes vendors~main [emitted] vendors~main
Entrypoint main = b-runtime~main-937400e6bee421a9af47.js b-vendors~main-13c0fc262f08dee65613.js b-all~main-a293363005660974db22.js b-main-1dc1f5a633a7b6c2376f.js
[0] ./b.js 17 bytes {all~main} [built]
[1] ./node_modules/vendor.js 23 bytes {vendors~main} [built]
Child
Hash: 9bb497d4a15c1a430bc3
Hash: 0bd6e5e36b1ff9a17678
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
c-main-5eaed336f1da9c475636.js 114 bytes main [emitted] main
c-0-775a18a4f14e4483daf8.js 153 bytes 0 [emitted]
c-0-598d23de6ad7df2ab6e4.js 153 bytes 0 [emitted]
c-1-9039f4a1a11a97f28320.js 459 bytes 1 [emitted]
c-all~main-166656d0ac46d1a19871.js 296 bytes all~main [emitted] all~main
c-runtime~main-f75fab64c3cdea8ed8da.js 8.84 KiB runtime~main [emitted] runtime~main
Entrypoint main = c-runtime~main-f75fab64c3cdea8ed8da.js c-all~main-166656d0ac46d1a19871.js c-main-5eaed336f1da9c475636.js (prefetch: c-0-775a18a4f14e4483daf8.js c-1-9039f4a1a11a97f28320.js)
c-runtime~main-54fe8e7231733bcf484a.js 8.84 KiB runtime~main [emitted] runtime~main
Entrypoint main = c-runtime~main-54fe8e7231733bcf484a.js c-all~main-166656d0ac46d1a19871.js c-main-5eaed336f1da9c475636.js (prefetch: c-0-598d23de6ad7df2ab6e4.js c-1-9039f4a1a11a97f28320.js)
[0] ./c.js 61 bytes {all~main} [built]
[1] ./b.js 17 bytes {1} [built]
[2] ./node_modules/vendor.js 23 bytes {0} [built]"
@ -1291,7 +1291,7 @@ Entrypoint main = main.js
`;
exports[`StatsTestCases should print correct stats for module-assets 1`] = `
"Hash: bd21dd593eac70b70df9
"Hash: 0aa43ba74041bc65bc0a
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint main = main.js
@ -2140,7 +2140,7 @@ Entrypoint e2 = runtime.js e2.js"
`;
exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1`] = `
"Hash: 228d4a8e20984671a19e
"Hash: a0a30b6e8932d0227376
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint index = index.js
@ -2170,9 +2170,9 @@ Entrypoint entry = entry.js
`;
exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = `
"Hash: 1dfce172ee295757b605590e0d30e5aff8c2a291
"Hash: d1e41fb7099e132879ee438a93ced10bfac3b362
Child
Hash: 1dfce172ee295757b605
Hash: d1e41fb7099e132879ee
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint first = vendor.js first.js
@ -2189,7 +2189,7 @@ Child
[9] ./lazy_shared.js 31 bytes {5} [built]
[10] ./lazy_second.js 55 bytes {4} [built]
Child
Hash: 590e0d30e5aff8c2a291
Hash: 438a93ced10bfac3b362
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint first = vendor.js first.js
@ -2217,7 +2217,7 @@ Child
`;
exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = `
"Hash: c1a73df9634a4a29fd80
"Hash: 4f5d38944616c15bd399
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -2246,26 +2246,26 @@ Entrypoint main = main.js
| [only some exports used: default]
| harmony import specifier ./components ./main.js 4:15-20 (skipped side-effect-free modules)
./components/src/index.js 84 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./components [2] ./foo.js 1:0-37
harmony side effect evaluation ./components [3] ./main.js + 1 modules 1:0-44
./components/src/CompAB/index.js 87 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./CompAB ./components/src/index.js 1:0-40
harmony export imported specifier ./CompAB ./components/src/index.js 1:0-40
harmony export imported specifier ./CompAB ./components/src/index.js 1:0-40
./components/src/CompC/index.js 34 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./CompC ./components/src/index.js 2:0-43
harmony export imported specifier ./CompC ./components/src/index.js 2:0-43
./components/src/CompC/CompC.js 33 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./CompC ./components/src/CompC/index.js 1:0-34
harmony export imported specifier ./CompC ./components/src/CompC/index.js 1:0-34"
`;
exports[`StatsTestCases should print correct stats for side-effects-simple-unused 1`] = `
"Hash: 5200b5dfad57ef2e6c35
"Hash: c7b680da5c0d869389e8
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -2284,11 +2284,11 @@ Entrypoint main = main.js
| [only some exports used: z]
| harmony import specifier pmodule ./index.js 3:17-18 (skipped side-effect-free modules)
./node_modules/pmodule/a.js 60 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./a [0] ./index.js + 2 modules 1:0-20
harmony export imported specifier ./a [0] ./index.js + 2 modules 1:0-20
./node_modules/pmodule/b.js 69 bytes [built]
[no exports used]
[module unused]
harmony side effect evaluation ./b [0] ./index.js + 2 modules 2:0-30
harmony export imported specifier ./b [0] ./index.js + 2 modules 2:0-30
harmony export imported specifier ./b [0] ./index.js + 2 modules 2:0-30
@ -3013,7 +3013,7 @@ chunk {4} default/async-c.js (async-c) 48 bytes <{0}> ={2}= [rendered]
`;
exports[`StatsTestCases should print correct stats for tree-shaking 1`] = `
"Hash: bf9939407549f8882327
"Hash: 40df5eaa38b35883e99e
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names