webpack 5.100.1 → 5.101.0

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.
Files changed (304) hide show
  1. package/README.md +12 -10
  2. package/bin/webpack.js +7 -7
  3. package/lib/APIPlugin.js +12 -14
  4. package/lib/AutomaticPrefetchPlugin.js +2 -2
  5. package/lib/BannerPlugin.js +4 -4
  6. package/lib/Cache.js +1 -1
  7. package/lib/CacheFacade.js +7 -7
  8. package/lib/CaseSensitiveModulesWarning.js +2 -2
  9. package/lib/Chunk.js +3 -3
  10. package/lib/ChunkGraph.js +21 -18
  11. package/lib/ChunkGroup.js +4 -4
  12. package/lib/CleanPlugin.js +19 -53
  13. package/lib/CodeGenerationResults.js +3 -3
  14. package/lib/CompatibilityPlugin.js +6 -6
  15. package/lib/Compilation.js +127 -114
  16. package/lib/Compiler.js +37 -37
  17. package/lib/ConcatenationScope.js +39 -1
  18. package/lib/ConstPlugin.js +11 -11
  19. package/lib/ContextExclusionPlugin.js +3 -3
  20. package/lib/ContextModule.js +12 -11
  21. package/lib/ContextModuleFactory.js +11 -11
  22. package/lib/ContextReplacementPlugin.js +5 -5
  23. package/lib/DefinePlugin.js +24 -22
  24. package/lib/DelegatedModuleFactoryPlugin.js +1 -1
  25. package/lib/DllEntryPlugin.js +1 -1
  26. package/lib/DllReferencePlugin.js +1 -1
  27. package/lib/DynamicEntryPlugin.js +3 -3
  28. package/lib/EntryPlugin.js +1 -1
  29. package/lib/EnvironmentPlugin.js +1 -1
  30. package/lib/ErrorHelpers.js +2 -2
  31. package/lib/EvalDevToolModulePlugin.js +2 -2
  32. package/lib/EvalSourceMapDevToolPlugin.js +5 -5
  33. package/lib/ExportsInfo.js +9 -9
  34. package/lib/ExportsInfoApiPlugin.js +2 -2
  35. package/lib/ExternalModule.js +163 -48
  36. package/lib/ExternalModuleFactoryPlugin.js +2 -2
  37. package/lib/ExternalsPlugin.js +45 -0
  38. package/lib/FileSystemInfo.js +64 -61
  39. package/lib/FlagAllModulesAsUsedPlugin.js +2 -2
  40. package/lib/FlagDependencyExportsPlugin.js +7 -7
  41. package/lib/FlagDependencyUsagePlugin.js +4 -4
  42. package/lib/FlagEntryExportAsUsedPlugin.js +1 -1
  43. package/lib/HotModuleReplacementPlugin.js +27 -27
  44. package/lib/IgnorePlugin.js +3 -3
  45. package/lib/IgnoreWarningsPlugin.js +4 -4
  46. package/lib/InitFragment.js +6 -0
  47. package/lib/InvalidDependenciesModuleWarning.js +1 -1
  48. package/lib/JavascriptMetaInfoPlugin.js +1 -1
  49. package/lib/LibManifestPlugin.js +2 -2
  50. package/lib/LoaderOptionsPlugin.js +1 -1
  51. package/lib/LoaderTargetPlugin.js +2 -2
  52. package/lib/MainTemplate.js +1 -1
  53. package/lib/Module.js +1 -1
  54. package/lib/ModuleFilenameHelpers.js +3 -3
  55. package/lib/ModuleGraph.js +86 -5
  56. package/lib/ModuleInfoHeaderPlugin.js +3 -3
  57. package/lib/ModuleParseError.js +5 -3
  58. package/lib/MultiCompiler.js +29 -24
  59. package/lib/MultiStats.js +18 -13
  60. package/lib/MultiWatching.js +1 -1
  61. package/lib/NoEmitOnErrorsPlugin.js +2 -2
  62. package/lib/NodeStuffPlugin.js +27 -15
  63. package/lib/NormalModule.js +28 -24
  64. package/lib/NormalModuleFactory.js +23 -21
  65. package/lib/NormalModuleReplacementPlugin.js +3 -3
  66. package/lib/PrefetchPlugin.js +1 -1
  67. package/lib/ProgressPlugin.js +11 -11
  68. package/lib/ProvidePlugin.js +2 -2
  69. package/lib/RecordIdsPlugin.js +3 -3
  70. package/lib/ResolverFactory.js +3 -3
  71. package/lib/RuntimeGlobals.js +20 -0
  72. package/lib/RuntimePlugin.js +16 -16
  73. package/lib/RuntimeTemplate.js +42 -44
  74. package/lib/SizeFormatHelpers.js +1 -1
  75. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -4
  76. package/lib/SourceMapDevToolPlugin.js +9 -9
  77. package/lib/Stats.js +2 -2
  78. package/lib/Template.js +1 -1
  79. package/lib/TemplatedPathPlugin.js +2 -2
  80. package/lib/UseStrictPlugin.js +1 -1
  81. package/lib/WarnCaseSensitiveModulesPlugin.js +1 -1
  82. package/lib/WarnDeprecatedOptionPlugin.js +1 -1
  83. package/lib/WarnNoModeSetPlugin.js +1 -1
  84. package/lib/WatchIgnorePlugin.js +2 -2
  85. package/lib/Watching.js +12 -12
  86. package/lib/WebpackIsIncludedPlugin.js +2 -2
  87. package/lib/WebpackOptionsApply.js +10 -3
  88. package/lib/asset/AssetGenerator.js +3 -3
  89. package/lib/asset/AssetModulesPlugin.js +6 -6
  90. package/lib/async-modules/AsyncModuleHelpers.js +50 -0
  91. package/lib/async-modules/AwaitDependenciesInitFragment.js +36 -24
  92. package/lib/async-modules/InferAsyncModulesPlugin.js +3 -3
  93. package/lib/buildChunkGraph.js +5 -5
  94. package/lib/cache/AddBuildDependenciesPlugin.js +1 -1
  95. package/lib/cache/IdleFileCachePlugin.js +5 -5
  96. package/lib/cache/PackFileCacheStrategy.js +20 -20
  97. package/lib/cache/ResolverCachePlugin.js +4 -4
  98. package/lib/cli.js +196 -14
  99. package/lib/config/browserslistTargetHandler.js +6 -6
  100. package/lib/config/defaults.js +23 -14
  101. package/lib/config/normalization.js +41 -38
  102. package/lib/config/target.js +4 -4
  103. package/lib/container/ContainerEntryModule.js +3 -3
  104. package/lib/container/ContainerPlugin.js +3 -3
  105. package/lib/container/ContainerReferencePlugin.js +3 -3
  106. package/lib/container/FallbackModule.js +1 -1
  107. package/lib/container/HoistContainerReferencesPlugin.js +7 -7
  108. package/lib/container/options.js +4 -4
  109. package/lib/css/CssGenerator.js +5 -3
  110. package/lib/css/CssLoadingRuntimeModule.js +1 -1
  111. package/lib/css/CssModulesPlugin.js +25 -22
  112. package/lib/css/CssParser.js +5 -5
  113. package/lib/css/walkCssTokens.js +9 -9
  114. package/lib/debug/ProfilingPlugin.js +5 -5
  115. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +4 -4
  116. package/lib/dependencies/AMDPlugin.js +3 -3
  117. package/lib/dependencies/AMDRequireArrayDependency.js +1 -1
  118. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +3 -3
  119. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -2
  120. package/lib/dependencies/CommonJsExportsParserPlugin.js +12 -10
  121. package/lib/dependencies/CommonJsImportsParserPlugin.js +21 -19
  122. package/lib/dependencies/CommonJsPlugin.js +2 -2
  123. package/lib/dependencies/ContextDependency.js +1 -1
  124. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  125. package/lib/dependencies/CssIcssExportDependency.js +2 -2
  126. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  127. package/lib/dependencies/CssUrlDependency.js +4 -4
  128. package/lib/dependencies/DynamicExports.js +5 -5
  129. package/lib/dependencies/HarmonyAcceptDependency.js +39 -5
  130. package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
  131. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +17 -23
  132. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +7 -8
  133. package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
  134. package/lib/dependencies/HarmonyExports.js +1 -1
  135. package/lib/dependencies/HarmonyImportDependency.js +28 -9
  136. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +59 -75
  137. package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -5
  138. package/lib/dependencies/HarmonyImportSpecifierDependency.js +3 -4
  139. package/lib/dependencies/HarmonyModulesPlugin.js +2 -8
  140. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
  141. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -4
  142. package/lib/dependencies/ImportMetaPlugin.js +7 -7
  143. package/lib/dependencies/ImportParserPlugin.js +4 -4
  144. package/lib/dependencies/JsonExportsDependency.js +1 -1
  145. package/lib/dependencies/LoaderPlugin.js +4 -4
  146. package/lib/dependencies/ProvidedDependency.js +2 -2
  147. package/lib/dependencies/PureExpressionDependency.js +1 -1
  148. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  149. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -1
  150. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +3 -3
  151. package/lib/dependencies/SystemPlugin.js +3 -3
  152. package/lib/dependencies/WorkerPlugin.js +5 -5
  153. package/lib/dependencies/getFunctionExpression.js +1 -1
  154. package/lib/esm/ModuleChunkFormatPlugin.js +5 -5
  155. package/lib/esm/ModuleChunkLoadingPlugin.js +2 -2
  156. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +15 -11
  157. package/lib/formatLocation.js +2 -2
  158. package/lib/hmr/HotModuleReplacement.runtime.js +39 -27
  159. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +43 -32
  160. package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -1
  161. package/lib/hmr/LazyCompilationPlugin.js +6 -6
  162. package/lib/hmr/lazyCompilationBackend.js +6 -6
  163. package/lib/ids/ChunkModuleIdRangePlugin.js +4 -4
  164. package/lib/ids/DeterministicChunkIdsPlugin.js +5 -4
  165. package/lib/ids/DeterministicModuleIdsPlugin.js +2 -2
  166. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  167. package/lib/ids/IdHelpers.js +9 -9
  168. package/lib/ids/NamedChunkIdsPlugin.js +5 -5
  169. package/lib/ids/NamedModuleIdsPlugin.js +2 -2
  170. package/lib/ids/NaturalChunkIdsPlugin.js +2 -2
  171. package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
  172. package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
  173. package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -4
  174. package/lib/ids/SyncModuleIdsPlugin.js +4 -4
  175. package/lib/index.js +10 -6
  176. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
  177. package/lib/javascript/BasicEvaluatedExpression.js +3 -3
  178. package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
  179. package/lib/javascript/EnableChunkLoadingPlugin.js +1 -1
  180. package/lib/javascript/JavascriptGenerator.js +1 -1
  181. package/lib/javascript/JavascriptModulesPlugin.js +16 -16
  182. package/lib/javascript/JavascriptParser.js +90 -83
  183. package/lib/javascript/JavascriptParserHelpers.js +3 -3
  184. package/lib/javascript/StartupHelpers.js +2 -2
  185. package/lib/json/JsonGenerator.js +2 -2
  186. package/lib/json/JsonModulesPlugin.js +2 -2
  187. package/lib/library/AbstractLibraryPlugin.js +3 -3
  188. package/lib/library/AmdLibraryPlugin.js +3 -3
  189. package/lib/library/AssignLibraryPlugin.js +2 -2
  190. package/lib/library/EnableLibraryPlugin.js +2 -2
  191. package/lib/library/ModuleLibraryPlugin.js +7 -2
  192. package/lib/library/SystemLibraryPlugin.js +6 -4
  193. package/lib/library/UmdLibraryPlugin.js +14 -14
  194. package/lib/logging/createConsoleLogger.js +4 -4
  195. package/lib/logging/runtime.js +3 -3
  196. package/lib/logging/truncateArgs.js +4 -4
  197. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
  198. package/lib/node/NodeEnvironmentPlugin.js +1 -1
  199. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +16 -14
  200. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +7 -7
  201. package/lib/node/ReadFileCompileWasmPlugin.js +7 -7
  202. package/lib/node/RequireChunkLoadingRuntimeModule.js +6 -4
  203. package/lib/node/nodeConsole.js +2 -2
  204. package/lib/optimize/AggressiveMergingPlugin.js +2 -2
  205. package/lib/optimize/AggressiveSplittingPlugin.js +10 -10
  206. package/lib/optimize/ConcatenatedModule.js +161 -52
  207. package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -2
  208. package/lib/optimize/FlagIncludedChunksPlugin.js +2 -2
  209. package/lib/optimize/InnerGraph.js +5 -5
  210. package/lib/optimize/InnerGraphPlugin.js +14 -12
  211. package/lib/optimize/LimitChunkCountPlugin.js +5 -5
  212. package/lib/optimize/MangleExportsPlugin.js +5 -5
  213. package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
  214. package/lib/optimize/MinChunkSizePlugin.js +3 -3
  215. package/lib/optimize/ModuleConcatenationPlugin.js +45 -38
  216. package/lib/optimize/RealContentHashPlugin.js +23 -23
  217. package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -2
  218. package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
  219. package/lib/optimize/RuntimeChunkPlugin.js +2 -2
  220. package/lib/optimize/SideEffectsFlagPlugin.js +22 -6
  221. package/lib/optimize/SplitChunksPlugin.js +20 -20
  222. package/lib/performance/AssetsOverSizeLimitWarning.js +1 -1
  223. package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
  224. package/lib/performance/SizeLimitsPlugin.js +4 -4
  225. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +1 -1
  226. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -3
  227. package/lib/rules/BasicMatcherRulePlugin.js +1 -1
  228. package/lib/rules/RuleSetCompiler.js +10 -10
  229. package/lib/rules/UseEffectRulePlugin.js +2 -2
  230. package/lib/runtime/GetChunkFilenameRuntimeModule.js +15 -15
  231. package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -1
  232. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
  233. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  234. package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -2
  235. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -3
  236. package/lib/schemes/DataUriPlugin.js +3 -3
  237. package/lib/schemes/FileUriPlugin.js +1 -1
  238. package/lib/schemes/HttpUriPlugin.js +40 -36
  239. package/lib/schemes/VirtualUrlPlugin.js +1 -1
  240. package/lib/serialization/BinaryMiddleware.js +11 -11
  241. package/lib/serialization/FileMiddleware.js +17 -17
  242. package/lib/serialization/ObjectMiddleware.js +8 -8
  243. package/lib/serialization/Serializer.js +2 -2
  244. package/lib/serialization/SerializerMiddleware.js +2 -2
  245. package/lib/sharing/ConsumeSharedPlugin.js +4 -4
  246. package/lib/sharing/ProvideSharedPlugin.js +4 -4
  247. package/lib/sharing/SharePlugin.js +1 -1
  248. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  249. package/lib/stats/DefaultStatsFactoryPlugin.js +86 -80
  250. package/lib/stats/DefaultStatsPresetPlugin.js +15 -15
  251. package/lib/stats/DefaultStatsPrinterPlugin.js +87 -87
  252. package/lib/stats/StatsFactory.js +7 -7
  253. package/lib/stats/StatsPrinter.js +9 -9
  254. package/lib/url/URLParserPlugin.js +5 -5
  255. package/lib/util/AsyncQueue.js +4 -4
  256. package/lib/util/IterableHelpers.js +2 -2
  257. package/lib/util/LazyBucketSortedSet.js +3 -3
  258. package/lib/util/SetHelpers.js +2 -2
  259. package/lib/util/StackedCacheMap.js +1 -1
  260. package/lib/util/StackedMap.js +1 -1
  261. package/lib/util/TupleSet.js +1 -1
  262. package/lib/util/WeakTupleMap.js +1 -1
  263. package/lib/util/cleverMerge.js +8 -8
  264. package/lib/util/comparators.js +107 -8
  265. package/lib/util/compileBooleanMatcher.js +20 -20
  266. package/lib/util/concatenate.js +3 -3
  267. package/lib/util/conventions.js +4 -4
  268. package/lib/util/create-schema-validation.js +1 -1
  269. package/lib/util/createHash.js +1 -1
  270. package/lib/util/deprecation.js +4 -4
  271. package/lib/util/deterministicGrouping.js +7 -7
  272. package/lib/util/findGraphRoots.js +1 -1
  273. package/lib/util/fs.js +3 -3
  274. package/lib/util/identifier.js +14 -14
  275. package/lib/util/magicComment.js +5 -1
  276. package/lib/util/memoize.js +1 -1
  277. package/lib/util/processAsyncTree.js +2 -2
  278. package/lib/util/propertyName.js +1 -1
  279. package/lib/util/removeBOM.js +1 -1
  280. package/lib/util/runtime.js +6 -6
  281. package/lib/util/semver.js +16 -16
  282. package/lib/util/serialization.js +5 -5
  283. package/lib/util/smartGrouping.js +1 -1
  284. package/lib/validateSchema.js +2 -2
  285. package/lib/wasm/EnableWasmLoadingPlugin.js +1 -1
  286. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +1 -1
  287. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +1 -1
  288. package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -4
  289. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -9
  290. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +2 -2
  291. package/lib/wasm-sync/WebAssemblyGenerator.js +14 -14
  292. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +4 -2
  293. package/lib/wasm-sync/WebAssemblyParser.js +2 -2
  294. package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -4
  295. package/lib/web/FetchCompileWasmPlugin.js +4 -4
  296. package/lib/web/JsonpChunkLoadingPlugin.js +2 -2
  297. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  298. package/lib/webpack.js +17 -12
  299. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -2
  300. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  301. package/package.json +13 -13
  302. package/schemas/WebpackOptions.check.js +1 -1
  303. package/schemas/WebpackOptions.json +4 -0
  304. package/types.d.ts +186 -54
