mirror of https://github.com/webpack/webpack.git
Merge pull request #14890 from webpack/fix-space-limited
fix/refactor spaceLimited
This commit is contained in:
commit
b26793de1c
|
@ -1658,84 +1658,121 @@ const collapse = children => {
|
||||||
return newChildren;
|
return newChildren;
|
||||||
};
|
};
|
||||||
|
|
||||||
const spaceLimited = (itemsAndGroups, max) => {
|
const spaceLimited = (
|
||||||
|
itemsAndGroups,
|
||||||
|
max,
|
||||||
|
filteredChildrenLineReserved = false
|
||||||
|
) => {
|
||||||
|
if (max < 1) {
|
||||||
|
return {
|
||||||
|
children: undefined,
|
||||||
|
filteredChildren: getTotalItems(itemsAndGroups)
|
||||||
|
};
|
||||||
|
}
|
||||||
/** @type {any[] | undefined} */
|
/** @type {any[] | undefined} */
|
||||||
let children = undefined;
|
let children = undefined;
|
||||||
/** @type {number | undefined} */
|
/** @type {number | undefined} */
|
||||||
let filteredChildren = undefined;
|
let filteredChildren = undefined;
|
||||||
// This are the groups, which take 1+ lines each
|
// This are the groups, which take 1+ lines each
|
||||||
const groups = itemsAndGroups.filter(c => c.children || c.filteredChildren);
|
const groups = [];
|
||||||
// The sizes of the groups are stored in groupSizes
|
// The sizes of the groups are stored in groupSizes
|
||||||
const groupSizes = groups.map(g => getItemSize(g));
|
const groupSizes = [];
|
||||||
// This are the items, which take 1 line each
|
// This are the items, which take 1 line each
|
||||||
const items = itemsAndGroups.filter(c => !c.children && !c.filteredChildren);
|
const items = [];
|
||||||
// The total of group sizes
|
// The total of group sizes
|
||||||
let groupsSize = groupSizes.reduce((a, b) => a + b, 0);
|
let groupsSize = 0;
|
||||||
|
|
||||||
|
for (const itemOrGroup of itemsAndGroups) {
|
||||||
|
// is item
|
||||||
|
if (!itemOrGroup.children && !itemOrGroup.filteredChildren) {
|
||||||
|
items.push(itemOrGroup);
|
||||||
|
} else {
|
||||||
|
groups.push(itemOrGroup);
|
||||||
|
const size = getItemSize(itemOrGroup);
|
||||||
|
groupSizes.push(size);
|
||||||
|
groupsSize += size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (groupsSize + items.length <= max) {
|
if (groupsSize + items.length <= max) {
|
||||||
// The total size in the current state fits into the max
|
// The total size in the current state fits into the max
|
||||||
// keep all
|
// keep all
|
||||||
children = groups.concat(items);
|
children = groups.length > 0 ? groups.concat(items) : items;
|
||||||
} else if (
|
} else if (groups.length === 0) {
|
||||||
groups.length > 0 &&
|
// slice items to max
|
||||||
groups.length + Math.min(1, items.length) < max
|
// inner space marks that lines for filteredChildren already reserved
|
||||||
) {
|
const limit = max - (filteredChildrenLineReserved ? 0 : 1);
|
||||||
// If each group would take 1 line the total would be below the maximum
|
filteredChildren = items.length - limit;
|
||||||
// collapse some groups, keep items
|
items.length = limit;
|
||||||
while (groupsSize + items.length + (filteredChildren ? 1 : 0) > max) {
|
children = items;
|
||||||
|
} else {
|
||||||
|
// limit is the size when all groups are collapsed
|
||||||
|
const limit =
|
||||||
|
groups.length +
|
||||||
|
(filteredChildrenLineReserved || items.length === 0 ? 0 : 1);
|
||||||
|
if (limit < max) {
|
||||||
// calculate how much we are over the size limit
|
// calculate how much we are over the size limit
|
||||||
// this allows to approach the limit faster
|
// this allows to approach the limit faster
|
||||||
// it's always > 1
|
let oversize;
|
||||||
const oversize =
|
// If each group would take 1 line the total would be below the maximum
|
||||||
items.length + groupsSize + (filteredChildren ? 1 : 0) - max;
|
// collapse some groups, keep items
|
||||||
// Find the maximum group and process only this one
|
while (
|
||||||
const maxGroupSize = Math.max(...groupSizes);
|
(oversize =
|
||||||
if (maxGroupSize < items.length) {
|
groupsSize +
|
||||||
filteredChildren = items.length;
|
items.length +
|
||||||
items.length = 0;
|
(filteredChildren && !filteredChildrenLineReserved ? 1 : 0) -
|
||||||
continue;
|
max) > 0
|
||||||
}
|
) {
|
||||||
for (let i = 0; i < groups.length; i++) {
|
// Find the maximum group and process only this one
|
||||||
if (groupSizes[i] === maxGroupSize) {
|
const maxGroupSize = Math.max(...groupSizes);
|
||||||
const group = groups[i];
|
if (maxGroupSize < items.length) {
|
||||||
// run this algorithm recursively and limit the size of the children to
|
filteredChildren = items.length;
|
||||||
// current size - oversize / number of groups
|
items.length = 0;
|
||||||
// So it should always end up being smaller
|
continue;
|
||||||
const headerSize = !group.children
|
}
|
||||||
? 0
|
for (let i = 0; i < groups.length; i++) {
|
||||||
: group.filteredChildren
|
if (groupSizes[i] === maxGroupSize) {
|
||||||
? 2
|
const group = groups[i];
|
||||||
: 1;
|
// run this algorithm recursively and limit the size of the children to
|
||||||
const limited = spaceLimited(
|
// current size - oversize / number of groups
|
||||||
group.children,
|
// So it should always end up being smaller
|
||||||
groupSizes[i] - headerSize - oversize / groups.length
|
const headerSize = group.filteredChildren ? 2 : 1;
|
||||||
);
|
const limited = spaceLimited(
|
||||||
groups[i] = {
|
group.children,
|
||||||
...group,
|
maxGroupSize -
|
||||||
children: limited.children,
|
// we should use ceil to always feet in max
|
||||||
filteredChildren:
|
Math.ceil(oversize / groups.length) -
|
||||||
(group.filteredChildren || 0) + limited.filteredChildren
|
// we substitute size of group head
|
||||||
};
|
headerSize,
|
||||||
const newSize = getItemSize(groups[i]);
|
headerSize === 2
|
||||||
groupsSize -= groupSizes[i] - newSize;
|
);
|
||||||
groupSizes[i] = newSize;
|
groups[i] = {
|
||||||
break;
|
...group,
|
||||||
|
children: limited.children,
|
||||||
|
filteredChildren: limited.filteredChildren
|
||||||
|
? (group.filteredChildren || 0) + limited.filteredChildren
|
||||||
|
: group.filteredChildren
|
||||||
|
};
|
||||||
|
const newSize = getItemSize(groups[i]);
|
||||||
|
groupsSize -= maxGroupSize - newSize;
|
||||||
|
groupSizes[i] = newSize;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
children = groups.concat(items);
|
||||||
|
} else if (limit === max) {
|
||||||
|
// If we have only enough space to show one line per group and one line for the filtered items
|
||||||
|
// collapse all groups and items
|
||||||
|
children = collapse(groups);
|
||||||
|
filteredChildren = items.length;
|
||||||
|
} else {
|
||||||
|
// If we have no space
|
||||||
|
// collapse complete group
|
||||||
|
filteredChildren = getTotalItems(itemsAndGroups);
|
||||||
}
|
}
|
||||||
children = groups.concat(items);
|
|
||||||
} else if (
|
|
||||||
groups.length > 0 &&
|
|
||||||
groups.length + Math.min(1, items.length) <= max
|
|
||||||
) {
|
|
||||||
// If we have only enough space to show one line per group and one line for the filtered items
|
|
||||||
// collapse all groups and items
|
|
||||||
children = groups.length ? collapse(groups) : undefined;
|
|
||||||
filteredChildren = items.length;
|
|
||||||
} else {
|
|
||||||
// If we have no space
|
|
||||||
// collapse complete group
|
|
||||||
filteredChildren = getTotalItems(itemsAndGroups);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
children,
|
children,
|
||||||
filteredChildren
|
filteredChildren
|
||||||
|
@ -1777,6 +1814,9 @@ const reasonGroup = (children, reasons) => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/;
|
||||||
|
const GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/;
|
||||||
|
|
||||||
/** @type {Record<string, (groupConfigs: GroupConfig[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} */
|
/** @type {Record<string, (groupConfigs: GroupConfig[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} */
|
||||||
const ASSETS_GROUPERS = {
|
const ASSETS_GROUPERS = {
|
||||||
_: (groupConfigs, context, options) => {
|
_: (groupConfigs, context, options) => {
|
||||||
|
@ -1825,10 +1865,10 @@ const ASSETS_GROUPERS = {
|
||||||
groupConfigs.push({
|
groupConfigs.push({
|
||||||
getKeys: asset => {
|
getKeys: asset => {
|
||||||
const extensionMatch =
|
const extensionMatch =
|
||||||
groupAssetsByExtension && /(\.[^.]+)(?:\?.*|$)/.exec(asset.name);
|
groupAssetsByExtension && GROUP_EXTENSION_REGEXP.exec(asset.name);
|
||||||
const extension = extensionMatch ? extensionMatch[1] : "";
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
||||||
const pathMatch =
|
const pathMatch =
|
||||||
groupAssetsByPath && /(.+)[/\\][^/\\]+(?:\?.*|$)/.exec(asset.name);
|
groupAssetsByPath && GROUP_PATH_REGEXP.exec(asset.name);
|
||||||
const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
||||||
const keys = [];
|
const keys = [];
|
||||||
if (groupAssetsByPath) {
|
if (groupAssetsByPath) {
|
||||||
|
@ -2025,10 +2065,10 @@ const MODULES_GROUPERS = type => ({
|
||||||
const dataUrl = /^data:[^,;]+/.exec(resource);
|
const dataUrl = /^data:[^,;]+/.exec(resource);
|
||||||
if (dataUrl) return [dataUrl[0]];
|
if (dataUrl) return [dataUrl[0]];
|
||||||
const extensionMatch =
|
const extensionMatch =
|
||||||
groupModulesByExtension && /(\.[^.]+)(?:\?.*|$)/.exec(resource);
|
groupModulesByExtension && GROUP_EXTENSION_REGEXP.exec(resource);
|
||||||
const extension = extensionMatch ? extensionMatch[1] : "";
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
||||||
const pathMatch =
|
const pathMatch =
|
||||||
groupModulesByPath && /(.+)[/\\][^/\\]+(?:\?.*|$)/.exec(resource);
|
groupModulesByPath && GROUP_PATH_REGEXP.exec(resource);
|
||||||
const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
const path = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
||||||
const keys = [];
|
const keys = [];
|
||||||
if (groupModulesByPath) {
|
if (groupModulesByPath) {
|
||||||
|
|
|
@ -57,6 +57,10 @@ const isValidId = id => {
|
||||||
return typeof id === "number" || id;
|
return typeof id === "number" || id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const moreCount = (list, count) => {
|
||||||
|
return list && list.length > 0 ? `+ ${count}` : `${count}`;
|
||||||
|
};
|
||||||
|
|
||||||
/** @type {Record<string, (thing: any, context: StatsPrinterContext, printer: StatsPrinter) => string | void>} */
|
/** @type {Record<string, (thing: any, context: StatsPrinterContext, printer: StatsPrinter) => string | void>} */
|
||||||
const SIMPLE_PRINTERS = {
|
const SIMPLE_PRINTERS = {
|
||||||
"compilation.summary!": (
|
"compilation.summary!": (
|
||||||
|
@ -182,13 +186,24 @@ const SIMPLE_PRINTERS = {
|
||||||
},
|
},
|
||||||
"compilation.assetsByChunkName": () => "",
|
"compilation.assetsByChunkName": () => "",
|
||||||
|
|
||||||
"compilation.filteredModules": filteredModules =>
|
"compilation.filteredModules": (
|
||||||
|
filteredModules,
|
||||||
|
{ compilation: { modules } }
|
||||||
|
) =>
|
||||||
filteredModules > 0
|
filteredModules > 0
|
||||||
? `${filteredModules} ${plural(filteredModules, "module", "modules")}`
|
? `${moreCount(modules, filteredModules)} ${plural(
|
||||||
|
filteredModules,
|
||||||
|
"module",
|
||||||
|
"modules"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) =>
|
"compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) =>
|
||||||
filteredAssets > 0
|
filteredAssets > 0
|
||||||
? `${filteredAssets} ${plural(filteredAssets, "asset", "assets")}`
|
? `${moreCount(assets, filteredAssets)} ${plural(
|
||||||
|
filteredAssets,
|
||||||
|
"asset",
|
||||||
|
"assets"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"compilation.logging": (logging, context, printer) =>
|
"compilation.logging": (logging, context, printer) =>
|
||||||
Array.isArray(logging)
|
Array.isArray(logging)
|
||||||
|
@ -281,15 +296,19 @@ const SIMPLE_PRINTERS = {
|
||||||
"asset.separator!": () => "\n",
|
"asset.separator!": () => "\n",
|
||||||
"asset.filteredRelated": (filteredRelated, { asset: { related } }) =>
|
"asset.filteredRelated": (filteredRelated, { asset: { related } }) =>
|
||||||
filteredRelated > 0
|
filteredRelated > 0
|
||||||
? `${filteredRelated} related ${plural(
|
? `${moreCount(related, filteredRelated)} related ${plural(
|
||||||
filteredRelated,
|
filteredRelated,
|
||||||
"asset",
|
"asset",
|
||||||
"assets"
|
"assets"
|
||||||
)}`
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"asset.filteredChildren": filteredChildren =>
|
"asset.filteredChildren": (filteredChildren, { asset: { children } }) =>
|
||||||
filteredChildren > 0
|
filteredChildren > 0
|
||||||
? `${filteredChildren} ${plural(filteredChildren, "asset", "assets")}`
|
? `${moreCount(children, filteredChildren)} ${plural(
|
||||||
|
filteredChildren,
|
||||||
|
"asset",
|
||||||
|
"assets"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
||||||
assetChunk: (id, { formatChunkId }) => formatChunkId(id),
|
assetChunk: (id, { formatChunkId }) => formatChunkId(id),
|
||||||
|
@ -385,21 +404,29 @@ const SIMPLE_PRINTERS = {
|
||||||
"module.issuerPath": (issuerPath, { module }) =>
|
"module.issuerPath": (issuerPath, { module }) =>
|
||||||
module.profile ? undefined : "",
|
module.profile ? undefined : "",
|
||||||
"module.profile": profile => undefined,
|
"module.profile": profile => undefined,
|
||||||
"module.filteredModules": filteredModules =>
|
"module.filteredModules": (filteredModules, { module: { modules } }) =>
|
||||||
filteredModules > 0
|
filteredModules > 0
|
||||||
? `${filteredModules} nested ${plural(
|
? `${moreCount(modules, filteredModules)} nested ${plural(
|
||||||
filteredModules,
|
filteredModules,
|
||||||
"module",
|
"module",
|
||||||
"modules"
|
"modules"
|
||||||
)}`
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"module.filteredReasons": filteredReasons =>
|
"module.filteredReasons": (filteredReasons, { module: { reasons } }) =>
|
||||||
filteredReasons > 0
|
filteredReasons > 0
|
||||||
? `${filteredReasons} ${plural(filteredReasons, "reason", "reasons")}`
|
? `${moreCount(reasons, filteredReasons)} ${plural(
|
||||||
|
filteredReasons,
|
||||||
|
"reason",
|
||||||
|
"reasons"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"module.filteredChildren": filteredChildren =>
|
"module.filteredChildren": (filteredChildren, { module: { children } }) =>
|
||||||
filteredChildren > 0
|
filteredChildren > 0
|
||||||
? `${filteredChildren} ${plural(filteredChildren, "module", "modules")}`
|
? `${moreCount(children, filteredChildren)} ${plural(
|
||||||
|
filteredChildren,
|
||||||
|
"module",
|
||||||
|
"modules"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
"module.separator!": () => "\n",
|
"module.separator!": () => "\n",
|
||||||
|
|
||||||
|
@ -417,9 +444,16 @@ const SIMPLE_PRINTERS = {
|
||||||
"moduleReason.active": (active, { formatFlag }) =>
|
"moduleReason.active": (active, { formatFlag }) =>
|
||||||
active ? undefined : formatFlag("inactive"),
|
active ? undefined : formatFlag("inactive"),
|
||||||
"moduleReason.resolvedModule": (module, { magenta }) => magenta(module),
|
"moduleReason.resolvedModule": (module, { magenta }) => magenta(module),
|
||||||
"moduleReason.filteredChildren": filteredChildren =>
|
"moduleReason.filteredChildren": (
|
||||||
|
filteredChildren,
|
||||||
|
{ moduleReason: { children } }
|
||||||
|
) =>
|
||||||
filteredChildren > 0
|
filteredChildren > 0
|
||||||
? `${filteredChildren} ${plural(filteredChildren, "reason", "reasons")}`
|
? `${moreCount(children, filteredChildren)} ${plural(
|
||||||
|
filteredChildren,
|
||||||
|
"reason",
|
||||||
|
"reasons"
|
||||||
|
)}`
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
||||||
"module.profile.total": (value, { formatTime }) => formatTime(value),
|
"module.profile.total": (value, { formatTime }) => formatTime(value),
|
||||||
|
@ -447,10 +481,21 @@ const SIMPLE_PRINTERS = {
|
||||||
size ? formatSize(size) : undefined,
|
size ? formatSize(size) : undefined,
|
||||||
"chunkGroup.auxiliaryAssetsSize": (size, { formatSize }) =>
|
"chunkGroup.auxiliaryAssetsSize": (size, { formatSize }) =>
|
||||||
size ? `(${formatSize(size)})` : undefined,
|
size ? `(${formatSize(size)})` : undefined,
|
||||||
"chunkGroup.filteredAssets": n =>
|
"chunkGroup.filteredAssets": (n, { chunkGroup: { assets } }) =>
|
||||||
n > 0 ? `${n} ${plural(n, "asset", "assets")}` : undefined,
|
n > 0
|
||||||
"chunkGroup.filteredAuxiliaryAssets": n =>
|
? `${moreCount(assets, n)} ${plural(n, "asset", "assets")}`
|
||||||
n > 0 ? `${n} auxiliary ${plural(n, "asset", "assets")}` : undefined,
|
: undefined,
|
||||||
|
"chunkGroup.filteredAuxiliaryAssets": (
|
||||||
|
n,
|
||||||
|
{ chunkGroup: { auxiliaryAssets } }
|
||||||
|
) =>
|
||||||
|
n > 0
|
||||||
|
? `${moreCount(auxiliaryAssets, n)} auxiliary ${plural(
|
||||||
|
n,
|
||||||
|
"asset",
|
||||||
|
"assets"
|
||||||
|
)}`
|
||||||
|
: undefined,
|
||||||
"chunkGroup.is!": () => "=",
|
"chunkGroup.is!": () => "=",
|
||||||
"chunkGroupAsset.name": (asset, { green }) => green(asset),
|
"chunkGroupAsset.name": (asset, { green }) => green(asset),
|
||||||
"chunkGroupAsset.size": (size, { formatSize, chunkGroup }) =>
|
"chunkGroupAsset.size": (size, { formatSize, chunkGroup }) =>
|
||||||
|
@ -510,9 +555,9 @@ const SIMPLE_PRINTERS = {
|
||||||
"chunk.recorded": (recorded, { formatFlag, green }) =>
|
"chunk.recorded": (recorded, { formatFlag, green }) =>
|
||||||
recorded ? green(formatFlag("recorded")) : undefined,
|
recorded ? green(formatFlag("recorded")) : undefined,
|
||||||
"chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined),
|
"chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined),
|
||||||
"chunk.filteredModules": filteredModules =>
|
"chunk.filteredModules": (filteredModules, { chunk: { modules } }) =>
|
||||||
filteredModules > 0
|
filteredModules > 0
|
||||||
? `${filteredModules} chunk ${plural(
|
? `${moreCount(modules, filteredModules)} chunk ${plural(
|
||||||
filteredModules,
|
filteredModules,
|
||||||
"module",
|
"module",
|
||||||
"modules"
|
"modules"
|
||||||
|
|
|
@ -1363,13 +1363,46 @@ webpack x.x.x compiled <CLR=32,BOLD>successfully</CLR> in X ms"
|
||||||
|
|
||||||
exports[`StatsTestCases should print correct stats for max-modules 1`] = `
|
exports[`StatsTestCases should print correct stats for max-modules 1`] = `
|
||||||
"asset main.js 5.47 KiB [emitted] (name: main)
|
"asset main.js 5.47 KiB [emitted] (name: main)
|
||||||
31 modules
|
./index.js 181 bytes [built] [code generated]
|
||||||
|
./a.js?1 33 bytes [built] [code generated]
|
||||||
|
./a.js?2 33 bytes [built] [code generated]
|
||||||
|
./a.js?3 33 bytes [built] [code generated]
|
||||||
|
./a.js?4 33 bytes [built] [code generated]
|
||||||
|
./a.js?5 33 bytes [built] [code generated]
|
||||||
|
./a.js?6 33 bytes [built] [code generated]
|
||||||
|
./a.js?7 33 bytes [built] [code generated]
|
||||||
|
./a.js?8 33 bytes [built] [code generated]
|
||||||
|
./a.js?9 33 bytes [built] [code generated]
|
||||||
|
./a.js?10 33 bytes [built] [code generated]
|
||||||
|
./c.js?1 33 bytes [built] [code generated]
|
||||||
|
./c.js?2 33 bytes [built] [code generated]
|
||||||
|
./c.js?3 33 bytes [built] [code generated]
|
||||||
|
./c.js?4 33 bytes [built] [code generated]
|
||||||
|
./c.js?5 33 bytes [built] [code generated]
|
||||||
|
./c.js?6 33 bytes [built] [code generated]
|
||||||
|
./c.js?7 33 bytes [built] [code generated]
|
||||||
|
./c.js?8 33 bytes [built] [code generated]
|
||||||
|
+ 12 modules
|
||||||
webpack x.x.x compiled successfully in X ms"
|
webpack x.x.x compiled successfully in X ms"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`StatsTestCases should print correct stats for max-modules-default 1`] = `
|
exports[`StatsTestCases should print correct stats for max-modules-default 1`] = `
|
||||||
"asset main.js 5.47 KiB [emitted] (name: main)
|
"asset main.js 5.47 KiB [emitted] (name: main)
|
||||||
31 modules
|
./index.js 181 bytes [built] [code generated]
|
||||||
|
./a.js?1 33 bytes [built] [code generated]
|
||||||
|
./a.js?2 33 bytes [built] [code generated]
|
||||||
|
./a.js?3 33 bytes [built] [code generated]
|
||||||
|
./a.js?4 33 bytes [built] [code generated]
|
||||||
|
./a.js?5 33 bytes [built] [code generated]
|
||||||
|
./a.js?6 33 bytes [built] [code generated]
|
||||||
|
./a.js?7 33 bytes [built] [code generated]
|
||||||
|
./a.js?8 33 bytes [built] [code generated]
|
||||||
|
./a.js?9 33 bytes [built] [code generated]
|
||||||
|
./a.js?10 33 bytes [built] [code generated]
|
||||||
|
./c.js?1 33 bytes [built] [code generated]
|
||||||
|
./c.js?2 33 bytes [built] [code generated]
|
||||||
|
./c.js?3 33 bytes [built] [code generated]
|
||||||
|
+ 17 modules
|
||||||
webpack x.x.x compiled successfully in X ms"
|
webpack x.x.x compiled successfully in X ms"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -2661,27 +2694,27 @@ exclude1:
|
||||||
hidden assets 28.9 KiB 2 assets
|
hidden assets 28.9 KiB 2 assets
|
||||||
sourceMap exclude1-main.js.map 12.5 KiB [emitted] [dev] (auxiliary name: main)
|
sourceMap exclude1-main.js.map 12.5 KiB [emitted] [dev] (auxiliary name: main)
|
||||||
hidden assets 25 KiB 2 assets
|
hidden assets 25 KiB 2 assets
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
asset exclude1-chunk_js.js 804 bytes [emitted]
|
asset exclude1-chunk_js.js 804 bytes [emitted]
|
||||||
hidden assets 1.57 KiB 2 assets
|
hidden assets 1.57 KiB 2 assets
|
||||||
sourceMap exclude1-chunk_js.js.map 295 bytes [emitted] [dev]
|
sourceMap exclude1-chunk_js.js.map 295 bytes [emitted] [dev]
|
||||||
hidden assets 590 bytes 2 assets
|
hidden assets 590 bytes 2 assets
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
assets by path *.css 144 bytes
|
assets by path *.css 144 bytes
|
||||||
asset exclude1-chunk_js.css 74 bytes [emitted]
|
asset exclude1-chunk_js.css 74 bytes [emitted]
|
||||||
hidden assets 148 bytes 2 assets
|
hidden assets 148 bytes 2 assets
|
||||||
sourceMap exclude1-chunk_js.css.map 197 bytes [emitted] [dev]
|
sourceMap exclude1-chunk_js.css.map 197 bytes [emitted] [dev]
|
||||||
hidden assets 394 bytes 2 assets
|
hidden assets 394 bytes 2 assets
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
asset exclude1-main.css 70 bytes [emitted] (name: main)
|
asset exclude1-main.css 70 bytes [emitted] (name: main)
|
||||||
hidden assets 140 bytes 2 assets
|
hidden assets 140 bytes 2 assets
|
||||||
sourceMap exclude1-main.css.map 187 bytes [emitted] [dev] (auxiliary name: main)
|
sourceMap exclude1-main.css.map 187 bytes [emitted] [dev] (auxiliary name: main)
|
||||||
hidden assets 374 bytes 2 assets
|
hidden assets 374 bytes 2 assets
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
1 related asset
|
+ 1 related asset
|
||||||
|
|
||||||
exclude2:
|
exclude2:
|
||||||
assets by path *.js 15.2 KiB
|
assets by path *.js 15.2 KiB
|
||||||
|
@ -3089,7 +3122,27 @@ exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1
|
||||||
"runtime modules 6.83 KiB 10 modules
|
"runtime modules 6.83 KiB 10 modules
|
||||||
built modules 615 bytes [built]
|
built modules 615 bytes [built]
|
||||||
code generated modules 530 bytes [code generated]
|
code generated modules 530 bytes [code generated]
|
||||||
modules by path ./*.js 377 bytes 7 modules
|
./index.js 150 bytes [built] [code generated]
|
||||||
|
Statement (ExpressionStatement) with side effects in source code at 7:0-25
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./cjs.js: Module is not an ECMAScript module
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./eval.js: Module uses eval()
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./module-id.js: Module uses module.id
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./module-loaded.js: Module uses module.loaded
|
||||||
|
./entry.js 32 bytes [built] [code generated]
|
||||||
|
./cjs.js 59 bytes [built] [code generated]
|
||||||
|
CommonJS bailout: module.exports is used directly at 3:0-14
|
||||||
|
Statement (ExpressionStatement) with side effects in source code at 1:0-26
|
||||||
|
ModuleConcatenation bailout: Module is not an ECMAScript module
|
||||||
|
./ref-from-cjs.js 45 bytes [built] [code generated]
|
||||||
|
./eval.js 35 bytes [built] [code generated]
|
||||||
|
Statement (ExportDefaultDeclaration) with side effects in source code at 1:0-34
|
||||||
|
ModuleConcatenation bailout: Module uses eval()
|
||||||
|
./module-id.js 26 bytes [built] [code generated]
|
||||||
|
Statement (ExportDefaultDeclaration) with side effects in source code at 1:0-25
|
||||||
|
ModuleConcatenation bailout: Module uses module.id
|
||||||
|
./module-loaded.js 30 bytes [built] [code generated]
|
||||||
|
Statement (ExportDefaultDeclaration) with side effects in source code at 1:0-29
|
||||||
|
ModuleConcatenation bailout: Module uses module.loaded
|
||||||
./concatenated.js + 2 modules 111 bytes [built] [code generated]
|
./concatenated.js + 2 modules 111 bytes [built] [code generated]
|
||||||
ModuleConcatenation bailout: Cannot concat with external \\"external\\": Module external \\"external\\" is not in the same chunk(s) (expected in chunk(s) unnamed chunk(s), module is in chunk(s) index)
|
ModuleConcatenation bailout: Cannot concat with external \\"external\\": Module external \\"external\\" is not in the same chunk(s) (expected in chunk(s) unnamed chunk(s), module is in chunk(s) index)
|
||||||
external \\"external\\" 42 bytes [built] [code generated]
|
external \\"external\\" 42 bytes [built] [code generated]
|
||||||
|
@ -3124,14 +3177,18 @@ Entrypoint second 13.5 KiB = b-vendor.js 419 bytes b-second.js 13.1 KiB
|
||||||
runtime modules 15.1 KiB 20 modules
|
runtime modules 15.1 KiB 20 modules
|
||||||
cacheable modules 975 bytes
|
cacheable modules 975 bytes
|
||||||
code generated modules 857 bytes [code generated]
|
code generated modules 857 bytes [code generated]
|
||||||
modules by path ./*.js + 1 modules 459 bytes 3 modules
|
|
||||||
modules by path ./*.js 106 bytes
|
|
||||||
./vendor.js 25 bytes [built] [code generated]
|
|
||||||
./lazy_shared.js 56 bytes [built] [code generated]
|
|
||||||
ModuleConcatenation bailout: Cannot concat with ./common_lazy_shared.js: Module ./common_lazy_shared.js is referenced from different chunks by these modules: ./lazy_first.js, ./lazy_second.js
|
|
||||||
./common_lazy_shared.js 25 bytes [built] [code generated]
|
|
||||||
./first.js + 2 modules 292 bytes [built] [code generated]
|
./first.js + 2 modules 292 bytes [built] [code generated]
|
||||||
ModuleConcatenation bailout: Cannot concat with ./vendor.js: Module ./vendor.js is not in the same chunk(s) (expected in chunk(s) first, module is in chunk(s) vendor)
|
ModuleConcatenation bailout: Cannot concat with ./vendor.js: Module ./vendor.js is not in the same chunk(s) (expected in chunk(s) first, module is in chunk(s) vendor)
|
||||||
|
./second.js + 1 modules 227 bytes [built] [code generated]
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./vendor.js: Module ./vendor.js is not in the same chunk(s) (expected in chunk(s) second, module is in chunk(s) vendor)
|
||||||
|
./vendor.js 25 bytes [built] [code generated]
|
||||||
|
./lazy_first.js + 1 modules 116 bytes [built] [code generated]
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./common_lazy_shared.js: Module ./common_lazy_shared.js is referenced from different chunks by these modules: ./lazy_shared.js
|
||||||
|
./lazy_shared.js 56 bytes [built] [code generated]
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./common_lazy_shared.js: Module ./common_lazy_shared.js is referenced from different chunks by these modules: ./lazy_first.js, ./lazy_second.js
|
||||||
|
./lazy_second.js + 1 modules 116 bytes [built] [code generated]
|
||||||
|
ModuleConcatenation bailout: Cannot concat with ./common_lazy_shared.js: Module ./common_lazy_shared.js is referenced from different chunks by these modules: ./lazy_shared.js
|
||||||
|
./common_lazy_shared.js 25 bytes [built] [code generated]
|
||||||
orphan modules 118 bytes [orphan]
|
orphan modules 118 bytes [orphan]
|
||||||
./common2.js 25 bytes [orphan] [built]
|
./common2.js 25 bytes [orphan] [built]
|
||||||
./module_first.js 31 bytes [orphan] [built]
|
./module_first.js 31 bytes [orphan] [built]
|
||||||
|
@ -3149,16 +3206,7 @@ cacheable modules 823 bytes
|
||||||
modules by path ./components/src/ 501 bytes
|
modules by path ./components/src/ 501 bytes
|
||||||
orphan modules 315 bytes [orphan]
|
orphan modules 315 bytes [orphan]
|
||||||
modules by path ./components/src/CompAB/*.js 164 bytes 2 modules
|
modules by path ./components/src/CompAB/*.js 164 bytes 2 modules
|
||||||
modules by path ./components/src/CompC/*.js 67 bytes
|
modules by path ./components/src/CompC/*.js 67 bytes 2 modules
|
||||||
./components/src/CompC/CompC.js 33 bytes [orphan] [built]
|
|
||||||
[module unused]
|
|
||||||
[inactive] harmony side effect evaluation ./CompC ./components/src/CompC/index.js 1:0-34
|
|
||||||
[inactive] harmony export imported specifier ./CompC ./components/src/CompC/index.js 1:0-34
|
|
||||||
[inactive] harmony export imported specifier ./CompC ./components/src/index.js 2:0-43 (skipped side-effect-free modules)
|
|
||||||
./components/src/CompC/index.js 34 bytes [orphan] [built]
|
|
||||||
[module unused]
|
|
||||||
[inactive] harmony side effect evaluation ./CompC ./components/src/index.js 2:0-43
|
|
||||||
[inactive] harmony export imported specifier ./CompC ./components/src/index.js 2:0-43
|
|
||||||
./components/src/index.js 84 bytes [orphan] [built]
|
./components/src/index.js 84 bytes [orphan] [built]
|
||||||
[module unused]
|
[module unused]
|
||||||
[inactive] from origin ./main.js + 1 modules
|
[inactive] from origin ./main.js + 1 modules
|
||||||
|
@ -3187,20 +3235,21 @@ cacheable modules 823 bytes
|
||||||
from origin ./main.js + 1 modules
|
from origin ./main.js + 1 modules
|
||||||
[inactive] harmony side effect evaluation ./utils ./main.js + 1 modules ./components/src/CompAB/CompB.js 1:0-30
|
[inactive] harmony side effect evaluation ./utils ./main.js + 1 modules ./components/src/CompAB/CompB.js 1:0-30
|
||||||
harmony import specifier ./utils ./main.js + 1 modules ./components/src/CompAB/CompB.js 5:2-5
|
harmony import specifier ./utils ./main.js + 1 modules ./components/src/CompAB/CompB.js 5:2-5
|
||||||
./main.js + 1 modules 221 bytes [built] [code generated]
|
modules by path ./*.js 322 bytes
|
||||||
[no exports used]
|
./main.js + 1 modules 221 bytes [built] [code generated]
|
||||||
entry ./main.js main
|
[no exports used]
|
||||||
| ./main.js 144 bytes [built]
|
entry ./main.js main
|
||||||
| [no exports used]
|
| ./main.js 144 bytes [built]
|
||||||
| ./components/src/CompAB/CompB.js 77 bytes [built]
|
| [no exports used]
|
||||||
| [only some exports used: default]
|
| ./components/src/CompAB/CompB.js 77 bytes [built]
|
||||||
| [inactive] from origin ./components/src/CompAB/index.js
|
| [only some exports used: default]
|
||||||
| [inactive] harmony side effect evaluation ./CompB ./components/src/CompAB/index.js 2:0-43
|
| [inactive] from origin ./components/src/CompAB/index.js
|
||||||
| [inactive] harmony export imported specifier ./CompB ./components/src/CompAB/index.js 2:0-43
|
| [inactive] harmony side effect evaluation ./CompB ./components/src/CompAB/index.js 2:0-43
|
||||||
| [inactive] harmony export imported specifier ./CompAB ./components/src/index.js 1:0-40 (skipped side-effect-free modules)
|
| [inactive] harmony export imported specifier ./CompB ./components/src/CompAB/index.js 2:0-43
|
||||||
| harmony import specifier ./components ./main.js 4:15-20 (skipped side-effect-free modules)
|
| [inactive] harmony export imported specifier ./CompAB ./components/src/index.js 1:0-40 (skipped side-effect-free modules)
|
||||||
./foo.js 101 bytes [built] [code generated]
|
| harmony import specifier ./components ./main.js 4:15-20 (skipped side-effect-free modules)
|
||||||
import() ./foo ./main.js + 1 modules ./main.js 6:0-15
|
./foo.js 101 bytes [built] [code generated]
|
||||||
|
import() ./foo ./main.js + 1 modules ./main.js 6:0-15
|
||||||
webpack x.x.x compiled successfully in X ms"
|
webpack x.x.x compiled successfully in X ms"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -4110,8 +4159,16 @@ switched:
|
||||||
./index.js 1.19 KiB [built] [code generated]
|
./index.js 1.19 KiB [built] [code generated]
|
||||||
chunk (runtime: main) switched-main-879072e3.js (main-879072e3) 1.68 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={663}= ={869}= ={997}= [initial] [rendered]
|
chunk (runtime: main) switched-main-879072e3.js (main-879072e3) 1.68 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={663}= ={869}= ={997}= [initial] [rendered]
|
||||||
> ./ main
|
> ./ main
|
||||||
modules by path ./subfolder/*.js 1.1 KiB 11 modules
|
modules by path ./subfolder/*.js 1.1 KiB
|
||||||
modules by path ./*.js 594 bytes 9 modules
|
./subfolder/big.js?1 267 bytes [built] [code generated]
|
||||||
|
./subfolder/big.js?2 267 bytes [built] [code generated]
|
||||||
|
./subfolder/small.js?1 66 bytes [built] [code generated]
|
||||||
|
+ 8 modules
|
||||||
|
modules by path ./*.js 594 bytes
|
||||||
|
./small.js?1 66 bytes [built] [code generated]
|
||||||
|
./small.js?2 66 bytes [built] [code generated]
|
||||||
|
./small.js?3 66 bytes [built] [code generated]
|
||||||
|
+ 6 modules
|
||||||
chunk (runtime: main) switched-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={869}= ={997}= [entry] [rendered]
|
chunk (runtime: main) switched-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={869}= ={997}= [entry] [rendered]
|
||||||
> ./ main
|
> ./ main
|
||||||
runtime modules 3.01 KiB 5 modules
|
runtime modules 3.01 KiB 5 modules
|
||||||
|
@ -4123,13 +4180,13 @@ switched:
|
||||||
./node_modules/small.js?2 66 bytes [built] [code generated]
|
./node_modules/small.js?2 66 bytes [built] [code generated]
|
||||||
chunk (runtime: main) switched-main-7aeafcb2.js (main-7aeafcb2) 1.62 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={663}= ={869}= [initial] [rendered]
|
chunk (runtime: main) switched-main-7aeafcb2.js (main-7aeafcb2) 1.62 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={663}= ={869}= [initial] [rendered]
|
||||||
> ./ main
|
> ./ main
|
||||||
modules by path ./inner-module/*.js 594 bytes 9 modules
|
modules by path ./inner-module/*.js 594 bytes
|
||||||
|
./inner-module/small.js?1 66 bytes [built] [code generated]
|
||||||
|
+ 8 modules
|
||||||
modules by path ./in-some-directory/*.js 531 bytes
|
modules by path ./in-some-directory/*.js 531 bytes
|
||||||
./in-some-directory/big.js?1 267 bytes [built] [code generated]
|
./in-some-directory/big.js?1 267 bytes [built] [code generated]
|
||||||
./in-some-directory/small.js?1 66 bytes [built] [code generated]
|
./in-some-directory/small.js?1 66 bytes [built] [code generated]
|
||||||
./in-some-directory/small.js?2 66 bytes [built] [code generated]
|
+ 3 modules
|
||||||
./in-some-directory/small.js?3 66 bytes [built] [code generated]
|
|
||||||
./in-some-directory/small.js?4 66 bytes [built] [code generated]
|
|
||||||
modules by path ./*.js 534 bytes
|
modules by path ./*.js 534 bytes
|
||||||
./big.js?1 267 bytes [built] [code generated]
|
./big.js?1 267 bytes [built] [code generated]
|
||||||
./big.js?2 267 bytes [built] [code generated]
|
./big.js?2 267 bytes [built] [code generated]
|
||||||
|
|
Loading…
Reference in New Issue