webpack 5.99.6 → 5.99.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutomaticPrefetchPlugin.js +21 -22
- package/lib/BannerPlugin.js +31 -35
- package/lib/CleanPlugin.js +5 -3
- package/lib/Compilation.js +9 -8
- package/lib/Compiler.js +2 -1
- package/lib/ContextExclusionPlugin.js +4 -2
- package/lib/ContextReplacementPlugin.js +5 -3
- package/lib/DelegatedPlugin.js +4 -2
- package/lib/DllEntryPlugin.js +4 -2
- package/lib/DllPlugin.js +5 -3
- package/lib/DllReferencePlugin.js +56 -60
- package/lib/DynamicEntryPlugin.js +4 -2
- package/lib/EntryOptionPlugin.js +3 -1
- package/lib/EntryPlugin.js +4 -2
- package/lib/EnvironmentPlugin.js +4 -2
- package/lib/EvalDevToolModulePlugin.js +9 -7
- package/lib/EvalSourceMapDevToolPlugin.js +137 -138
- package/lib/ExternalsPlugin.js +3 -1
- package/lib/FlagDependencyExportsPlugin.js +2 -1
- package/lib/IgnorePlugin.js +6 -4
- package/lib/IgnoreWarningsPlugin.js +4 -2
- package/lib/LibManifestPlugin.js +3 -4
- package/lib/LoaderOptionsPlugin.js +4 -2
- package/lib/LoaderTargetPlugin.js +4 -2
- package/lib/Module.js +19 -12
- package/lib/ModuleInfoHeaderPlugin.js +11 -12
- package/lib/MultiCompiler.js +5 -3
- package/lib/NoEmitOnErrorsPlugin.js +5 -3
- package/lib/NormalModule.js +5 -1
- package/lib/NormalModuleReplacementPlugin.js +33 -36
- package/lib/PlatformPlugin.js +3 -1
- package/lib/PrefetchPlugin.js +4 -2
- package/lib/ProgressPlugin.js +23 -26
- package/lib/RecordIdsPlugin.js +72 -102
- package/lib/RuntimePlugin.js +34 -32
- package/lib/SourceMapDevToolPlugin.js +7 -5
- package/lib/WarnCaseSensitiveModulesPlugin.js +36 -37
- package/lib/WarnNoModeSetPlugin.js +3 -1
- package/lib/WatchIgnorePlugin.js +3 -1
- package/lib/WebpackError.js +11 -3
- package/lib/WebpackOptionsApply.js +5 -3
- package/lib/async-modules/InferAsyncModulesPlugin.js +25 -26
- package/lib/cache/IdleFileCachePlugin.js +11 -12
- package/lib/cache/MemoryWithGcCachePlugin.js +7 -5
- package/lib/cache/ResolverCachePlugin.js +8 -6
- package/lib/cli.js +5 -1
- package/lib/config/normalization.js +9 -3
- package/lib/container/ContainerReferencePlugin.js +24 -26
- package/lib/container/ModuleFederationPlugin.js +2 -1
- package/lib/css/CssGenerator.js +1 -1
- package/lib/css/CssModulesPlugin.js +6 -4
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +9 -15
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -15
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -2
- package/lib/dependencies/LoaderPlugin.js +5 -3
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +46 -46
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +94 -100
- package/lib/esm/ModuleChunkLoadingPlugin.js +72 -73
- package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/LazyCompilationPlugin.js +17 -18
- package/lib/ids/ChunkModuleIdRangePlugin.js +6 -6
- package/lib/ids/DeterministicModuleIdsPlugin.js +47 -48
- package/lib/ids/HashedModuleIdsPlugin.js +4 -2
- package/lib/ids/NamedChunkIdsPlugin.js +4 -2
- package/lib/ids/NamedModuleIdsPlugin.js +4 -2
- package/lib/ids/NaturalChunkIdsPlugin.js +4 -2
- package/lib/ids/NaturalModuleIdsPlugin.js +4 -2
- package/lib/ids/OccurrenceChunkIdsPlugin.js +4 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -2
- package/lib/javascript/JavascriptParser.js +634 -656
- package/lib/library/ModuleLibraryPlugin.js +60 -42
- package/lib/node/CommonJsChunkLoadingPlugin.js +69 -73
- package/lib/node/NodeEnvironmentPlugin.js +3 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +224 -232
- package/lib/optimize/ConcatenatedModule.js +12 -15
- package/lib/optimize/FlagIncludedChunksPlugin.js +92 -97
- package/lib/optimize/LimitChunkCountPlugin.js +4 -2
- package/lib/optimize/MangleExportsPlugin.js +15 -16
- package/lib/optimize/MinChunkSizePlugin.js +4 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +4 -2
- package/lib/optimize/RealContentHashPlugin.js +4 -2
- package/lib/optimize/RemoveEmptyChunksPlugin.js +5 -3
- package/lib/optimize/RemoveParentModulesPlugin.js +4 -2
- package/lib/optimize/RuntimeChunkPlugin.js +17 -18
- package/lib/optimize/SplitChunksPlugin.js +7 -5
- package/lib/performance/SizeLimitsPlugin.js +3 -1
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +61 -62
- package/lib/runtime/StartupChunkDependenciesPlugin.js +39 -42
- package/lib/schemes/DataUriPlugin.js +5 -3
- package/lib/schemes/FileUriPlugin.js +5 -3
- package/lib/schemes/HttpUriPlugin.js +32 -39
- package/lib/serialization/AggregateErrorSerializer.js +42 -0
- package/lib/serialization/ErrorObjectSerializer.js +7 -2
- package/lib/serialization/ObjectMiddleware.js +13 -0
- package/lib/sharing/ProvideSharedPlugin.js +6 -4
- package/lib/stats/DefaultStatsFactoryPlugin.js +89 -33
- package/lib/stats/DefaultStatsPresetPlugin.js +25 -20
- package/lib/stats/DefaultStatsPrinterPlugin.js +306 -341
- package/lib/util/concatenate.js +4 -2
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +55 -57
- package/lib/web/JsonpChunkLoadingPlugin.js +73 -74
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +77 -78
- package/package.json +4 -3
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +24 -2
- package/types.d.ts +148 -55
@@ -819,6 +819,16 @@ const ERROR_PRINTERS = {
|
|
819
819
|
"error.filteredDetails": filteredDetails =>
|
820
820
|
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
|
821
821
|
"error.stack": stack => stack,
|
822
|
+
"error.cause": (cause, context, printer) =>
|
823
|
+
cause
|
824
|
+
? indent(
|
825
|
+
`[cause]: ${
|
826
|
+
/** @type {string} */
|
827
|
+
(printer.print(`${context.type}.error`, cause, context))
|
828
|
+
}`,
|
829
|
+
" "
|
830
|
+
)
|
831
|
+
: undefined,
|
822
832
|
"error.moduleTrace": moduleTrace => undefined,
|
823
833
|
"error.separator!": () => "\n"
|
824
834
|
};
|
@@ -925,6 +935,7 @@ const ITEM_NAMES = {
|
|
925
935
|
"loggingEntry.children[]": logEntry =>
|
926
936
|
`loggingEntry(${logEntry.type}).loggingEntry`,
|
927
937
|
"error.moduleTrace[]": "moduleTraceItem",
|
938
|
+
"error.errors[]": "error",
|
928
939
|
"moduleTraceItem.dependencies[]": "moduleTraceDependency"
|
929
940
|
};
|
930
941
|
|
@@ -946,6 +957,8 @@ const ERROR_PREFERRED_ORDER = [
|
|
946
957
|
"separator!",
|
947
958
|
"stack",
|
948
959
|
"separator!",
|
960
|
+
"cause",
|
961
|
+
"separator!",
|
949
962
|
"missing",
|
950
963
|
"separator!",
|
951
964
|
"moduleTrace"
|
@@ -1388,28 +1401,6 @@ const SIMPLE_ELEMENT_JOINERS = {
|
|
1388
1401
|
chunkGroupAsset: joinOneLine,
|
1389
1402
|
chunkGroupChildGroup: joinOneLine,
|
1390
1403
|
chunkGroupChild: joinOneLine,
|
1391
|
-
// moduleReason: (items, { moduleReason }) => {
|
1392
|
-
// let hasName = false;
|
1393
|
-
// return joinOneLine(
|
1394
|
-
// items.filter(item => {
|
1395
|
-
// switch (item.element) {
|
1396
|
-
// case "moduleId":
|
1397
|
-
// if (moduleReason.moduleId === moduleReason.module && item.content)
|
1398
|
-
// hasName = true;
|
1399
|
-
// break;
|
1400
|
-
// case "module":
|
1401
|
-
// if (hasName) return false;
|
1402
|
-
// break;
|
1403
|
-
// case "resolvedModule":
|
1404
|
-
// return (
|
1405
|
-
// moduleReason.module !== moduleReason.resolvedModule &&
|
1406
|
-
// item.content
|
1407
|
-
// );
|
1408
|
-
// }
|
1409
|
-
// return true;
|
1410
|
-
// })
|
1411
|
-
// );
|
1412
|
-
// },
|
1413
1404
|
moduleReason: (items, { moduleReason }) => {
|
1414
1405
|
let hasName = false;
|
1415
1406
|
return joinExplicitNewLine(
|
@@ -1445,6 +1436,9 @@ const SIMPLE_ELEMENT_JOINERS = {
|
|
1445
1436
|
chunkOrigin: items => `> ${joinOneLine(items)}`,
|
1446
1437
|
"errors[].error": joinError(true),
|
1447
1438
|
"warnings[].error": joinError(false),
|
1439
|
+
error: items => joinExplicitNewLine(items, ""),
|
1440
|
+
"error.errors[].error": items =>
|
1441
|
+
indent(`[errors]: ${joinExplicitNewLine(items, "")}`, " "),
|
1448
1442
|
loggingGroup: items => joinExplicitNewLine(items, "").trimEnd(),
|
1449
1443
|
moduleTraceItem: items => ` @ ${joinOneLine(items)}`,
|
1450
1444
|
moduleTraceDependency: joinOneLine
|
@@ -1585,6 +1579,8 @@ const createOrder = (array, preferredOrder) => {
|
|
1585
1579
|
return array;
|
1586
1580
|
};
|
1587
1581
|
|
1582
|
+
const PLUGIN_NAME = "DefaultStatsPrinterPlugin";
|
1583
|
+
|
1588
1584
|
class DefaultStatsPrinterPlugin {
|
1589
1585
|
/**
|
1590
1586
|
* Apply the plugin
|
@@ -1592,332 +1588,301 @@ class DefaultStatsPrinterPlugin {
|
|
1592
1588
|
* @returns {void}
|
1593
1589
|
*/
|
1594
1590
|
apply(compiler) {
|
1595
|
-
compiler.hooks.compilation.tap(
|
1596
|
-
compilation.hooks.statsPrinter.tap(
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
) {
|
1614
|
-
start = options.colors[name];
|
1615
|
-
} else {
|
1616
|
-
start = AVAILABLE_COLORS[name];
|
1617
|
-
}
|
1618
|
-
}
|
1619
|
-
if (start) {
|
1620
|
-
/** @type {ColorFunction} */
|
1621
|
-
context[color] = str =>
|
1622
|
-
`${start}${
|
1623
|
-
typeof str === "string"
|
1624
|
-
? str.replace(
|
1625
|
-
/((\u001B\[39m|\u001B\[22m|\u001B\[0m)+)/g,
|
1626
|
-
`$1${start}`
|
1627
|
-
)
|
1628
|
-
: str
|
1629
|
-
}\u001B[39m\u001B[22m`;
|
1591
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
1592
|
+
compilation.hooks.statsPrinter.tap(PLUGIN_NAME, (stats, options) => {
|
1593
|
+
// Put colors into context
|
1594
|
+
stats.hooks.print
|
1595
|
+
.for("compilation")
|
1596
|
+
.tap(PLUGIN_NAME, (compilation, context) => {
|
1597
|
+
for (const color of Object.keys(AVAILABLE_COLORS)) {
|
1598
|
+
const name =
|
1599
|
+
/** @type {keyof KnownStatsPrinterColorFunctions} */
|
1600
|
+
(color);
|
1601
|
+
/** @type {string | undefined} */
|
1602
|
+
let start;
|
1603
|
+
if (options.colors) {
|
1604
|
+
if (
|
1605
|
+
typeof options.colors === "object" &&
|
1606
|
+
typeof options.colors[name] === "string"
|
1607
|
+
) {
|
1608
|
+
start = options.colors[name];
|
1630
1609
|
} else {
|
1631
|
-
|
1632
|
-
* @param {string} str string
|
1633
|
-
* @returns {string} str string
|
1634
|
-
*/
|
1635
|
-
context[color] = str => str;
|
1610
|
+
start = AVAILABLE_COLORS[name];
|
1636
1611
|
}
|
1637
1612
|
}
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
(context),
|
1656
|
-
...args
|
1657
|
-
);
|
1613
|
+
if (start) {
|
1614
|
+
/** @type {ColorFunction} */
|
1615
|
+
context[color] = str =>
|
1616
|
+
`${start}${
|
1617
|
+
typeof str === "string"
|
1618
|
+
? str.replace(
|
1619
|
+
/((\u001B\[39m|\u001B\[22m|\u001B\[0m)+)/g,
|
1620
|
+
`$1${start}`
|
1621
|
+
)
|
1622
|
+
: str
|
1623
|
+
}\u001B[39m\u001B[22m`;
|
1624
|
+
} else {
|
1625
|
+
/**
|
1626
|
+
* @param {string} str string
|
1627
|
+
* @returns {string} str string
|
1628
|
+
*/
|
1629
|
+
context[color] = str => str;
|
1658
1630
|
}
|
1659
|
-
|
1631
|
+
}
|
1632
|
+
for (const format of Object.keys(AVAILABLE_FORMATS)) {
|
1633
|
+
context[format] =
|
1634
|
+
/**
|
1635
|
+
* @param {string | number} content content
|
1636
|
+
* @param {...TODO} args args
|
1637
|
+
* @returns {string} result
|
1638
|
+
*/
|
1639
|
+
(content, ...args) =>
|
1640
|
+
/** @type {TODO} */
|
1641
|
+
(
|
1642
|
+
AVAILABLE_FORMATS[
|
1643
|
+
/** @type {keyof AvailableFormats} */
|
1644
|
+
(format)
|
1645
|
+
]
|
1646
|
+
)(
|
1647
|
+
content,
|
1648
|
+
/** @type {StatsPrinterContext & Required<KnownStatsPrinterColorFunctions>} */
|
1649
|
+
(context),
|
1650
|
+
...args
|
1651
|
+
);
|
1652
|
+
}
|
1653
|
+
context.timeReference = compilation.time;
|
1654
|
+
});
|
1655
|
+
|
1656
|
+
for (const key of Object.keys(COMPILATION_SIMPLE_PRINTERS)) {
|
1657
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1658
|
+
/** @type {TODO} */
|
1659
|
+
(
|
1660
|
+
COMPILATION_SIMPLE_PRINTERS[
|
1661
|
+
/** @type {keyof CompilationSimplePrinters} */
|
1662
|
+
(key)
|
1663
|
+
]
|
1664
|
+
)(
|
1665
|
+
obj,
|
1666
|
+
/** @type {DefineStatsPrinterContext<"compilation">} */
|
1667
|
+
(ctx),
|
1668
|
+
stats
|
1669
|
+
)
|
1670
|
+
);
|
1671
|
+
}
|
1672
|
+
|
1673
|
+
for (const key of Object.keys(ASSET_SIMPLE_PRINTERS)) {
|
1674
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1675
|
+
/** @type {NonNullable<AssetSimplePrinters[keyof AssetSimplePrinters]>} */
|
1676
|
+
(
|
1677
|
+
ASSET_SIMPLE_PRINTERS[
|
1678
|
+
/** @type {keyof AssetSimplePrinters} */
|
1679
|
+
(key)
|
1680
|
+
]
|
1681
|
+
)(
|
1682
|
+
obj,
|
1683
|
+
/** @type {DefineStatsPrinterContext<"asset" | "asset.info">} */
|
1684
|
+
(ctx),
|
1685
|
+
stats
|
1686
|
+
)
|
1687
|
+
);
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
for (const key of Object.keys(MODULE_SIMPLE_PRINTERS)) {
|
1691
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1692
|
+
/** @type {TODO} */
|
1693
|
+
(
|
1694
|
+
MODULE_SIMPLE_PRINTERS[
|
1695
|
+
/** @type {keyof ModuleSimplePrinters} */
|
1696
|
+
(key)
|
1697
|
+
]
|
1698
|
+
)(
|
1699
|
+
obj,
|
1700
|
+
/** @type {DefineStatsPrinterContext<"module">} */
|
1701
|
+
(ctx),
|
1702
|
+
stats
|
1703
|
+
)
|
1704
|
+
);
|
1705
|
+
}
|
1706
|
+
|
1707
|
+
for (const key of Object.keys(MODULE_ISSUER_PRINTERS)) {
|
1708
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1709
|
+
/** @type {NonNullable<ModuleIssuerPrinters[keyof ModuleIssuerPrinters]>} */
|
1710
|
+
(
|
1711
|
+
MODULE_ISSUER_PRINTERS[
|
1712
|
+
/** @type {keyof ModuleIssuerPrinters} */
|
1713
|
+
(key)
|
1714
|
+
]
|
1715
|
+
)(
|
1716
|
+
obj,
|
1717
|
+
/** @type {DefineStatsPrinterContext<"moduleIssuer">} */
|
1718
|
+
(ctx),
|
1719
|
+
stats
|
1720
|
+
)
|
1721
|
+
);
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
for (const key of Object.keys(MODULE_REASON_PRINTERS)) {
|
1725
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1726
|
+
/** @type {TODO} */
|
1727
|
+
(
|
1728
|
+
MODULE_REASON_PRINTERS[
|
1729
|
+
/** @type {keyof ModuleReasonsPrinters} */
|
1730
|
+
(key)
|
1731
|
+
]
|
1732
|
+
)(
|
1733
|
+
obj,
|
1734
|
+
/** @type {DefineStatsPrinterContext<"moduleReason">} */
|
1735
|
+
(ctx),
|
1736
|
+
stats
|
1737
|
+
)
|
1738
|
+
);
|
1739
|
+
}
|
1740
|
+
|
1741
|
+
for (const key of Object.keys(MODULE_PROFILE_PRINTERS)) {
|
1742
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1743
|
+
/** @type {NonNullable<ModuleProfilePrinters[keyof ModuleProfilePrinters]>} */
|
1744
|
+
(
|
1745
|
+
MODULE_PROFILE_PRINTERS[
|
1746
|
+
/** @type {keyof ModuleProfilePrinters} */
|
1747
|
+
(key)
|
1748
|
+
]
|
1749
|
+
)(
|
1750
|
+
obj,
|
1751
|
+
/** @type {DefineStatsPrinterContext<"profile">} */
|
1752
|
+
(ctx),
|
1753
|
+
stats
|
1754
|
+
)
|
1755
|
+
);
|
1756
|
+
}
|
1757
|
+
|
1758
|
+
for (const key of Object.keys(CHUNK_GROUP_PRINTERS)) {
|
1759
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1760
|
+
/** @type {TODO} */
|
1761
|
+
(
|
1762
|
+
CHUNK_GROUP_PRINTERS[
|
1763
|
+
/** @type {keyof ChunkGroupPrinters} */
|
1764
|
+
(key)
|
1765
|
+
]
|
1766
|
+
)(
|
1767
|
+
obj,
|
1768
|
+
/** @type {DefineStatsPrinterContext<"chunkGroupKind" | "chunkGroup">} */
|
1769
|
+
(ctx),
|
1770
|
+
stats
|
1771
|
+
)
|
1772
|
+
);
|
1773
|
+
}
|
1774
|
+
|
1775
|
+
for (const key of Object.keys(CHUNK_PRINTERS)) {
|
1776
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1777
|
+
/** @type {TODO} */
|
1778
|
+
(CHUNK_PRINTERS[/** @type {keyof ChunkPrinters} */ (key)])(
|
1779
|
+
obj,
|
1780
|
+
/** @type {DefineStatsPrinterContext<"chunk">} */
|
1781
|
+
(ctx),
|
1782
|
+
stats
|
1783
|
+
)
|
1784
|
+
);
|
1785
|
+
}
|
1786
|
+
|
1787
|
+
for (const key of Object.keys(ERROR_PRINTERS)) {
|
1788
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1789
|
+
/** @type {TODO} */
|
1790
|
+
(ERROR_PRINTERS[/** @type {keyof ErrorPrinters} */ (key)])(
|
1791
|
+
obj,
|
1792
|
+
/** @type {DefineStatsPrinterContext<"error">} */
|
1793
|
+
(ctx),
|
1794
|
+
stats
|
1795
|
+
)
|
1796
|
+
);
|
1797
|
+
}
|
1798
|
+
|
1799
|
+
for (const key of Object.keys(LOG_ENTRY_PRINTERS)) {
|
1800
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1801
|
+
/** @type {TODO} */
|
1802
|
+
(
|
1803
|
+
LOG_ENTRY_PRINTERS[
|
1804
|
+
/** @type {keyof LogEntryPrinters} */
|
1805
|
+
(key)
|
1806
|
+
]
|
1807
|
+
)(
|
1808
|
+
obj,
|
1809
|
+
/** @type {DefineStatsPrinterContext<"logging">} */
|
1810
|
+
(ctx),
|
1811
|
+
stats
|
1812
|
+
)
|
1813
|
+
);
|
1814
|
+
}
|
1815
|
+
|
1816
|
+
for (const key of Object.keys(MODULE_TRACE_DEPENDENCY_PRINTERS)) {
|
1817
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1818
|
+
/** @type {NonNullable<ModuleTraceDependencyPrinters[keyof ModuleTraceDependencyPrinters]>} */
|
1819
|
+
(
|
1820
|
+
MODULE_TRACE_DEPENDENCY_PRINTERS[
|
1821
|
+
/** @type {keyof ModuleTraceDependencyPrinters} */
|
1822
|
+
(key)
|
1823
|
+
]
|
1824
|
+
)(
|
1825
|
+
obj,
|
1826
|
+
/** @type {DefineStatsPrinterContext<"moduleTraceDependency">} */
|
1827
|
+
(ctx),
|
1828
|
+
stats
|
1829
|
+
)
|
1830
|
+
);
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
for (const key of Object.keys(MODULE_TRACE_ITEM_PRINTERS)) {
|
1834
|
+
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
1835
|
+
/** @type {NonNullable<ModuleTraceItemPrinters[keyof ModuleTraceItemPrinters]>} */
|
1836
|
+
(
|
1837
|
+
MODULE_TRACE_ITEM_PRINTERS[
|
1838
|
+
/** @type {keyof ModuleTraceItemPrinters} */
|
1839
|
+
(key)
|
1840
|
+
]
|
1841
|
+
)(
|
1842
|
+
obj,
|
1843
|
+
/** @type {DefineStatsPrinterContext<"moduleTraceItem">} */
|
1844
|
+
(ctx),
|
1845
|
+
stats
|
1846
|
+
)
|
1847
|
+
);
|
1848
|
+
}
|
1849
|
+
|
1850
|
+
for (const key of Object.keys(PREFERRED_ORDERS)) {
|
1851
|
+
const preferredOrder = PREFERRED_ORDERS[key];
|
1852
|
+
stats.hooks.sortElements
|
1853
|
+
.for(key)
|
1854
|
+
.tap(PLUGIN_NAME, (elements, context) => {
|
1855
|
+
createOrder(elements, preferredOrder);
|
1660
1856
|
});
|
1857
|
+
}
|
1661
1858
|
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
(key)
|
1671
|
-
]
|
1672
|
-
)(
|
1673
|
-
obj,
|
1674
|
-
/** @type {DefineStatsPrinterContext<"compilation">} */
|
1675
|
-
(ctx),
|
1676
|
-
stats
|
1677
|
-
)
|
1678
|
-
);
|
1679
|
-
}
|
1680
|
-
|
1681
|
-
for (const key of Object.keys(ASSET_SIMPLE_PRINTERS)) {
|
1682
|
-
stats.hooks.print
|
1683
|
-
.for(key)
|
1684
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1685
|
-
/** @type {NonNullable<AssetSimplePrinters[keyof AssetSimplePrinters]>} */
|
1686
|
-
(
|
1687
|
-
ASSET_SIMPLE_PRINTERS[
|
1688
|
-
/** @type {keyof AssetSimplePrinters} */
|
1689
|
-
(key)
|
1690
|
-
]
|
1691
|
-
)(
|
1692
|
-
obj,
|
1693
|
-
/** @type {DefineStatsPrinterContext<"asset" | "asset.info">} */
|
1694
|
-
(ctx),
|
1695
|
-
stats
|
1696
|
-
)
|
1697
|
-
);
|
1698
|
-
}
|
1699
|
-
|
1700
|
-
for (const key of Object.keys(MODULE_SIMPLE_PRINTERS)) {
|
1701
|
-
stats.hooks.print
|
1702
|
-
.for(key)
|
1703
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1704
|
-
/** @type {TODO} */
|
1705
|
-
(
|
1706
|
-
MODULE_SIMPLE_PRINTERS[
|
1707
|
-
/** @type {keyof ModuleSimplePrinters} */
|
1708
|
-
(key)
|
1709
|
-
]
|
1710
|
-
)(
|
1711
|
-
obj,
|
1712
|
-
/** @type {DefineStatsPrinterContext<"module">} */
|
1713
|
-
(ctx),
|
1714
|
-
stats
|
1715
|
-
)
|
1716
|
-
);
|
1717
|
-
}
|
1718
|
-
|
1719
|
-
for (const key of Object.keys(MODULE_ISSUER_PRINTERS)) {
|
1720
|
-
stats.hooks.print
|
1721
|
-
.for(key)
|
1722
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1723
|
-
/** @type {NonNullable<ModuleIssuerPrinters[keyof ModuleIssuerPrinters]>} */
|
1724
|
-
(
|
1725
|
-
MODULE_ISSUER_PRINTERS[
|
1726
|
-
/** @type {keyof ModuleIssuerPrinters} */
|
1727
|
-
(key)
|
1728
|
-
]
|
1729
|
-
)(
|
1730
|
-
obj,
|
1731
|
-
/** @type {DefineStatsPrinterContext<"moduleIssuer">} */
|
1732
|
-
(ctx),
|
1733
|
-
stats
|
1734
|
-
)
|
1735
|
-
);
|
1736
|
-
}
|
1737
|
-
|
1738
|
-
for (const key of Object.keys(MODULE_REASON_PRINTERS)) {
|
1739
|
-
stats.hooks.print
|
1740
|
-
.for(key)
|
1741
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1742
|
-
/** @type {TODO} */
|
1743
|
-
(
|
1744
|
-
MODULE_REASON_PRINTERS[
|
1745
|
-
/** @type {keyof ModuleReasonsPrinters} */
|
1746
|
-
(key)
|
1747
|
-
]
|
1748
|
-
)(
|
1749
|
-
obj,
|
1750
|
-
/** @type {DefineStatsPrinterContext<"moduleReason">} */
|
1751
|
-
(ctx),
|
1752
|
-
stats
|
1753
|
-
)
|
1754
|
-
);
|
1755
|
-
}
|
1756
|
-
|
1757
|
-
for (const key of Object.keys(MODULE_PROFILE_PRINTERS)) {
|
1758
|
-
stats.hooks.print
|
1759
|
-
.for(key)
|
1760
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1761
|
-
/** @type {NonNullable<ModuleProfilePrinters[keyof ModuleProfilePrinters]>} */
|
1762
|
-
(
|
1763
|
-
MODULE_PROFILE_PRINTERS[
|
1764
|
-
/** @type {keyof ModuleProfilePrinters} */
|
1765
|
-
(key)
|
1766
|
-
]
|
1767
|
-
)(
|
1768
|
-
obj,
|
1769
|
-
/** @type {DefineStatsPrinterContext<"profile">} */
|
1770
|
-
(ctx),
|
1771
|
-
stats
|
1772
|
-
)
|
1773
|
-
);
|
1774
|
-
}
|
1775
|
-
|
1776
|
-
for (const key of Object.keys(CHUNK_GROUP_PRINTERS)) {
|
1777
|
-
stats.hooks.print
|
1778
|
-
.for(key)
|
1779
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1780
|
-
/** @type {TODO} */
|
1781
|
-
(
|
1782
|
-
CHUNK_GROUP_PRINTERS[
|
1783
|
-
/** @type {keyof ChunkGroupPrinters} */
|
1784
|
-
(key)
|
1785
|
-
]
|
1786
|
-
)(
|
1787
|
-
obj,
|
1788
|
-
/** @type {DefineStatsPrinterContext<"chunkGroupKind" | "chunkGroup">} */
|
1789
|
-
(ctx),
|
1790
|
-
stats
|
1791
|
-
)
|
1792
|
-
);
|
1793
|
-
}
|
1794
|
-
|
1795
|
-
for (const key of Object.keys(CHUNK_PRINTERS)) {
|
1796
|
-
stats.hooks.print
|
1797
|
-
.for(key)
|
1798
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1799
|
-
/** @type {TODO} */
|
1800
|
-
(CHUNK_PRINTERS[/** @type {keyof ChunkPrinters} */ (key)])(
|
1801
|
-
obj,
|
1802
|
-
/** @type {DefineStatsPrinterContext<"chunk">} */
|
1803
|
-
(ctx),
|
1804
|
-
stats
|
1805
|
-
)
|
1806
|
-
);
|
1807
|
-
}
|
1808
|
-
|
1809
|
-
for (const key of Object.keys(ERROR_PRINTERS)) {
|
1810
|
-
stats.hooks.print
|
1811
|
-
.for(key)
|
1812
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1813
|
-
/** @type {TODO} */
|
1814
|
-
(ERROR_PRINTERS[/** @type {keyof ErrorPrinters} */ (key)])(
|
1815
|
-
obj,
|
1816
|
-
/** @type {DefineStatsPrinterContext<"error">} */
|
1817
|
-
(ctx),
|
1818
|
-
stats
|
1819
|
-
)
|
1820
|
-
);
|
1821
|
-
}
|
1822
|
-
|
1823
|
-
for (const key of Object.keys(LOG_ENTRY_PRINTERS)) {
|
1824
|
-
stats.hooks.print
|
1825
|
-
.for(key)
|
1826
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1827
|
-
/** @type {TODO} */
|
1828
|
-
(
|
1829
|
-
LOG_ENTRY_PRINTERS[
|
1830
|
-
/** @type {keyof LogEntryPrinters} */
|
1831
|
-
(key)
|
1832
|
-
]
|
1833
|
-
)(
|
1834
|
-
obj,
|
1835
|
-
/** @type {DefineStatsPrinterContext<"logging">} */
|
1836
|
-
(ctx),
|
1837
|
-
stats
|
1838
|
-
)
|
1839
|
-
);
|
1840
|
-
}
|
1841
|
-
|
1842
|
-
for (const key of Object.keys(MODULE_TRACE_DEPENDENCY_PRINTERS)) {
|
1843
|
-
stats.hooks.print
|
1844
|
-
.for(key)
|
1845
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1846
|
-
/** @type {NonNullable<ModuleTraceDependencyPrinters[keyof ModuleTraceDependencyPrinters]>} */
|
1847
|
-
(
|
1848
|
-
MODULE_TRACE_DEPENDENCY_PRINTERS[
|
1849
|
-
/** @type {keyof ModuleTraceDependencyPrinters} */
|
1850
|
-
(key)
|
1851
|
-
]
|
1852
|
-
)(
|
1853
|
-
obj,
|
1854
|
-
/** @type {DefineStatsPrinterContext<"moduleTraceDependency">} */
|
1855
|
-
(ctx),
|
1856
|
-
stats
|
1857
|
-
)
|
1858
|
-
);
|
1859
|
-
}
|
1860
|
-
|
1861
|
-
for (const key of Object.keys(MODULE_TRACE_ITEM_PRINTERS)) {
|
1862
|
-
stats.hooks.print
|
1863
|
-
.for(key)
|
1864
|
-
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1865
|
-
/** @type {NonNullable<ModuleTraceItemPrinters[keyof ModuleTraceItemPrinters]>} */
|
1866
|
-
(
|
1867
|
-
MODULE_TRACE_ITEM_PRINTERS[
|
1868
|
-
/** @type {keyof ModuleTraceItemPrinters} */
|
1869
|
-
(key)
|
1870
|
-
]
|
1871
|
-
)(
|
1872
|
-
obj,
|
1873
|
-
/** @type {DefineStatsPrinterContext<"moduleTraceItem">} */
|
1874
|
-
(ctx),
|
1875
|
-
stats
|
1876
|
-
)
|
1877
|
-
);
|
1878
|
-
}
|
1879
|
-
|
1880
|
-
for (const key of Object.keys(PREFERRED_ORDERS)) {
|
1881
|
-
const preferredOrder = PREFERRED_ORDERS[key];
|
1882
|
-
stats.hooks.sortElements
|
1883
|
-
.for(key)
|
1884
|
-
.tap("DefaultStatsPrinterPlugin", (elements, context) => {
|
1885
|
-
createOrder(elements, preferredOrder);
|
1886
|
-
});
|
1887
|
-
}
|
1888
|
-
|
1889
|
-
for (const key of Object.keys(ITEM_NAMES)) {
|
1890
|
-
const itemName = ITEM_NAMES[key];
|
1891
|
-
stats.hooks.getItemName
|
1892
|
-
.for(key)
|
1893
|
-
.tap(
|
1894
|
-
"DefaultStatsPrinterPlugin",
|
1895
|
-
typeof itemName === "string" ? () => itemName : itemName
|
1896
|
-
);
|
1897
|
-
}
|
1898
|
-
|
1899
|
-
for (const key of Object.keys(SIMPLE_ITEMS_JOINER)) {
|
1900
|
-
const joiner = SIMPLE_ITEMS_JOINER[key];
|
1901
|
-
stats.hooks.printItems
|
1902
|
-
.for(key)
|
1903
|
-
.tap("DefaultStatsPrinterPlugin", joiner);
|
1904
|
-
}
|
1905
|
-
|
1906
|
-
for (const key of Object.keys(SIMPLE_ELEMENT_JOINERS)) {
|
1907
|
-
const joiner = SIMPLE_ELEMENT_JOINERS[key];
|
1908
|
-
stats.hooks.printElements
|
1909
|
-
.for(key)
|
1910
|
-
.tap("DefaultStatsPrinterPlugin", /** @type {TODO} */ (joiner));
|
1911
|
-
}
|
1912
|
-
|
1913
|
-
for (const key of Object.keys(RESULT_MODIFIER)) {
|
1914
|
-
const modifier = RESULT_MODIFIER[key];
|
1915
|
-
stats.hooks.result
|
1916
|
-
.for(key)
|
1917
|
-
.tap("DefaultStatsPrinterPlugin", modifier);
|
1918
|
-
}
|
1859
|
+
for (const key of Object.keys(ITEM_NAMES)) {
|
1860
|
+
const itemName = ITEM_NAMES[key];
|
1861
|
+
stats.hooks.getItemName
|
1862
|
+
.for(key)
|
1863
|
+
.tap(
|
1864
|
+
PLUGIN_NAME,
|
1865
|
+
typeof itemName === "string" ? () => itemName : itemName
|
1866
|
+
);
|
1919
1867
|
}
|
1920
|
-
|
1868
|
+
|
1869
|
+
for (const key of Object.keys(SIMPLE_ITEMS_JOINER)) {
|
1870
|
+
const joiner = SIMPLE_ITEMS_JOINER[key];
|
1871
|
+
stats.hooks.printItems.for(key).tap(PLUGIN_NAME, joiner);
|
1872
|
+
}
|
1873
|
+
|
1874
|
+
for (const key of Object.keys(SIMPLE_ELEMENT_JOINERS)) {
|
1875
|
+
const joiner = SIMPLE_ELEMENT_JOINERS[key];
|
1876
|
+
stats.hooks.printElements
|
1877
|
+
.for(key)
|
1878
|
+
.tap(PLUGIN_NAME, /** @type {TODO} */ (joiner));
|
1879
|
+
}
|
1880
|
+
|
1881
|
+
for (const key of Object.keys(RESULT_MODIFIER)) {
|
1882
|
+
const modifier = RESULT_MODIFIER[key];
|
1883
|
+
stats.hooks.result.for(key).tap(PLUGIN_NAME, modifier);
|
1884
|
+
}
|
1885
|
+
});
|
1921
1886
|
});
|
1922
1887
|
}
|
1923
1888
|
}
|