@@ -1874,6 +1874,10 @@
1874
1874
  }
1875
1875
  ]
1876
1876
  },
1877
+ "deferImport": {
1878
+ "description": "Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.",
1879
+ "type": "boolean"
1880
+ },
1877
1881
  "dynamicImportFetchPriority": {
1878
1882
  "description": "Specifies global fetchPriority for dynamic import.",
1879
1883
  "enum": ["low", "high", "auto", false]
package/types.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  * Run `yarn fix:special` to update
5
5
  */
6
6
 
7
+ import { Parser as ParserImport } from "acorn";
7
8
  import { Buffer } from "buffer";
8
9
  import { Scope } from "eslint-scope";
9
10
  import {
@@ -1179,6 +1180,7 @@ declare interface CallbackWebpack<T> {
1179
1180
  (err: null | Error, stats?: T): void;
1180
1181
  }
1181
1182
  type Cell<T> = undefined | T;
1183
+ type ChildrenStatsOptions = undefined | string | boolean | StatsOptions;
1182
1184
  declare class Chunk {
1183
1185
  constructor(name?: null | string, backCompat?: boolean);
1184
1186
  id: null | string | number;
@@ -1950,6 +1952,55 @@ type CodeValuePrimitive =
1950
1952
  | boolean
1951
1953
  | Function
1952
1954
  | RegExp;
1955
+ declare interface Colors {
1956
+ reset: (value?: any) => string;
1957
+ bold: (value?: any) => string;
1958
+ dim: (value?: any) => string;
1959
+ italic: (value?: any) => string;
1960
+ underline: (value?: any) => string;
1961
+ inverse: (value?: any) => string;
1962
+ hidden: (value?: any) => string;
1963
+ strikethrough: (value?: any) => string;
1964
+ black: (value?: any) => string;
1965
+ red: (value?: any) => string;
1966
+ green: (value?: any) => string;
1967
+ yellow: (value?: any) => string;
1968
+ blue: (value?: any) => string;
1969
+ magenta: (value?: any) => string;
1970
+ cyan: (value?: any) => string;
1971
+ white: (value?: any) => string;
1972
+ gray: (value?: any) => string;
1973
+ bgBlack: (value?: any) => string;
1974
+ bgRed: (value?: any) => string;
1975
+ bgGreen: (value?: any) => string;
1976
+ bgYellow: (value?: any) => string;
1977
+ bgBlue: (value?: any) => string;
1978
+ bgMagenta: (value?: any) => string;
1979
+ bgCyan: (value?: any) => string;
1980
+ bgWhite: (value?: any) => string;
1981
+ blackBright: (value?: any) => string;
1982
+ redBright: (value?: any) => string;
1983
+ greenBright: (value?: any) => string;
1984
+ yellowBright: (value?: any) => string;
1985
+ blueBright: (value?: any) => string;
1986
+ magentaBright: (value?: any) => string;
1987
+ cyanBright: (value?: any) => string;
1988
+ whiteBright: (value?: any) => string;
1989
+ bgBlackBright: (value?: any) => string;
1990
+ bgRedBright: (value?: any) => string;
1991
+ bgGreenBright: (value?: any) => string;
1992
+ bgYellowBright: (value?: any) => string;
1993
+ bgBlueBright: (value?: any) => string;
1994
+ bgMagentaBright: (value?: any) => string;
1995
+ bgCyanBright: (value?: any) => string;
1996
+ bgWhiteBright: (value?: any) => string;
1997
+ }
1998
+ declare interface ColorsOptions {
1999
+ /**
2000
+ * force use colors
2001
+ */
2002
+ useColor?: boolean;
2003
+ }
1953
2004
  declare interface Comparator<T> {
1954
2005
  (a: T, b: T): 0 | 1 | -1;
1955
2006
  }
@@ -2518,7 +2569,7 @@ declare interface CompilationHooksJavascriptModulesPlugin {
2518
2569
  renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
2519
2570
  renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
2520
2571
  inlineInRuntimeBailout: SyncBailHook<
2521
- [Module, RenderBootstrapContext],
2572
+ [Module, Partial<RenderBootstrapContext>],
2522
2573
  string | void
2523
2574
  >;
2524
2575
  embedInRuntimeBailout: SyncBailHook<
@@ -2700,6 +2751,7 @@ declare interface ConcatenatedModuleInfo {
2700
2751
  rawExportMap?: Map<string, string>;
2701
2752
  namespaceExportSymbol?: string;
2702
2753
  namespaceObjectName?: string;
2754
+ concatenationScope?: ConcatenationScope;
2703
2755
 
2704
2756
  /**
2705
2757
  * "default-with-named" namespace
@@ -2745,12 +2797,17 @@ declare interface ConcatenationBailoutReasonContext {
2745
2797
  declare class ConcatenationScope {
2746
2798
  constructor(
2747
2799
  modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
2748
- currentModule: ConcatenatedModuleInfo
2800
+ currentModule: ConcatenatedModuleInfo,
2801
+ usedNames: Set<string>
2749
2802
  );
2803
+ usedNames: Set<string>;
2750
2804
  isModuleInScope(module: Module): boolean;
2751
2805
  registerExport(exportName: string, symbol: string): void;
2752
2806
  registerRawExport(exportName: string, expression: string): void;
2807
+ getRawExport(exportName: string): undefined | string;
2808
+ setRawExportMap(exportName: string, expression: string): void;
2753
2809
  registerNamespaceExport(symbol: string): void;
2810
+ registerUsedName(symbol: string): boolean;
2754
2811
  createModuleReference(
2755
2812
  module: Module,
2756
2813
  __1: Partial<ModuleReferenceOptions>
@@ -3719,6 +3776,17 @@ declare interface DependencyConstructor {
3719
3776
  new (...args: any[]): Dependency;
3720
3777
  }
3721
3778
  type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
3779
+ declare interface DependencySourceOrder {
3780
+ /**
3781
+ * the main source order
3782
+ */
3783
+ main: number;
3784
+
3785
+ /**
3786
+ * the sub source order
3787
+ */
3788
+ sub: number;
3789
+ }
3722
3790
  declare class DependencyTemplate {
3723
3791
  constructor();
3724
3792
  apply(
@@ -5168,6 +5236,7 @@ declare class ExternalModule extends Module {
5168
5236
  unsafeCacheData: UnsafeCacheData,
5169
5237
  normalModuleFactory: NormalModuleFactory
5170
5238
  ): void;
5239
+ static ModuleExternalInitFragment: typeof ModuleExternalInitFragment;
5171
5240
  }
5172
5241
  declare interface ExternalModuleInfo {
5173
5242
  type: "external";
@@ -5594,9 +5663,9 @@ declare abstract class FileSystemInfo {
5594
5663
  ): void;
5595
5664
  createSnapshot(
5596
5665
  startTime: undefined | null | number,
5597
- files: null | Iterable<string>,
5598
- directories: null | Iterable<string>,
5599
- missing: null | Iterable<string>,
5666
+ files: undefined | null | Iterable<string>,
5667
+ directories: undefined | null | Iterable<string>,
5668
+ missing: undefined | null | Iterable<string>,
5600
5669
  options: undefined | null | SnapshotOptionsFileSystemInfo,
5601
5670
  callback: (err: null | WebpackError, snapshot: null | Snapshot) => void
5602
5671
  ): void;
@@ -5898,10 +5967,12 @@ declare class HarmonyImportDependency extends ModuleDependency {
5898
5967
  constructor(
5899
5968
  request: string,
5900
5969
  sourceOrder: number,
5901
- attributes?: ImportAttributes
5970
+ attributes?: ImportAttributes,
5971
+ defer?: boolean
5902
5972
  );
5903
5973
  sourceOrder: number;
5904
5974
  getImportVar(moduleGraph: ModuleGraph): string;
5975
+ getModuleExports(__0: DependencyTemplateContext): string;
5905
5976
  getImportStatement(
5906
5977
  update: boolean,
5907
5978
  __1: DependencyTemplateContext
@@ -6214,6 +6285,7 @@ type ImportSource =
6214
6285
  | SimpleLiteral
6215
6286
  | RegExpLiteral
6216
6287
  | BigIntLiteral;
6288
+ type Imported = true | [string, string][];
6217
6289
 
6218
6290
  /**
6219
6291
  * Options for infrastructure level logging.
@@ -6276,6 +6348,8 @@ declare class InitFragment<GenerateContext> {
6276
6348
  serialize(context: ObjectSerializerContext): void;
6277
6349
  deserialize(context: ObjectDeserializerContext): void;
6278
6350
  merge: any;
6351
+ getImported: any;
6352
+ setImported: any;
6279
6353
  static addToSource<Context, T>(
6280
6354
  source: Source,
6281
6355
  initFragments: InitFragment<T>[],
@@ -6431,7 +6505,7 @@ declare class JavascriptModulesPlugin {
6431
6505
  ): TemplatePath;
6432
6506
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
6433
6507
  }
6434
- declare class JavascriptParser extends Parser {
6508
+ declare class JavascriptParser extends ParserClass {
6435
6509
  constructor(sourceType?: "module" | "auto" | "script");
6436
6510
  hooks: Readonly<{
6437
6511
  evaluateTypeof: HookMap<
@@ -7759,6 +7833,9 @@ declare class JavascriptParser extends Parser {
7759
7833
  rootInfo: ExportedVariableInfo;
7760
7834
  getMembers: () => string[];
7761
7835
  };
7836
+ static extend(
7837
+ ...plugins: ((BaseParser: typeof ParserImport) => typeof ParserImport)[]
7838
+ ): typeof JavascriptParser;
7762
7839
  static ALLOWED_MEMBER_TYPES_ALL: 3;
7763
7840
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
7764
7841
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
@@ -7803,6 +7880,11 @@ declare interface JavascriptParserOptions {
7803
7880
  */
7804
7881
  createRequire?: string | boolean;
7805
7882
 
7883
+ /**
7884
+ * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
7885
+ */
7886
+ deferImport?: boolean;
7887
+
7806
7888
  /**
7807
7889
  * Specifies global fetchPriority for dynamic import.
7808
7890
  */
@@ -8145,7 +8227,7 @@ declare interface KnownAssetInfo {
8145
8227
  /**
8146
8228
  * object of pointers to other assets, keyed by type of relation (only points from parent to child)
8147
8229
  */
8148
- related?: Record<string, string | string[]>;
8230
+ related?: Record<string, null | string | string[]>;
8149
8231
  }
8150
8232
  declare interface KnownBuildInfo {
8151
8233
  cacheable?: boolean;
@@ -8430,7 +8512,7 @@ declare interface KnownStatsChunkOrigin {
8430
8512
  moduleId?: string | number;
8431
8513
  }
8432
8514
  declare interface KnownStatsCompilation {
8433
- env?: Record<string, any>;
8515
+ env?: any;
8434
8516
  name?: string;
8435
8517
  hash?: string;
8436
8518
  version?: string;
@@ -9744,6 +9826,28 @@ declare class ModuleDependency extends Dependency {
9744
9826
  static EXPORTS_OBJECT_REFERENCED: string[][];
9745
9827
  static TRANSITIVE: typeof TRANSITIVE;
9746
9828
  }
9829
+ declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
9830
+ constructor(
9831
+ request: string,
9832
+ imported: Imported,
9833
+ ident?: string,
9834
+ dependencyMeta?: ImportDependencyMeta,
9835
+ hashFunction?: string | typeof Hash
9836
+ );
9837
+ getNamespaceIdentifier(): string;
9838
+ static addToSource<Context, T>(
9839
+ source: Source,
9840
+ initFragments: InitFragment<T>[],
9841
+ context: Context
9842
+ ): Source;
9843
+ static STAGE_CONSTANTS: number;
9844
+ static STAGE_ASYNC_BOUNDARY: number;
9845
+ static STAGE_HARMONY_EXPORTS: number;
9846
+ static STAGE_HARMONY_IMPORTS: number;
9847
+ static STAGE_PROVIDES: number;
9848
+ static STAGE_ASYNC_DEPENDENCIES: number;
9849
+ static STAGE_ASYNC_HARMONY_IMPORTS: number;
9850
+ }
9747
9851
  declare abstract class ModuleFactory {
9748
9852
  create(
9749
9853
  data: ModuleFactoryCreateData,
@@ -9874,6 +9978,7 @@ declare class ModuleGraph {
9874
9978
  module: Module,
9875
9979
  indexInBlock?: number
9876
9980
  ): void;
9981
+ setParentDependenciesBlockIndex(dependency: Dependency, index: number): void;
9877
9982
  getParentModule(dependency: Dependency): undefined | Module;
9878
9983
  getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
9879
9984
  getParentBlockIndex(dependency: Dependency): number;
@@ -9883,6 +9988,11 @@ declare class ModuleGraph {
9883
9988
  module: Module
9884
9989
  ): void;
9885
9990
  updateModule(dependency: Dependency, module: Module): void;
9991
+ updateParent(
9992
+ dependency: Dependency,
9993
+ connection?: ModuleGraphConnection,
9994
+ parentModule?: Module
9995
+ ): void;
9886
9996
  removeConnection(dependency: Dependency): void;
9887
9997
  addExplanation(dependency: Dependency, explanation: string): void;
9888
9998
  cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
@@ -10396,14 +10506,18 @@ declare interface MultiCompilerOptions {
10396
10506
  */
10397
10507
  parallelism?: number;
10398
10508
  }
10509
+ type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
10399
10510
  declare abstract class MultiStats {
10400
10511
  stats: Stats[];
10401
10512
  get hash(): string;
10402
10513
  hasErrors(): boolean;
10403
10514
  hasWarnings(): boolean;
10404
- toJson(options?: string | boolean | StatsOptions): StatsCompilation;
10405
- toString(options?: string | boolean | StatsOptions): string;
10515
+ toJson(options?: string | boolean | MultiStatsOptions): StatsCompilation;
10516
+ toString(options?: string | boolean | MultiStatsOptions): string;
10406
10517
  }
10518
+ type MultiStatsOptions = Omit<StatsOptions, "children"> & {
10519
+ children?: string | boolean | StatsOptions | ChildrenStatsOptions[];
10520
+ };
10407
10521
  declare abstract class MultiWatching {
10408
10522
  watchings: Watching[];
10409
10523
  compiler: MultiCompiler;
@@ -10549,7 +10663,7 @@ declare class NormalModule extends Module {
10549
10663
  userRequest: string;
10550
10664
  rawRequest: string;
10551
10665
  binary: boolean;
10552
- parser?: Parser;
10666
+ parser?: ParserClass;
10553
10667
  parserOptions?: ParserOptions;
10554
10668
  generator?: Generator;
10555
10669
  generatorOptions?: GeneratorOptions;
@@ -10680,7 +10794,7 @@ declare interface NormalModuleCreateData {
10680
10794
  /**
10681
10795
  * the parser used
10682
10796
  */
10683
- parser: Parser;
10797
+ parser: ParserClass;
10684
10798
 
10685
10799
  /**
10686
10800
  * the options of the parser used
@@ -10728,7 +10842,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10728
10842
  ResolveData
10729
10843
  ]
10730
10844
  >;
10731
- createParser: HookMap<SyncBailHook<[ParserOptions], void | Parser>>;
10845
+ createParser: HookMap<SyncBailHook<[ParserOptions], void | ParserClass>>;
10732
10846
  parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
10733
10847
  createGenerator: HookMap<
10734
10848
  SyncBailHook<[GeneratorOptions], void | Generator>
@@ -10748,7 +10862,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10748
10862
  ruleSet: RuleSet;
10749
10863
  context: string;
10750
10864
  fs: InputFileSystem;
10751
- parserCache: Map<string, WeakMap<ParserOptions, Parser>>;
10865
+ parserCache: Map<string, WeakMap<ParserOptions, ParserClass>>;
10752
10866
  generatorCache: Map<string, WeakMap<GeneratorOptions, Generator>>;
10753
10867
  cleanupForCache(): void;
10754
10868
  resolveResource(
@@ -10771,8 +10885,8 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10771
10885
  resolveContext: ResolveContext,
10772
10886
  callback: CallbackNormalModuleFactory<LoaderItem[]>
10773
10887
  ): void;
10774
- getParser(type: string, parserOptions?: ParserOptions): Parser;
10775
- createParser(type: string, parserOptions?: ParserOptions): Parser;
10888
+ getParser(type: string, parserOptions?: ParserOptions): ParserClass;
10889
+ createParser(type: string, parserOptions?: ParserOptions): ParserClass;
10776
10890
  getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
10777
10891
  createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
10778
10892
  getResolver(
@@ -10856,43 +10970,43 @@ declare class NormalModuleReplacementPlugin {
10856
10970
  type NormalizedStatsOptions = KnownNormalizedStatsOptions &
10857
10971
  Omit<
10858
10972
  StatsOptions,
10859
- | "context"
10860
- | "chunkGroups"
10861
- | "requestShortener"
10862
- | "chunksSort"
10863
- | "modulesSort"
10864
- | "chunkModulesSort"
10865
- | "nestedModulesSort"
10866
10973
  | "assetsSort"
10867
- | "ids"
10868
- | "cachedAssets"
10869
- | "groupAssetsByEmitStatus"
10870
- | "groupAssetsByPath"
10871
- | "groupAssetsByExtension"
10872
10974
  | "assetsSpace"
10873
- | "excludeAssets"
10874
- | "excludeModules"
10875
- | "warningsFilter"
10975
+ | "cachedAssets"
10876
10976
  | "cachedModules"
10877
- | "orphanModules"
10977
+ | "chunkGroupAuxiliary"
10978
+ | "chunkGroupChildren"
10979
+ | "chunkGroupMaxAssets"
10980
+ | "chunkGroups"
10981
+ | "chunkModulesSpace"
10982
+ | "chunksSort"
10983
+ | "context"
10878
10984
  | "dependentModules"
10879
- | "runtimeModules"
10985
+ | "entrypoints"
10986
+ | "excludeAssets"
10987
+ | "excludeModules"
10988
+ | "groupAssetsByEmitStatus"
10989
+ | "groupAssetsByExtension"
10990
+ | "groupAssetsByPath"
10991
+ | "groupModulesByAttributes"
10880
10992
  | "groupModulesByCacheStatus"
10993
+ | "groupModulesByExtension"
10881
10994
  | "groupModulesByLayer"
10882
- | "groupModulesByAttributes"
10883
10995
  | "groupModulesByPath"
10884
- | "groupModulesByExtension"
10885
10996
  | "groupModulesByType"
10886
- | "entrypoints"
10887
- | "chunkGroupAuxiliary"
10888
- | "chunkGroupChildren"
10889
- | "chunkGroupMaxAssets"
10890
- | "modulesSpace"
10891
- | "chunkModulesSpace"
10892
- | "nestedModulesSpace"
10997
+ | "ids"
10893
10998
  | "logging"
10894
10999
  | "loggingDebug"
10895
11000
  | "loggingTrace"
11001
+ | "modulesSort"
11002
+ | "modulesSpace"
11003
+ | "nestedModulesSpace"
11004
+ | "orphanModules"
11005
+ | "runtimeModules"
11006
+ | "warningsFilter"
11007
+ | "requestShortener"
11008
+ | "chunkModulesSort"
11009
+ | "nestedModulesSort"
10896
11010
  | "_env"
10897
11011
  > &
10898
11012
  Record<string, any>;
@@ -12238,7 +12352,7 @@ declare interface ParsedIdentifier {
12238
12352
  */
12239
12353
  internal: boolean;
12240
12354
  }
12241
- declare class Parser {
12355
+ declare class ParserClass {
12242
12356
  constructor();
12243
12357
  parse(
12244
12358
  source: string | Buffer | PreparsedAst,
@@ -12553,7 +12667,7 @@ declare class ProgressPlugin {
12553
12667
  showModules?: boolean;
12554
12668
  showDependencies?: boolean;
12555
12669
  showActiveModules?: boolean;
12556
- percentBy?: null | "entries" | "modules" | "dependencies";
12670
+ percentBy?: null | "modules" | "entries" | "dependencies";
12557
12671
  apply(compiler: Compiler | MultiCompiler): void;
12558
12672
  static getReporter(
12559
12673
  compiler: Compiler
@@ -12618,7 +12732,7 @@ declare interface ProgressPluginOptions {
12618
12732
  /**
12619
12733
  * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
12620
12734
  */
12621
- percentBy?: null | "entries" | "modules" | "dependencies";
12735
+ percentBy?: null | "modules" | "entries" | "dependencies";
12622
12736
 
12623
12737
  /**
12624
12738
  * Collect profile data for progress steps. Default: false.
@@ -14891,6 +15005,7 @@ declare abstract class RuntimeTemplate {
14891
15005
  supportsEcmaScriptModuleSyntax(): undefined | boolean;
14892
15006
  supportTemplateLiteral(): undefined | boolean;
14893
15007
  supportNodePrefixForCoreModules(): undefined | boolean;
15008
+ renderNodePrefixForCoreModule(mod: string): string;
14894
15009
  returningFunction(returnValue: string, args?: string): string;
14895
15010
  basicFunction(args: string, body: string | string[]): string;
14896
15011
  concatenation(...args: (string | { expr: string })[]): string;
@@ -17368,21 +17483,24 @@ declare interface WriteStreamOptions {
17368
17483
  declare function exports(
17369
17484
  options: Configuration,
17370
17485
  callback?: CallbackWebpack<Stats>
17371
- ): Compiler;
17486
+ ): null | Compiler;
17372
17487
  declare function exports(
17373
- options: ReadonlyArray<Configuration> & MultiCompilerOptions,
17488
+ options: MultiConfiguration,
17374
17489
  callback?: CallbackWebpack<MultiStats>
17375
- ): MultiCompiler;
17490
+ ): null | MultiCompiler;
17376
17491
  declare namespace exports {
17377
17492
  export const webpack: {
17378
- (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
17379
17493
  (
17380
- options: ReadonlyArray<Configuration> & MultiCompilerOptions,
17494
+ options: Configuration,
17495
+ callback?: CallbackWebpack<Stats>
17496
+ ): null | Compiler;
17497
+ (
17498
+ options: MultiConfiguration,
17381
17499
  callback?: CallbackWebpack<MultiStats>
17382
- ): MultiCompiler;
17500
+ ): null | MultiCompiler;
17383
17501
  };
17384
17502
  export const validate: (
17385
- configuration: Configuration | Configuration[]
17503
+ configuration: Configuration | MultiConfiguration
17386
17504
  ) => void;
17387
17505
  export const validateSchema: (
17388
17506
  schema: Parameters<typeof validateFunction>[0],
@@ -17391,6 +17509,7 @@ declare namespace exports {
17391
17509
  ) => void;
17392
17510
  export const version: string;
17393
17511
  export namespace cli {
17512
+ export let createColors: (__0?: ColorsOptions) => Colors;
17394
17513
  export let getArguments: (
17395
17514
  schema?:
17396
17515
  | (JSONSchema4 & {
@@ -17427,6 +17546,7 @@ declare namespace exports {
17427
17546
  };
17428
17547
  })
17429
17548
  ) => Flags;
17549
+ export let isColorSupported: () => boolean;
17430
17550
  export let processArguments: (
17431
17551
  args: Flags,
17432
17552
  config: ObjectConfiguration,
@@ -17504,6 +17624,10 @@ declare namespace exports {
17504
17624
  export let ensureChunkHandlers: "__webpack_require__.f";
17505
17625
  export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
17506
17626
  export let entryModuleId: "__webpack_require__.s";
17627
+ export let esmId: "__webpack_esm_id__";
17628
+ export let esmIds: "__webpack_esm_ids__";
17629
+ export let esmModules: "__webpack_esm_modules__";
17630
+ export let esmRuntime: "__webpack_esm_runtime__";
17507
17631
  export let exports: "__webpack_exports__";
17508
17632
  export let externalInstallChunk: "__webpack_require__.C";
17509
17633
  export let getChunkCssFilename: "__webpack_require__.k";
@@ -17791,6 +17915,10 @@ declare namespace exports {
17791
17915
  ...cRest: Comparator<T>[]
17792
17916
  ) => Comparator<T>;
17793
17917
  export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
17918
+ export let sortWithSourceOrder: (
17919
+ dependencies: Dependency[],
17920
+ dependencySourceOrderMap: WeakMap<Dependency, DependencySourceOrder>
17921
+ ) => void;
17794
17922
  }
17795
17923
  export namespace runtime {
17796
17924
  export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
@@ -18025,7 +18153,7 @@ declare namespace exports {
18025
18153
  NormalModule,
18026
18154
  NormalModuleReplacementPlugin,
18027
18155
  MultiCompiler,
18028
- Parser,
18156
+ ParserClass as Parser,
18029
18157
  PlatformPlugin,
18030
18158
  PrefetchPlugin,
18031
18159
  ProgressPlugin,
@@ -18075,7 +18203,9 @@ declare namespace exports {
18075
18203
  AssetEmittedInfo,
18076
18204
  Entrypoint,
18077
18205
  MultiCompilerOptions,
18206
+ MultiConfiguration,
18078
18207
  MultiStats,
18208
+ MultiStatsOptions,
18079
18209
  ResolveData,
18080
18210
  ParserState,
18081
18211
  ResolvePluginInstance,
@@ -18083,6 +18213,8 @@ declare namespace exports {
18083
18213
  Watching,
18084
18214
  Argument,
18085
18215
  Problem,
18216
+ Colors,
18217
+ ColorsOptions,
18086
18218
  StatsAsset,
18087
18219
  StatsChunk,
18088
18220
  StatsChunkGroup,