webpack 5.93.0 → 5.95.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 (344) hide show
  1. package/README.md +8 -5
  2. package/bin/webpack.js +6 -7
  3. package/hot/log.js +1 -2
  4. package/hot/only-dev-server.js +1 -1
  5. package/hot/poll.js +1 -1
  6. package/hot/signal.js +1 -1
  7. package/lib/APIPlugin.js +4 -3
  8. package/lib/AbstractMethodError.js +10 -5
  9. package/lib/AutomaticPrefetchPlugin.js +1 -1
  10. package/lib/BannerPlugin.js +12 -6
  11. package/lib/Cache.js +8 -10
  12. package/lib/CacheFacade.js +3 -3
  13. package/lib/CaseSensitiveModulesWarning.js +5 -7
  14. package/lib/Chunk.js +14 -11
  15. package/lib/ChunkGraph.js +58 -36
  16. package/lib/ChunkGroup.js +2 -3
  17. package/lib/ChunkTemplate.js +43 -0
  18. package/lib/CleanPlugin.js +10 -11
  19. package/lib/CodeGenerationResults.js +6 -5
  20. package/lib/CommentCompilationWarning.js +0 -1
  21. package/lib/Compilation.js +223 -191
  22. package/lib/Compiler.js +81 -82
  23. package/lib/ConcatenationScope.js +3 -6
  24. package/lib/ConditionalInitFragment.js +6 -7
  25. package/lib/ConstPlugin.js +7 -15
  26. package/lib/ContextExclusionPlugin.js +3 -3
  27. package/lib/ContextModule.js +33 -20
  28. package/lib/ContextModuleFactory.js +89 -44
  29. package/lib/ContextReplacementPlugin.js +10 -9
  30. package/lib/DefinePlugin.js +75 -68
  31. package/lib/DelegatedModule.js +7 -3
  32. package/lib/DelegatedModuleFactoryPlugin.js +36 -22
  33. package/lib/DelegatedPlugin.js +4 -0
  34. package/lib/DependenciesBlock.js +0 -1
  35. package/lib/Dependency.js +10 -14
  36. package/lib/DllEntryPlugin.js +4 -2
  37. package/lib/DllModuleFactory.js +1 -0
  38. package/lib/DllPlugin.js +9 -7
  39. package/lib/DllReferencePlugin.js +30 -15
  40. package/lib/EntryPlugin.js +1 -3
  41. package/lib/EnvironmentPlugin.js +6 -2
  42. package/lib/ErrorHelpers.js +11 -12
  43. package/lib/EvalDevToolModulePlugin.js +10 -12
  44. package/lib/EvalSourceMapDevToolPlugin.js +15 -13
  45. package/lib/ExportsInfo.js +185 -120
  46. package/lib/ExternalModule.js +41 -15
  47. package/lib/ExternalModuleFactoryPlugin.js +23 -10
  48. package/lib/FileSystemInfo.js +791 -422
  49. package/lib/FlagAllModulesAsUsedPlugin.js +1 -1
  50. package/lib/FlagDependencyExportsPlugin.js +12 -11
  51. package/lib/FlagDependencyUsagePlugin.js +1 -1
  52. package/lib/Generator.js +2 -5
  53. package/lib/GraphHelpers.js +3 -2
  54. package/lib/HookWebpackError.js +8 -10
  55. package/lib/HotModuleReplacementPlugin.js +78 -64
  56. package/lib/IgnoreErrorModuleFactory.js +3 -3
  57. package/lib/IgnorePlugin.js +1 -3
  58. package/lib/IgnoreWarningsPlugin.js +6 -9
  59. package/lib/InitFragment.js +2 -3
  60. package/lib/LibManifestPlugin.js +4 -3
  61. package/lib/MainTemplate.js +72 -19
  62. package/lib/Module.js +25 -9
  63. package/lib/ModuleBuildError.js +4 -11
  64. package/lib/ModuleDependencyError.js +5 -5
  65. package/lib/ModuleDependencyWarning.js +5 -5
  66. package/lib/ModuleError.js +1 -5
  67. package/lib/ModuleFilenameHelpers.js +29 -46
  68. package/lib/ModuleGraph.js +7 -6
  69. package/lib/ModuleGraphConnection.js +6 -6
  70. package/lib/ModuleInfoHeaderPlugin.js +82 -30
  71. package/lib/ModuleParseError.js +8 -9
  72. package/lib/ModuleRestoreError.js +1 -1
  73. package/lib/ModuleStoreError.js +1 -1
  74. package/lib/ModuleTemplate.js +33 -1
  75. package/lib/ModuleTypeConstants.js +21 -22
  76. package/lib/ModuleWarning.js +1 -5
  77. package/lib/MultiCompiler.js +24 -26
  78. package/lib/MultiStats.js +73 -31
  79. package/lib/MultiWatching.js +1 -1
  80. package/lib/NormalModule.js +130 -69
  81. package/lib/NormalModuleFactory.js +53 -49
  82. package/lib/OptimizationStages.js +3 -3
  83. package/lib/ProgressPlugin.js +9 -9
  84. package/lib/ProvidePlugin.js +4 -4
  85. package/lib/RuntimeGlobals.js +71 -70
  86. package/lib/RuntimeModule.js +1 -1
  87. package/lib/RuntimePlugin.js +24 -12
  88. package/lib/RuntimeTemplate.js +40 -44
  89. package/lib/SizeFormatHelpers.js +2 -4
  90. package/lib/SourceMapDevToolPlugin.js +42 -34
  91. package/lib/Stats.js +5 -11
  92. package/lib/Template.js +18 -24
  93. package/lib/TemplatedPathPlugin.js +21 -13
  94. package/lib/WarnDeprecatedOptionPlugin.js +0 -1
  95. package/lib/WatchIgnorePlugin.js +26 -9
  96. package/lib/Watching.js +10 -5
  97. package/lib/WebpackOptionsApply.js +84 -62
  98. package/lib/asset/AssetGenerator.js +107 -42
  99. package/lib/asset/AssetModulesPlugin.js +29 -23
  100. package/lib/asset/AssetSourceGenerator.js +2 -7
  101. package/lib/async-modules/AwaitDependenciesInitFragment.js +6 -7
  102. package/lib/buildChunkGraph.js +93 -81
  103. package/lib/cache/IdleFileCachePlugin.js +4 -4
  104. package/lib/cache/MemoryWithGcCachePlugin.js +5 -5
  105. package/lib/cache/PackFileCacheStrategy.js +51 -50
  106. package/lib/cache/ResolverCachePlugin.js +6 -6
  107. package/lib/cache/mergeEtags.js +16 -21
  108. package/lib/cli.js +148 -104
  109. package/lib/config/browserslistTargetHandler.js +16 -13
  110. package/lib/config/defaults.js +32 -28
  111. package/lib/config/normalization.js +335 -344
  112. package/lib/config/target.js +42 -52
  113. package/lib/container/ContainerEntryModule.js +2 -2
  114. package/lib/container/ContainerPlugin.js +1 -1
  115. package/lib/container/RemoteRuntimeModule.js +11 -8
  116. package/lib/container/options.js +18 -4
  117. package/lib/css/CssExportsGenerator.js +26 -24
  118. package/lib/css/CssGenerator.js +9 -4
  119. package/lib/css/CssLoadingRuntimeModule.js +10 -10
  120. package/lib/css/CssModulesPlugin.js +127 -47
  121. package/lib/css/CssParser.js +20 -18
  122. package/lib/css/walkCssTokens.js +80 -95
  123. package/lib/debug/ProfilingPlugin.js +19 -20
  124. package/lib/dependencies/AMDDefineDependency.js +1 -1
  125. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +83 -47
  126. package/lib/dependencies/AMDRequireArrayDependency.js +9 -10
  127. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +22 -16
  128. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  129. package/lib/dependencies/CommonJsDependencyHelpers.js +6 -2
  130. package/lib/dependencies/CommonJsExportRequireDependency.js +37 -41
  131. package/lib/dependencies/CommonJsExportsDependency.js +0 -1
  132. package/lib/dependencies/CommonJsExportsParserPlugin.js +19 -23
  133. package/lib/dependencies/CommonJsFullRequireDependency.js +1 -1
  134. package/lib/dependencies/CommonJsImportsParserPlugin.js +52 -61
  135. package/lib/dependencies/CommonJsSelfReferenceDependency.js +6 -8
  136. package/lib/dependencies/ConstDependency.js +1 -1
  137. package/lib/dependencies/ContextDependency.js +7 -2
  138. package/lib/dependencies/ContextDependencyHelpers.js +31 -34
  139. package/lib/dependencies/ContextElementDependency.js +35 -8
  140. package/lib/dependencies/CriticalDependencyWarning.js +1 -1
  141. package/lib/dependencies/CssExportDependency.js +7 -7
  142. package/lib/dependencies/CssImportDependency.js +0 -2
  143. package/lib/dependencies/CssLocalIdentifierDependency.js +3 -3
  144. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
  145. package/lib/dependencies/CssUrlDependency.js +4 -5
  146. package/lib/dependencies/DynamicExports.js +5 -5
  147. package/lib/dependencies/ExportsInfoDependency.js +1 -2
  148. package/lib/dependencies/HarmonyAcceptImportDependency.js +1 -1
  149. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -5
  150. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +27 -16
  151. package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
  152. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +107 -64
  153. package/lib/dependencies/HarmonyExports.js +2 -2
  154. package/lib/dependencies/HarmonyImportDependency.js +2 -4
  155. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +19 -4
  156. package/lib/dependencies/HarmonyImportSpecifierDependency.js +40 -15
  157. package/lib/dependencies/ImportDependency.js +1 -1
  158. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +5 -5
  159. package/lib/dependencies/ImportMetaPlugin.js +11 -13
  160. package/lib/dependencies/ImportParserPlugin.js +39 -44
  161. package/lib/dependencies/JsonExportsDependency.js +22 -18
  162. package/lib/dependencies/LoaderPlugin.js +47 -36
  163. package/lib/dependencies/LocalModule.js +1 -1
  164. package/lib/dependencies/LocalModulesHelpers.js +4 -4
  165. package/lib/dependencies/ModuleDecoratorDependency.js +1 -1
  166. package/lib/dependencies/ProvidedDependency.js +1 -1
  167. package/lib/dependencies/PureExpressionDependency.js +6 -6
  168. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  169. package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
  170. package/lib/dependencies/SystemPlugin.js +1 -1
  171. package/lib/dependencies/URLDependency.js +3 -3
  172. package/lib/dependencies/URLPlugin.js +66 -12
  173. package/lib/dependencies/WorkerPlugin.js +25 -24
  174. package/lib/dependencies/processExportInfo.js +3 -1
  175. package/lib/electron/ElectronTargetPlugin.js +1 -0
  176. package/lib/esm/ModuleChunkFormatPlugin.js +3 -3
  177. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -3
  178. package/lib/formatLocation.js +1 -2
  179. package/lib/hmr/HotModuleReplacement.runtime.js +4 -5
  180. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -0
  181. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +9 -12
  182. package/lib/hmr/LazyCompilationPlugin.js +27 -12
  183. package/lib/hmr/lazyCompilationBackend.js +64 -40
  184. package/lib/ids/ChunkModuleIdRangePlugin.js +1 -3
  185. package/lib/ids/DeterministicChunkIdsPlugin.js +2 -4
  186. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  187. package/lib/ids/HashedModuleIdsPlugin.js +5 -1
  188. package/lib/ids/IdHelpers.js +29 -39
  189. package/lib/ids/SyncModuleIdsPlugin.js +7 -2
  190. package/lib/index.js +1 -5
  191. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +5 -4
  192. package/lib/javascript/BasicEvaluatedExpression.js +4 -19
  193. package/lib/javascript/ChunkHelpers.js +1 -1
  194. package/lib/javascript/CommonJsChunkFormatPlugin.js +3 -2
  195. package/lib/javascript/EnableChunkLoadingPlugin.js +7 -6
  196. package/lib/javascript/JavascriptGenerator.js +23 -7
  197. package/lib/javascript/JavascriptModulesPlugin.js +133 -86
  198. package/lib/javascript/JavascriptParser.js +179 -200
  199. package/lib/javascript/JavascriptParserHelpers.js +20 -21
  200. package/lib/javascript/StartupHelpers.js +41 -13
  201. package/lib/json/JsonGenerator.js +7 -13
  202. package/lib/json/JsonModulesPlugin.js +1 -4
  203. package/lib/json/JsonParser.js +5 -3
  204. package/lib/library/AmdLibraryPlugin.js +12 -16
  205. package/lib/library/AssignLibraryPlugin.js +8 -10
  206. package/lib/library/EnableLibraryPlugin.js +15 -14
  207. package/lib/library/JsonpLibraryPlugin.js +2 -1
  208. package/lib/library/ModernModuleLibraryPlugin.js +8 -6
  209. package/lib/library/ModuleLibraryPlugin.js +2 -1
  210. package/lib/library/SystemLibraryPlugin.js +2 -1
  211. package/lib/library/UmdLibraryPlugin.js +66 -92
  212. package/lib/logging/Logger.js +32 -4
  213. package/lib/logging/createConsoleLogger.js +12 -13
  214. package/lib/logging/runtime.js +7 -8
  215. package/lib/logging/truncateArgs.js +5 -8
  216. package/lib/node/NodeWatchFileSystem.js +3 -18
  217. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
  218. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -0
  219. package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -2
  220. package/lib/node/nodeConsole.js +22 -22
  221. package/lib/optimize/AggressiveMergingPlugin.js +2 -4
  222. package/lib/optimize/AggressiveSplittingPlugin.js +16 -19
  223. package/lib/optimize/ConcatenatedModule.js +81 -51
  224. package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
  225. package/lib/optimize/FlagIncludedChunksPlugin.js +3 -3
  226. package/lib/optimize/InnerGraph.js +17 -17
  227. package/lib/optimize/InnerGraphPlugin.js +8 -7
  228. package/lib/optimize/LimitChunkCountPlugin.js +2 -3
  229. package/lib/optimize/MangleExportsPlugin.js +1 -0
  230. package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
  231. package/lib/optimize/MinMaxSizeWarning.js +1 -1
  232. package/lib/optimize/ModuleConcatenationPlugin.js +54 -78
  233. package/lib/optimize/RealContentHashPlugin.js +7 -10
  234. package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
  235. package/lib/optimize/SideEffectsFlagPlugin.js +6 -2
  236. package/lib/optimize/SplitChunksPlugin.js +34 -30
  237. package/lib/performance/SizeLimitsPlugin.js +2 -2
  238. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +1 -1
  239. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +1 -1
  240. package/lib/rules/BasicEffectRulePlugin.js +3 -1
  241. package/lib/rules/BasicMatcherRulePlugin.js +3 -1
  242. package/lib/rules/ObjectMatcherRulePlugin.js +4 -1
  243. package/lib/rules/RuleSetCompiler.js +41 -22
  244. package/lib/rules/UseEffectRulePlugin.js +36 -32
  245. package/lib/runtime/AsyncModuleRuntimeModule.js +1 -1
  246. package/lib/runtime/AutoPublicPathRuntimeModule.js +8 -3
  247. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +2 -2
  248. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +1 -1
  249. package/lib/runtime/EnsureChunkRuntimeModule.js +10 -11
  250. package/lib/runtime/GetChunkFilenameRuntimeModule.js +11 -17
  251. package/lib/runtime/LoadScriptRuntimeModule.js +17 -18
  252. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +1 -3
  253. package/lib/schemes/DataUriPlugin.js +1 -1
  254. package/lib/schemes/HttpUriPlugin.js +241 -126
  255. package/lib/serialization/BinaryMiddleware.js +44 -28
  256. package/lib/serialization/DateObjectSerializer.js +1 -0
  257. package/lib/serialization/ErrorObjectSerializer.js +2 -0
  258. package/lib/serialization/FileMiddleware.js +154 -106
  259. package/lib/serialization/MapObjectSerializer.js +2 -1
  260. package/lib/serialization/NullPrototypeObjectSerializer.js +3 -2
  261. package/lib/serialization/ObjectMiddleware.js +52 -56
  262. package/lib/serialization/PlainObjectSerializer.js +32 -6
  263. package/lib/serialization/RegExpObjectSerializer.js +1 -0
  264. package/lib/serialization/Serializer.js +4 -5
  265. package/lib/serialization/SerializerMiddleware.js +6 -6
  266. package/lib/serialization/SetObjectSerializer.js +2 -1
  267. package/lib/sharing/ConsumeSharedPlugin.js +116 -97
  268. package/lib/sharing/ConsumeSharedRuntimeModule.js +4 -4
  269. package/lib/sharing/ProvideForSharedDependency.js +0 -1
  270. package/lib/sharing/ProvideSharedPlugin.js +2 -2
  271. package/lib/sharing/resolveMatchedConfigs.js +2 -1
  272. package/lib/sharing/utils.js +15 -27
  273. package/lib/stats/DefaultStatsFactoryPlugin.js +424 -281
  274. package/lib/stats/DefaultStatsPresetPlugin.js +73 -18
  275. package/lib/stats/DefaultStatsPrinterPlugin.js +370 -101
  276. package/lib/stats/StatsFactory.js +127 -56
  277. package/lib/stats/StatsPrinter.js +75 -44
  278. package/lib/util/ArrayHelpers.js +8 -4
  279. package/lib/util/ArrayQueue.js +1 -1
  280. package/lib/util/AsyncQueue.js +31 -12
  281. package/lib/util/IterableHelpers.js +3 -4
  282. package/lib/util/LazyBucketSortedSet.js +60 -44
  283. package/lib/util/LazySet.js +13 -0
  284. package/lib/util/MapHelpers.js +1 -3
  285. package/lib/util/ParallelismFactorCalculator.js +1 -1
  286. package/lib/util/Queue.js +1 -1
  287. package/lib/util/Semaphore.js +4 -7
  288. package/lib/util/SetHelpers.js +5 -5
  289. package/lib/util/SortableSet.js +4 -3
  290. package/lib/util/StackedCacheMap.js +4 -6
  291. package/lib/util/StackedMap.js +1 -3
  292. package/lib/util/StringXor.js +0 -5
  293. package/lib/util/TupleQueue.js +1 -1
  294. package/lib/util/TupleSet.js +15 -5
  295. package/lib/util/URLAbsoluteSpecifier.js +7 -7
  296. package/lib/util/WeakTupleMap.js +19 -21
  297. package/lib/util/binarySearchBounds.js +5 -12
  298. package/lib/util/chainedImports.js +1 -1
  299. package/lib/util/cleverMerge.js +21 -19
  300. package/lib/util/comparators.js +57 -52
  301. package/lib/util/compileBooleanMatcher.js +3 -6
  302. package/lib/util/conventions.js +8 -11
  303. package/lib/util/createHash.js +9 -6
  304. package/lib/util/deprecation.js +22 -12
  305. package/lib/util/deterministicGrouping.js +19 -26
  306. package/lib/util/findGraphRoots.js +2 -2
  307. package/lib/util/fs.js +32 -32
  308. package/lib/util/hash/md4.js +2 -2
  309. package/lib/util/hash/wasm-hash.js +7 -7
  310. package/lib/util/hash/xxhash64.js +2 -2
  311. package/lib/util/identifier.js +81 -59
  312. package/lib/util/memoize.js +8 -10
  313. package/lib/util/mergeScope.js +6 -9
  314. package/lib/util/nonNumericOnlyHash.js +2 -2
  315. package/lib/util/numberHash.js +1 -6
  316. package/lib/util/objectToMap.js +0 -1
  317. package/lib/util/propertyAccess.js +2 -5
  318. package/lib/util/propertyName.js +1 -3
  319. package/lib/util/registerExternalSerializer.js +1 -1
  320. package/lib/util/runtime.js +109 -113
  321. package/lib/util/semver.js +29 -27
  322. package/lib/util/serialization.js +16 -1
  323. package/lib/util/smartGrouping.js +5 -5
  324. package/lib/util/source.js +1 -1
  325. package/lib/wasm/EnableWasmLoadingPlugin.js +5 -4
  326. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +3 -3
  327. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +5 -6
  328. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
  329. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +20 -19
  330. package/lib/wasm-sync/WebAssemblyGenerator.js +14 -29
  331. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
  332. package/lib/wasm-sync/WebAssemblyUtils.js +2 -2
  333. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -3
  334. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -1
  335. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  336. package/package.json +18 -17
  337. package/schemas/WebpackOptions.check.js +1 -1
  338. package/schemas/WebpackOptions.json +5 -0
  339. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  340. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  341. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  342. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  343. package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
  344. package/types.d.ts +681 -355
package/types.d.ts CHANGED
@@ -99,10 +99,12 @@ import {
99
99
  AsyncSeriesHook,
100
100
  AsyncSeriesWaterfallHook,
101
101
  HookMap,
102
+ IfSet,
102
103
  MultiHook,
103
104
  SyncBailHook,
104
105
  SyncHook,
105
- SyncWaterfallHook
106
+ SyncWaterfallHook,
107
+ TapOptions
106
108
  } from "tapable";
107
109
  import { SecureContextOptions, TlsOptions } from "tls";
108
110
  import { URL } from "url";
@@ -219,6 +221,7 @@ declare interface AggressiveSplittingPluginOptions {
219
221
  */
220
222
  minSize?: number;
221
223
  }
224
+ type Algorithm = string | typeof Hash;
222
225
  type Alias = string | false | string[];
223
226
  declare interface AliasOption {
224
227
  alias: Alias;
@@ -230,13 +233,13 @@ declare interface AliasOptions {
230
233
  [index: string]: AliasOptionNewRequest;
231
234
  }
232
235
  declare interface Argument {
233
- description: string;
234
- simpleType: "string" | "number" | "boolean";
236
+ description?: string;
237
+ simpleType: SimpleType;
235
238
  multiple: boolean;
236
239
  configs: ArgumentConfig[];
237
240
  }
238
241
  declare interface ArgumentConfig {
239
- description: string;
242
+ description?: string;
240
243
  negatedDescription?: string;
241
244
  path: string;
242
245
  multiple: boolean;
@@ -400,7 +403,9 @@ declare abstract class AsyncQueue<T, K, R> {
400
403
  added: SyncHook<[T]>;
401
404
  beforeStart: AsyncSeriesHook<[T]>;
402
405
  started: SyncHook<[T]>;
403
- result: SyncHook<[T, Error, R]>;
406
+ result: SyncHook<
407
+ [T, undefined | null | WebpackError, undefined | null | R]
408
+ >;
404
409
  };
405
410
  add(item: T, callback: CallbackAsyncQueue<R>): void;
406
411
  invalidate(item: T): void;
@@ -450,8 +455,8 @@ declare class AutomaticPrefetchPlugin {
450
455
  }
451
456
  type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
452
457
  declare interface BackendApi {
453
- dispose: (arg0?: Error) => void;
454
- module: (arg0: Module) => { client: string; data: string; active: boolean };
458
+ dispose: (arg0: (arg0?: null | Error) => void) => void;
459
+ module: (arg0: Module) => ModuleResult;
455
460
  }
456
461
  declare class BannerPlugin {
457
462
  constructor(options: BannerPluginArgument);
@@ -576,6 +581,7 @@ declare abstract class BasicEvaluatedExpression {
576
581
  | ThisExpression
577
582
  | UpdateExpression
578
583
  | YieldExpression
584
+ | SpreadElement
579
585
  | FunctionDeclaration
580
586
  | VariableDeclaration
581
587
  | ClassDeclaration
@@ -613,7 +619,6 @@ declare abstract class BasicEvaluatedExpression {
613
619
  | ArrayPattern
614
620
  | RestElement
615
621
  | AssignmentPattern
616
- | SpreadElement
617
622
  | Property
618
623
  | AssignmentProperty
619
624
  | ClassBody
@@ -799,6 +804,7 @@ declare abstract class BasicEvaluatedExpression {
799
804
  | ThisExpression
800
805
  | UpdateExpression
801
806
  | YieldExpression
807
+ | SpreadElement
802
808
  | FunctionDeclaration
803
809
  | VariableDeclaration
804
810
  | ClassDeclaration
@@ -836,7 +842,6 @@ declare abstract class BasicEvaluatedExpression {
836
842
  | ArrayPattern
837
843
  | RestElement
838
844
  | AssignmentPattern
839
- | SpreadElement
840
845
  | Property
841
846
  | AssignmentProperty
842
847
  | ClassBody
@@ -848,6 +853,13 @@ declare abstract class BasicEvaluatedExpression {
848
853
  | TemplateElement
849
854
  ): BasicEvaluatedExpression;
850
855
  }
856
+ declare interface Bootstrap {
857
+ header: string[];
858
+ beforeStartup: string[];
859
+ startup: string[];
860
+ afterStartup: string[];
861
+ allowInlineStartup: boolean;
862
+ }
851
863
  type BufferEncoding =
852
864
  | "ascii"
853
865
  | "utf8"
@@ -996,7 +1008,7 @@ declare interface CallExpressionInfo {
996
1008
  getMemberRanges: () => [number, number][];
997
1009
  }
998
1010
  declare interface CallbackAsyncQueue<T> {
999
- (err?: null | WebpackError, result?: T): any;
1011
+ (err?: null | WebpackError, result?: null | T): any;
1000
1012
  }
1001
1013
  declare interface CallbackCacheCache<T> {
1002
1014
  (err: null | WebpackError, result?: T): void;
@@ -1183,7 +1195,7 @@ declare class ChunkGraph {
1183
1195
  connectChunkAndEntryModule(
1184
1196
  chunk: Chunk,
1185
1197
  module: Module,
1186
- entrypoint?: Entrypoint
1198
+ entrypoint: Entrypoint
1187
1199
  ): void;
1188
1200
  connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
1189
1201
  addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
@@ -1217,7 +1229,7 @@ declare class ChunkGraph {
1217
1229
  chunkGroup: ChunkGroup
1218
1230
  ): void;
1219
1231
  disconnectChunkGroup(chunkGroup: ChunkGroup): void;
1220
- getModuleId(module: Module): ModuleId;
1232
+ getModuleId(module: Module): null | string | number;
1221
1233
  setModuleId(module: Module, id: ModuleId): void;
1222
1234
  getRuntimeId(runtime: string): string | number;
1223
1235
  setRuntimeId(runtime: string, id: string | number): void;
@@ -1332,7 +1344,11 @@ declare abstract class ChunkGroup {
1332
1344
  hasBlock(block: AsyncDependenciesBlock): boolean;
1333
1345
  get blocksIterable(): Iterable<AsyncDependenciesBlock>;
1334
1346
  addBlock(block: AsyncDependenciesBlock): boolean;
1335
- addOrigin(module: Module, loc: DependencyLocation, request: string): void;
1347
+ addOrigin(
1348
+ module: null | Module,
1349
+ loc: DependencyLocation,
1350
+ request: string
1351
+ ): void;
1336
1352
  getFiles(): string[];
1337
1353
  remove(): void;
1338
1354
  sortItems(): void;
@@ -1483,7 +1499,7 @@ declare interface ChunkRenderContext {
1483
1499
  /**
1484
1500
  * rendering in strict context
1485
1501
  */
1486
- strictMode: boolean;
1502
+ strictMode?: boolean;
1487
1503
  }
1488
1504
  declare interface ChunkSizeOptions {
1489
1505
  /**
@@ -1498,12 +1514,57 @@ declare interface ChunkSizeOptions {
1498
1514
  }
1499
1515
  declare abstract class ChunkTemplate {
1500
1516
  hooks: Readonly<{
1501
- renderManifest: { tap: (options?: any, fn?: any) => void };
1502
- modules: { tap: (options?: any, fn?: any) => void };
1503
- render: { tap: (options?: any, fn?: any) => void };
1504
- renderWithEntry: { tap: (options?: any, fn?: any) => void };
1505
- hash: { tap: (options?: any, fn?: any) => void };
1506
- hashForChunk: { tap: (options?: any, fn?: any) => void };
1517
+ renderManifest: {
1518
+ tap: <AdditionalOptions>(
1519
+ options:
1520
+ | string
1521
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1522
+ fn: (
1523
+ arg0: RenderManifestEntry[],
1524
+ arg1: RenderManifestOptions
1525
+ ) => RenderManifestEntry[]
1526
+ ) => void;
1527
+ };
1528
+ modules: {
1529
+ tap: <AdditionalOptions>(
1530
+ options:
1531
+ | string
1532
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1533
+ fn: (arg0: Source, arg1: ModuleTemplate, arg2: RenderContext) => Source
1534
+ ) => void;
1535
+ };
1536
+ render: {
1537
+ tap: <AdditionalOptions>(
1538
+ options:
1539
+ | string
1540
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1541
+ fn: (arg0: Source, arg1: ModuleTemplate, arg2: RenderContext) => Source
1542
+ ) => void;
1543
+ };
1544
+ renderWithEntry: {
1545
+ tap: <AdditionalOptions>(
1546
+ options:
1547
+ | string
1548
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1549
+ fn: (arg0: Source, arg1: Chunk) => Source
1550
+ ) => void;
1551
+ };
1552
+ hash: {
1553
+ tap: <AdditionalOptions>(
1554
+ options:
1555
+ | string
1556
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1557
+ fn: (arg0: Hash) => void
1558
+ ) => void;
1559
+ };
1560
+ hashForChunk: {
1561
+ tap: <AdditionalOptions>(
1562
+ options:
1563
+ | string
1564
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1565
+ fn: (arg0: Hash, arg1: Chunk, arg2: ChunkHashContext) => void
1566
+ ) => void;
1567
+ };
1507
1568
  }>;
1508
1569
  get outputOptions(): Output;
1509
1570
  }
@@ -1609,7 +1670,7 @@ declare interface CodeGenerationResult {
1609
1670
  /**
1610
1671
  * the runtime requirements
1611
1672
  */
1612
- runtimeRequirements: ReadonlySet<string>;
1673
+ runtimeRequirements: null | ReadonlySet<string>;
1613
1674
 
1614
1675
  /**
1615
1676
  * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
@@ -1711,10 +1772,10 @@ declare class Compilation {
1711
1772
  * inspect, analyze, and/or modify the chunk graph.
1712
1773
  */
1713
1774
  afterChunks: SyncHook<[Iterable<Chunk>]>;
1714
- optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
1775
+ optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
1715
1776
  afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
1716
1777
  optimize: SyncHook<[]>;
1717
- optimizeModules: SyncBailHook<[Iterable<Module>], any>;
1778
+ optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
1718
1779
  afterOptimizeModules: SyncHook<[Iterable<Module>]>;
1719
1780
  optimizeChunks: SyncBailHook<
1720
1781
  [Iterable<Chunk>, ChunkGroup[]],
@@ -1739,13 +1800,13 @@ declare class Compilation {
1739
1800
  [Module, Set<string>, RuntimeRequirementsContext]
1740
1801
  >;
1741
1802
  runtimeRequirementInModule: HookMap<
1742
- SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
1803
+ SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
1743
1804
  >;
1744
1805
  additionalTreeRuntimeRequirements: SyncHook<
1745
1806
  [Chunk, Set<string>, RuntimeRequirementsContext]
1746
1807
  >;
1747
1808
  runtimeRequirementInTree: HookMap<
1748
- SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
1809
+ SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
1749
1810
  >;
1750
1811
  runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
1751
1812
  reviveModules: SyncHook<[Iterable<Module>, any]>;
@@ -1830,7 +1891,9 @@ declare class Compilation {
1830
1891
  >;
1831
1892
  statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
1832
1893
  statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
1833
- get normalModuleLoader(): SyncHook<[object, NormalModule]>;
1894
+ get normalModuleLoader(): SyncHook<
1895
+ [LoaderContextNormalModule<any>, NormalModule]
1896
+ >;
1834
1897
  }>;
1835
1898
  name?: string;
1836
1899
  startTime?: number;
@@ -1839,7 +1902,7 @@ declare class Compilation {
1839
1902
  resolverFactory: ResolverFactory;
1840
1903
  inputFileSystem: InputFileSystem;
1841
1904
  fileSystemInfo: FileSystemInfo;
1842
- valueCacheVersions: Map<string, string | Set<string>>;
1905
+ valueCacheVersions: Map<string, ValueCacheVersion>;
1843
1906
  requestShortener: RequestShortener;
1844
1907
  compilerPath: string;
1845
1908
  logger: WebpackLogger;
@@ -1892,7 +1955,7 @@ declare class Compilation {
1892
1955
  logging: Map<string, LogEntry[]>;
1893
1956
  dependencyFactories: Map<DepConstructor, ModuleFactory>;
1894
1957
  dependencyTemplates: DependencyTemplates;
1895
- childrenCounters: object;
1958
+ childrenCounters: Record<string, number>;
1896
1959
  usedChunkIds: Set<string | number>;
1897
1960
  usedModuleIds: Set<number>;
1898
1961
  needAdditionalPass: boolean;
@@ -1917,7 +1980,7 @@ declare class Compilation {
1917
1980
  getLogger(name: string | (() => string)): WebpackLogger;
1918
1981
  addModule(
1919
1982
  module: Module,
1920
- callback: (err?: null | WebpackError, result?: Module) => void
1983
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1921
1984
  ): void;
1922
1985
 
1923
1986
  /**
@@ -1935,21 +1998,21 @@ declare class Compilation {
1935
1998
  */
1936
1999
  buildModule(
1937
2000
  module: Module,
1938
- callback: (err?: null | WebpackError, result?: Module) => void
2001
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1939
2002
  ): void;
1940
2003
  processModuleDependencies(
1941
2004
  module: Module,
1942
- callback: (err?: null | WebpackError, result?: Module) => void
2005
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1943
2006
  ): void;
1944
2007
  processModuleDependenciesNonRecursive(module: Module): void;
1945
2008
  handleModuleCreation(
1946
2009
  __0: HandleModuleCreationOptions,
1947
- callback: (err?: null | WebpackError, result?: Module) => void
2010
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1948
2011
  ): void;
1949
2012
  addModuleChain(
1950
2013
  context: string,
1951
2014
  dependency: Dependency,
1952
- callback: (err?: null | WebpackError, result?: Module) => void
2015
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1953
2016
  ): void;
1954
2017
  addModuleTree(
1955
2018
  __0: {
@@ -1966,23 +2029,23 @@ declare class Compilation {
1966
2029
  */
1967
2030
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
1968
2031
  },
1969
- callback: (err?: null | WebpackError, result?: Module) => void
2032
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1970
2033
  ): void;
1971
2034
  addEntry(
1972
2035
  context: string,
1973
2036
  entry: Dependency,
1974
2037
  optionsOrName: string | EntryOptions,
1975
- callback: (err?: null | WebpackError, result?: Module) => void
2038
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1976
2039
  ): void;
1977
2040
  addInclude(
1978
2041
  context: string,
1979
2042
  dependency: Dependency,
1980
2043
  options: EntryOptions,
1981
- callback: (err?: null | WebpackError, result?: Module) => void
2044
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1982
2045
  ): void;
1983
2046
  rebuildModule(
1984
2047
  module: Module,
1985
- callback: (err?: null | WebpackError, result?: Module) => void
2048
+ callback: (err?: null | WebpackError, result?: null | Module) => void
1986
2049
  ): void;
1987
2050
  finish(callback: (err?: null | WebpackError) => void): void;
1988
2051
  unseal(): void;
@@ -2079,22 +2142,16 @@ declare class Compilation {
2079
2142
  createModuleAssets(): void;
2080
2143
  getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
2081
2144
  createChunkAssets(callback: (err?: null | WebpackError) => void): void;
2082
- getPath(
2083
- filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
2084
- data?: PathData
2085
- ): string;
2145
+ getPath(filename: TemplatePath, data?: PathData): string;
2086
2146
  getPathWithInfo(
2087
- filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
2147
+ filename: TemplatePath,
2088
2148
  data?: PathData
2089
- ): { path: string; info: AssetInfo };
2090
- getAssetPath(
2091
- filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
2092
- data: PathData
2093
- ): string;
2149
+ ): InterpolatedPathAndAssetInfo;
2150
+ getAssetPath(filename: TemplatePath, data: PathData): string;
2094
2151
  getAssetPathWithInfo(
2095
- filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
2152
+ filename: TemplatePath,
2096
2153
  data: PathData
2097
- ): { path: string; info: AssetInfo };
2154
+ ): InterpolatedPathAndAssetInfo;
2098
2155
  getWarnings(): WebpackError[];
2099
2156
  getErrors(): WebpackError[];
2100
2157
 
@@ -2114,13 +2171,13 @@ declare class Compilation {
2114
2171
  executeModule(
2115
2172
  module: Module,
2116
2173
  options: ExecuteModuleOptions,
2117
- callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
2174
+ callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
2118
2175
  ): void;
2119
2176
  checkConstraints(): void;
2120
2177
  factorizeModule: {
2121
2178
  (
2122
2179
  options: FactorizeModuleOptions & { factoryResult?: false },
2123
- callback: (err?: null | WebpackError, result?: Module) => void
2180
+ callback: (err?: null | WebpackError, result?: null | Module) => void
2124
2181
  ): void;
2125
2182
  (
2126
2183
  options: FactorizeModuleOptions & { factoryResult: true },
@@ -2277,7 +2334,7 @@ declare class Compiler {
2277
2334
  invalid: SyncHook<[null | string, number]>;
2278
2335
  watchClose: SyncHook<[]>;
2279
2336
  shutdown: AsyncSeriesHook<[]>;
2280
- infrastructureLog: SyncBailHook<[string, string, any[]], true>;
2337
+ infrastructureLog: SyncBailHook<[string, string, undefined | any[]], true>;
2281
2338
  environment: SyncHook<[]>;
2282
2339
  afterEnvironment: SyncHook<[]>;
2283
2340
  afterPlugins: SyncHook<[Compiler]>;
@@ -2309,7 +2366,11 @@ declare class Compiler {
2309
2366
  >;
2310
2367
  fsStartTime?: number;
2311
2368
  resolverFactory: ResolverFactory;
2312
- infrastructureLogger?: (arg0: string, arg1: LogTypeEnum, arg2: any[]) => void;
2369
+ infrastructureLogger?: (
2370
+ arg0: string,
2371
+ arg1: LogTypeEnum,
2372
+ arg2?: any[]
2373
+ ) => void;
2313
2374
  platform: Readonly<PlatformTargetProperties>;
2314
2375
  options: WebpackOptionsNormalized;
2315
2376
  context: string;
@@ -2515,6 +2576,7 @@ declare interface Configuration {
2515
2576
  | "jsonp"
2516
2577
  | "system"
2517
2578
  | "promise"
2579
+ | "module-import"
2518
2580
  | "script"
2519
2581
  | "node-commonjs";
2520
2582
 
@@ -2768,9 +2830,7 @@ declare interface ConsumesConfig {
2768
2830
  declare interface ConsumesObject {
2769
2831
  [index: string]: string | ConsumesConfig;
2770
2832
  }
2771
- type ContainerOptionsFormat<T> =
2772
- | Record<string, string | string[] | T>
2773
- | (string | Record<string, string | string[] | T>)[];
2833
+ type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
2774
2834
  declare class ContainerPlugin {
2775
2835
  constructor(options: ContainerPluginOptions);
2776
2836
 
@@ -2834,8 +2894,12 @@ declare interface ContainerReferencePluginOptions {
2834
2894
  */
2835
2895
  shareScope?: string;
2836
2896
  }
2897
+ declare interface ContextAlternativeRequest {
2898
+ context: string;
2899
+ request: string;
2900
+ }
2837
2901
  declare abstract class ContextElementDependency extends ModuleDependency {
2838
- referencedExports?: string[][];
2902
+ referencedExports?: null | string[][];
2839
2903
  }
2840
2904
  declare class ContextExclusionPlugin {
2841
2905
  constructor(negativeMatcher: RegExp);
@@ -2871,12 +2935,12 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
2871
2935
  contextModuleFiles: SyncWaterfallHook<[string[]]>;
2872
2936
  alternatives: FakeHook<
2873
2937
  Pick<
2874
- AsyncSeriesWaterfallHook<[any[]]>,
2938
+ AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
2875
2939
  "name" | "tap" | "tapAsync" | "tapPromise"
2876
2940
  >
2877
2941
  >;
2878
2942
  alternativeRequests: AsyncSeriesWaterfallHook<
2879
- [any[], ContextModuleOptions]
2943
+ [ContextAlternativeRequest[], ContextModuleOptions]
2880
2944
  >;
2881
2945
  }>;
2882
2946
  resolverFactory: ResolverFactory;
@@ -2884,7 +2948,7 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
2884
2948
  fs: InputFileSystem,
2885
2949
  options: ContextModuleOptions,
2886
2950
  callback: (
2887
- err?: null | Error,
2951
+ err: null | Error,
2888
2952
  dependencies?: ContextElementDependency[]
2889
2953
  ) => any
2890
2954
  ): void;
@@ -2919,14 +2983,14 @@ declare class ContextReplacementPlugin {
2919
2983
  resourceRegExp: RegExp,
2920
2984
  newContentResource?: any,
2921
2985
  newContentRecursive?: any,
2922
- newContentRegExp?: any
2986
+ newContentRegExp?: RegExp
2923
2987
  );
2924
2988
  resourceRegExp: RegExp;
2925
2989
  newContentCallback: any;
2926
2990
  newContentResource: any;
2927
2991
  newContentCreateContextMap: any;
2928
2992
  newContentRecursive: any;
2929
- newContentRegExp: any;
2993
+ newContentRegExp?: RegExp;
2930
2994
 
2931
2995
  /**
2932
2996
  * Apply the plugin
@@ -2940,8 +3004,8 @@ declare interface ContextTimestampAndHash {
2940
3004
  resolved?: ResolvedContextTimestampAndHash;
2941
3005
  symlinks?: Set<string>;
2942
3006
  }
2943
- type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
2944
- Record<string, any>;
3007
+ type CreateStatsOptionsContext = Record<string, any> &
3008
+ KnownCreateStatsOptionsContext;
2945
3009
  type CreateWriteStreamFSImplementation = FSImplementation & {
2946
3010
  write: (...args: any[]) => any;
2947
3011
  close?: (...args: any[]) => any;
@@ -3115,14 +3179,14 @@ declare class DefinePlugin {
3115
3179
  fn: (arg0: {
3116
3180
  module: NormalModule;
3117
3181
  key: string;
3118
- readonly version?: string;
3182
+ readonly version: ValueCacheVersion;
3119
3183
  }) => CodeValuePrimitive,
3120
3184
  options?: true | string[] | RuntimeValueOptions
3121
3185
  ): RuntimeValue;
3122
3186
  }
3123
3187
  declare class DelegatedPlugin {
3124
- constructor(options?: any);
3125
- options: any;
3188
+ constructor(options: Options);
3189
+ options: Options;
3126
3190
 
3127
3191
  /**
3128
3192
  * Apply the plugin
@@ -3619,6 +3683,9 @@ declare interface Effect {
3619
3683
  type: string;
3620
3684
  value: any;
3621
3685
  }
3686
+ declare interface EffectData {
3687
+ [index: string]: any;
3688
+ }
3622
3689
  declare class ElectronTargetPlugin {
3623
3690
  constructor(context?: "main" | "preload" | "renderer");
3624
3691
 
@@ -3859,8 +3926,7 @@ type EntryOptions = { name?: string } & Omit<
3859
3926
  >;
3860
3927
  declare class EntryPlugin {
3861
3928
  /**
3862
- * An entry plugin which will handle
3863
- * creation of the EntryDependency
3929
+ * An entry plugin which will handle creation of the EntryDependency
3864
3930
  */
3865
3931
  constructor(context: string, entry: string, options?: string | EntryOptions);
3866
3932
  context: string;
@@ -3982,9 +4048,9 @@ declare interface Environment {
3982
4048
  templateLiteral?: boolean;
3983
4049
  }
3984
4050
  declare class EnvironmentPlugin {
3985
- constructor(...keys: any[]);
3986
- keys: any[];
3987
- defaultValues: any;
4051
+ constructor(...keys: (string | string[] | Record<string, any>)[]);
4052
+ keys: string[];
4053
+ defaultValues: Record<string, any>;
3988
4054
 
3989
4055
  /**
3990
4056
  * Apply the plugin
@@ -4190,7 +4256,7 @@ declare abstract class ExportInfo {
4190
4256
  setTarget(
4191
4257
  key: any,
4192
4258
  connection: ModuleGraphConnection,
4193
- exportName?: string[],
4259
+ exportName?: null | string[],
4194
4260
  priority?: number
4195
4261
  ): boolean;
4196
4262
  getUsed(runtime: RuntimeSpec): UsageStateType;
@@ -4210,42 +4276,30 @@ declare abstract class ExportInfo {
4210
4276
  setUsedName(name: string): void;
4211
4277
  getTerminalBinding(
4212
4278
  moduleGraph: ModuleGraph,
4213
- resolveTargetFilter?: (arg0: {
4214
- module: Module;
4215
- export?: string[];
4216
- }) => boolean
4279
+ resolveTargetFilter?: (arg0: TargetItem) => boolean
4217
4280
  ): undefined | ExportsInfo | ExportInfo;
4218
4281
  isReexport(): undefined | boolean;
4219
4282
  findTarget(
4220
4283
  moduleGraph: ModuleGraph,
4221
4284
  validTargetModuleFilter: (arg0: Module) => boolean
4222
- ): undefined | false | { module: Module; export?: string[] };
4285
+ ): undefined | null | false | TargetItemWithoutConnection;
4223
4286
  getTarget(
4224
4287
  moduleGraph: ModuleGraph,
4225
- resolveTargetFilter?: (arg0: {
4226
- module: Module;
4227
- export?: string[];
4228
- }) => boolean
4229
- ): undefined | { module: Module; export?: string[] };
4288
+ resolveTargetFilter?: (arg0: TargetItem) => boolean
4289
+ ): undefined | TargetItem;
4230
4290
 
4231
4291
  /**
4232
4292
  * Move the target forward as long resolveTargetFilter is fulfilled
4233
4293
  */
4234
4294
  moveTarget(
4235
4295
  moduleGraph: ModuleGraph,
4236
- resolveTargetFilter: (arg0: {
4237
- module: Module;
4238
- export?: string[];
4239
- }) => boolean,
4240
- updateOriginalConnection?: (arg0: {
4241
- module: Module;
4242
- export?: string[];
4243
- }) => ModuleGraphConnection
4244
- ): undefined | { module: Module; export?: string[] };
4245
- createNestedExportsInfo(): undefined | ExportsInfo;
4296
+ resolveTargetFilter: (arg0: TargetItem) => boolean,
4297
+ updateOriginalConnection?: (arg0: TargetItem) => ModuleGraphConnection
4298
+ ): undefined | TargetItem;
4299
+ createNestedExportsInfo(): ExportsInfo;
4246
4300
  getNestedExportsInfo(): undefined | ExportsInfo;
4247
- hasInfo(baseInfo?: any, runtime?: any): boolean;
4248
- updateHash(hash?: any, runtime?: any): void;
4301
+ hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
4302
+ updateHash(hash: Hash, runtime: RuntimeSpec): void;
4249
4303
  getUsedInfo(): string;
4250
4304
  getProvidedInfo():
4251
4305
  | "no provided info"
@@ -4330,12 +4384,9 @@ declare abstract class ExportsInfo {
4330
4384
  getUsageKey(runtime: RuntimeSpec): string;
4331
4385
  isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
4332
4386
  getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
4333
- getUsedName(
4334
- name: undefined | string | string[],
4335
- runtime: RuntimeSpec
4336
- ): string | false | string[];
4387
+ getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
4337
4388
  updateHash(hash: Hash, runtime: RuntimeSpec): void;
4338
- getRestoreProvidedData(): any;
4389
+ getRestoreProvidedData(): RestoreProvidedData;
4339
4390
  restoreProvided(__0: {
4340
4391
  otherProvided: any;
4341
4392
  otherCanMangleProvide: any;
@@ -4357,7 +4408,7 @@ declare interface ExportsSpec {
4357
4408
  /**
4358
4409
  * list of maybe prior exposed, but now hidden exports
4359
4410
  */
4360
- hideExports?: Set<string>;
4411
+ hideExports?: null | Set<string>;
4361
4412
 
4362
4413
  /**
4363
4414
  * when reexported: from which module
@@ -4632,6 +4683,7 @@ type ExternalsType =
4632
4683
  | "jsonp"
4633
4684
  | "system"
4634
4685
  | "promise"
4686
+ | "module-import"
4635
4687
  | "script"
4636
4688
  | "node-commonjs";
4637
4689
  declare interface FSImplementation {
@@ -4809,16 +4861,12 @@ declare interface FileSystem {
4809
4861
  declare abstract class FileSystemInfo {
4810
4862
  fs: InputFileSystem;
4811
4863
  logger?: WebpackLogger;
4812
- fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
4813
- fileHashQueue: AsyncQueue<string, string, null | string>;
4814
- contextTimestampQueue: AsyncQueue<
4815
- string,
4816
- string,
4817
- null | ContextFileSystemInfoEntry
4818
- >;
4819
- contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
4820
- contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
4821
- managedItemQueue: AsyncQueue<string, string, null | string>;
4864
+ fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
4865
+ fileHashQueue: AsyncQueue<string, string, string>;
4866
+ contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
4867
+ contextHashQueue: AsyncQueue<string, string, ContextHash>;
4868
+ contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
4869
+ managedItemQueue: AsyncQueue<string, string, string>;
4822
4870
  managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
4823
4871
  unmanagedPathsWithSlash: string[];
4824
4872
  unmanagedPathsRegExps: RegExp[];
@@ -4864,7 +4912,7 @@ declare abstract class FileSystemInfo {
4864
4912
  path: string,
4865
4913
  callback: (
4866
4914
  arg0?: null | WebpackError,
4867
- arg1?: ResolvedContextTimestampAndHash
4915
+ arg1?: null | ResolvedContextTimestampAndHash
4868
4916
  ) => void
4869
4917
  ): void;
4870
4918
  resolveBuildDependencies(
@@ -4885,7 +4933,7 @@ declare abstract class FileSystemInfo {
4885
4933
  directories: null | Iterable<string>,
4886
4934
  missing: null | Iterable<string>,
4887
4935
  options: undefined | null | SnapshotOptionsFileSystemInfo,
4888
- callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
4936
+ callback: (arg0: null | WebpackError, arg1: null | Snapshot) => void
4889
4937
  ): void;
4890
4938
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
4891
4939
  checkSnapshotValid(
@@ -4900,6 +4948,9 @@ declare interface FileSystemInfoEntry {
4900
4948
  timestamp?: number;
4901
4949
  }
4902
4950
  type FilterItemTypes = string | RegExp | ((value: string) => boolean);
4951
+ declare interface Flags {
4952
+ [index: string]: Argument;
4953
+ }
4903
4954
  declare interface GenerateContext {
4904
4955
  /**
4905
4956
  * mapping from dependencies to templates
@@ -5040,16 +5091,12 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
5040
5091
  contentType: string,
5041
5092
  name: string,
5042
5093
  global: string,
5043
- getFilenameForChunk: (
5044
- arg0: Chunk
5045
- ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
5094
+ getFilenameForChunk: (arg0: Chunk) => TemplatePath,
5046
5095
  allChunks: boolean
5047
5096
  );
5048
5097
  contentType: string;
5049
5098
  global: string;
5050
- getFilenameForChunk: (
5051
- arg0: Chunk
5052
- ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
5099
+ getFilenameForChunk: (arg0: Chunk) => TemplatePath;
5053
5100
  allChunks: boolean;
5054
5101
 
5055
5102
  /**
@@ -5073,7 +5120,7 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
5073
5120
  static STAGE_TRIGGER: number;
5074
5121
  }
5075
5122
  declare interface GroupConfig {
5076
- getKeys: (arg0?: any) => string[];
5123
+ getKeys: (arg0?: any) => undefined | string[];
5077
5124
  createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
5078
5125
  getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
5079
5126
  }
@@ -5157,6 +5204,7 @@ declare class Hash {
5157
5204
  */
5158
5205
  digest(encoding?: string): string | Buffer;
5159
5206
  }
5207
+ type HashFunction = string | typeof Hash;
5160
5208
  declare interface HashableObject {
5161
5209
  updateHash: (arg0: Hash) => void;
5162
5210
  }
@@ -5319,8 +5367,7 @@ declare class IgnorePlugin {
5319
5367
  options: IgnorePluginOptions;
5320
5368
 
5321
5369
  /**
5322
- * Note that if "contextRegExp" is given, both the "resourceRegExp"
5323
- * and "contextRegExp" have to match.
5370
+ * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
5324
5371
  */
5325
5372
  checkIgnore(resolveData: ResolveData): undefined | false;
5326
5373
 
@@ -5349,6 +5396,7 @@ type IgnorePluginOptions =
5349
5396
  type ImportAttributes = Record<string, string> & {};
5350
5397
  declare interface ImportDependencyMeta {
5351
5398
  attributes?: ImportAttributes;
5399
+ externalType?: "import" | "module";
5352
5400
  }
5353
5401
  declare interface ImportModuleOptions {
5354
5402
  /**
@@ -5505,6 +5553,13 @@ declare interface IntermediateFileSystemExtras {
5505
5553
  ) => void;
5506
5554
  }
5507
5555
  type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
5556
+ declare interface InterpolatedPathAndAssetInfo {
5557
+ path: string;
5558
+ info: AssetInfo;
5559
+ }
5560
+ declare interface Item<T> {
5561
+ [index: string]: string | string[] | T;
5562
+ }
5508
5563
  declare abstract class ItemCacheFacade {
5509
5564
  get<T>(callback: CallbackCacheCacheFacade<T>): void;
5510
5565
  getPromise<T>(): Promise<T>;
@@ -5529,7 +5584,7 @@ declare class JavascriptModulesPlugin {
5529
5584
  renderContext: ChunkRenderContext,
5530
5585
  hooks: CompilationHooksJavascriptModulesPlugin,
5531
5586
  factory: boolean
5532
- ): Source;
5587
+ ): null | Source;
5533
5588
  renderChunk(
5534
5589
  renderContext: RenderContext,
5535
5590
  hooks: CompilationHooksJavascriptModulesPlugin
@@ -5547,24 +5602,20 @@ declare class JavascriptModulesPlugin {
5547
5602
  renderBootstrap(
5548
5603
  renderContext: RenderBootstrapContext,
5549
5604
  hooks: CompilationHooksJavascriptModulesPlugin
5550
- ): {
5551
- header: string[];
5552
- beforeStartup: string[];
5553
- startup: string[];
5554
- afterStartup: string[];
5555
- allowInlineStartup: boolean;
5556
- };
5605
+ ): Bootstrap;
5557
5606
  renderRequire(
5558
5607
  renderContext: RenderBootstrapContext,
5559
5608
  hooks: CompilationHooksJavascriptModulesPlugin
5560
5609
  ): string;
5561
- renameInlineModule(
5610
+ getRenamedInlineModule(
5562
5611
  allModules: Module[],
5563
5612
  renderContext: MainRenderContext,
5564
5613
  inlinedModules: Set<Module>,
5565
5614
  chunkRenderContext: ChunkRenderContext,
5566
- hooks: CompilationHooksJavascriptModulesPlugin
5567
- ): Map<Module, Source>;
5615
+ hooks: CompilationHooksJavascriptModulesPlugin,
5616
+ allStrict: boolean,
5617
+ hasChunkModules: boolean
5618
+ ): false | Map<Module, Source>;
5568
5619
  findNewName(
5569
5620
  oldName: string,
5570
5621
  usedName: Set<string>,
@@ -5573,7 +5624,10 @@ declare class JavascriptModulesPlugin {
5573
5624
  static getCompilationHooks(
5574
5625
  compilation: Compilation
5575
5626
  ): CompilationHooksJavascriptModulesPlugin;
5576
- static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
5627
+ static getChunkFilenameTemplate(
5628
+ chunk: Chunk,
5629
+ outputOptions: Output
5630
+ ): TemplatePath;
5577
5631
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
5578
5632
  }
5579
5633
  declare class JavascriptParser extends Parser {
@@ -5586,7 +5640,39 @@ declare class JavascriptParser extends Parser {
5586
5640
  >
5587
5641
  >;
5588
5642
  evaluate: HookMap<
5589
- SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
5643
+ SyncBailHook<
5644
+ [
5645
+ | UnaryExpression
5646
+ | ArrayExpression
5647
+ | ArrowFunctionExpression
5648
+ | AssignmentExpression
5649
+ | AwaitExpression
5650
+ | BinaryExpression
5651
+ | SimpleCallExpression
5652
+ | NewExpression
5653
+ | ChainExpression
5654
+ | ClassExpression
5655
+ | ConditionalExpression
5656
+ | FunctionExpression
5657
+ | Identifier
5658
+ | ImportExpression
5659
+ | SimpleLiteral
5660
+ | RegExpLiteral
5661
+ | BigIntLiteral
5662
+ | LogicalExpression
5663
+ | MemberExpression
5664
+ | MetaProperty
5665
+ | ObjectExpression
5666
+ | SequenceExpression
5667
+ | TaggedTemplateExpression
5668
+ | TemplateLiteral
5669
+ | ThisExpression
5670
+ | UpdateExpression
5671
+ | YieldExpression
5672
+ | SpreadElement
5673
+ ],
5674
+ undefined | null | BasicEvaluatedExpression
5675
+ >
5590
5676
  >;
5591
5677
  evaluateIdentifier: HookMap<
5592
5678
  SyncBailHook<
@@ -6422,7 +6508,37 @@ declare class JavascriptParser extends Parser {
6422
6508
  enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
6423
6509
  enterRestElement(pattern: RestElement, onIdent?: any): void;
6424
6510
  enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
6425
- evaluateExpression(expression?: any): BasicEvaluatedExpression;
6511
+ evaluateExpression(
6512
+ expression:
6513
+ | UnaryExpression
6514
+ | ArrayExpression
6515
+ | ArrowFunctionExpression
6516
+ | AssignmentExpression
6517
+ | AwaitExpression
6518
+ | BinaryExpression
6519
+ | SimpleCallExpression
6520
+ | NewExpression
6521
+ | ChainExpression
6522
+ | ClassExpression
6523
+ | ConditionalExpression
6524
+ | FunctionExpression
6525
+ | Identifier
6526
+ | ImportExpression
6527
+ | SimpleLiteral
6528
+ | RegExpLiteral
6529
+ | BigIntLiteral
6530
+ | LogicalExpression
6531
+ | MemberExpression
6532
+ | MetaProperty
6533
+ | ObjectExpression
6534
+ | SequenceExpression
6535
+ | TaggedTemplateExpression
6536
+ | TemplateLiteral
6537
+ | ThisExpression
6538
+ | UpdateExpression
6539
+ | YieldExpression
6540
+ | SpreadElement
6541
+ ): BasicEvaluatedExpression;
6426
6542
  parseString(expression: Expression): string;
6427
6543
  parseCalculatedString(expression: Expression): any;
6428
6544
  evaluate(source: string): BasicEvaluatedExpression;
@@ -6465,6 +6581,7 @@ declare class JavascriptParser extends Parser {
6465
6581
  ): boolean;
6466
6582
  getComments(range: [number, number]): Comment[];
6467
6583
  isAsiPosition(pos: number): boolean;
6584
+ setAsiPosition(pos: number): void;
6468
6585
  unsetAsiPosition(pos: number): void;
6469
6586
  isStatementLevelExpression(expr: Expression): boolean;
6470
6587
  getTagData(name: string, tag?: any): any;
@@ -6870,7 +6987,7 @@ declare interface KnownBuildInfo {
6870
6987
  contextDependencies?: LazySet<string>;
6871
6988
  missingDependencies?: LazySet<string>;
6872
6989
  buildDependencies?: LazySet<string>;
6873
- valueDependencies?: Map<string, string | Set<string>>;
6990
+ valueDependencies?: Map<string, ValueCacheVersion>;
6874
6991
  hash?: any;
6875
6992
  assets?: Record<string, Source>;
6876
6993
  assetsInfo?: Map<string, undefined | AssetInfo>;
@@ -6975,14 +7092,14 @@ declare interface KnownStatsChunk {
6975
7092
  recorded: boolean;
6976
7093
  reason?: string;
6977
7094
  size: number;
6978
- sizes?: Record<string, number>;
6979
- names?: string[];
6980
- idHints?: string[];
7095
+ sizes: Record<string, number>;
7096
+ names: string[];
7097
+ idHints: string[];
6981
7098
  runtime?: string[];
6982
- files?: string[];
6983
- auxiliaryFiles?: string[];
7099
+ files: string[];
7100
+ auxiliaryFiles: string[];
6984
7101
  hash: string;
6985
- childrenByOrder?: Record<string, (string | number)[]>;
7102
+ childrenByOrder: Record<string, (string | number)[]>;
6986
7103
  id?: string | number;
6987
7104
  siblings?: (string | number)[];
6988
7105
  parents?: (string | number)[];
@@ -7005,11 +7122,11 @@ declare interface KnownStatsChunkGroup {
7005
7122
  isOverSizeLimit?: boolean;
7006
7123
  }
7007
7124
  declare interface KnownStatsChunkOrigin {
7008
- module?: string;
7009
- moduleIdentifier?: string;
7010
- moduleName?: string;
7011
- loc?: string;
7012
- request?: string;
7125
+ module: string;
7126
+ moduleIdentifier: string;
7127
+ moduleName: string;
7128
+ loc: string;
7129
+ request: string;
7013
7130
  moduleId?: string | number;
7014
7131
  }
7015
7132
  declare interface KnownStatsCompilation {
@@ -7054,14 +7171,14 @@ declare interface KnownStatsError {
7054
7171
  }
7055
7172
  declare interface KnownStatsFactoryContext {
7056
7173
  type: string;
7057
- makePathsRelative?: (arg0: string) => string;
7058
- compilation?: Compilation;
7059
- rootModules?: Set<Module>;
7060
- compilationFileToChunks?: Map<string, Chunk[]>;
7061
- compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
7062
- runtime?: RuntimeSpec;
7063
- cachedGetErrors?: (arg0: Compilation) => WebpackError[];
7064
- cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
7174
+ makePathsRelative: (arg0: string) => string;
7175
+ compilation: Compilation;
7176
+ rootModules: Set<Module>;
7177
+ compilationFileToChunks: Map<string, Chunk[]>;
7178
+ compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
7179
+ runtime: RuntimeSpec;
7180
+ cachedGetErrors: (arg0: Compilation) => WebpackError[];
7181
+ cachedGetWarnings: (arg0: Compilation) => WebpackError[];
7065
7182
  }
7066
7183
  declare interface KnownStatsLogging {
7067
7184
  entries: StatsLoggingEntry[];
@@ -7070,7 +7187,7 @@ declare interface KnownStatsLogging {
7070
7187
  }
7071
7188
  declare interface KnownStatsLoggingEntry {
7072
7189
  type: string;
7073
- message: string;
7190
+ message?: string;
7074
7191
  trace?: string[];
7075
7192
  children?: StatsLoggingEntry[];
7076
7193
  args?: any[];
@@ -7079,10 +7196,10 @@ declare interface KnownStatsLoggingEntry {
7079
7196
  declare interface KnownStatsModule {
7080
7197
  type?: string;
7081
7198
  moduleType?: string;
7082
- layer?: string;
7199
+ layer?: null | string;
7083
7200
  identifier?: string;
7084
7201
  name?: string;
7085
- nameForCondition?: string;
7202
+ nameForCondition?: null | string;
7086
7203
  index?: number;
7087
7204
  preOrderIndex?: number;
7088
7205
  index2?: number;
@@ -7097,45 +7214,45 @@ declare interface KnownStatsModule {
7097
7214
  optional?: boolean;
7098
7215
  orphan?: boolean;
7099
7216
  id?: string | number;
7100
- issuerId?: string | number;
7217
+ issuerId?: null | string | number;
7101
7218
  chunks?: (string | number)[];
7102
7219
  assets?: (string | number)[];
7103
7220
  dependent?: boolean;
7104
- issuer?: string;
7105
- issuerName?: string;
7221
+ issuer?: null | string;
7222
+ issuerName?: null | string;
7106
7223
  issuerPath?: StatsModuleIssuer[];
7107
7224
  failed?: boolean;
7108
7225
  errors?: number;
7109
7226
  warnings?: number;
7110
7227
  profile?: StatsProfile;
7111
7228
  reasons?: StatsModuleReason[];
7112
- usedExports?: boolean | string[];
7113
- providedExports?: string[];
7229
+ usedExports?: null | boolean | string[];
7230
+ providedExports?: null | string[];
7114
7231
  optimizationBailout?: string[];
7115
- depth?: number;
7232
+ depth?: null | number;
7116
7233
  modules?: StatsModule[];
7117
7234
  filteredModules?: number;
7118
7235
  source?: string | Buffer;
7119
7236
  }
7120
7237
  declare interface KnownStatsModuleIssuer {
7121
- identifier?: string;
7122
- name?: string;
7238
+ identifier: string;
7239
+ name: string;
7123
7240
  id?: string | number;
7124
- profile?: StatsProfile;
7241
+ profile: StatsProfile;
7125
7242
  }
7126
7243
  declare interface KnownStatsModuleReason {
7127
- moduleIdentifier?: string;
7128
- module?: string;
7129
- moduleName?: string;
7130
- resolvedModuleIdentifier?: string;
7131
- resolvedModule?: string;
7132
- type?: string;
7244
+ moduleIdentifier: null | string;
7245
+ module: null | string;
7246
+ moduleName: null | string;
7247
+ resolvedModuleIdentifier: null | string;
7248
+ resolvedModule: null | string;
7249
+ type: null | string;
7133
7250
  active: boolean;
7134
- explanation?: string;
7135
- userRequest?: string;
7136
- loc?: string;
7137
- moduleId?: string | number;
7138
- resolvedModuleId?: string | number;
7251
+ explanation: null | string;
7252
+ userRequest: null | string;
7253
+ loc?: null | string;
7254
+ moduleId?: null | string | number;
7255
+ resolvedModuleId?: null | string | number;
7139
7256
  }
7140
7257
  declare interface KnownStatsModuleTraceDependency {
7141
7258
  loc?: string;
@@ -7149,20 +7266,31 @@ declare interface KnownStatsModuleTraceItem {
7149
7266
  originId?: string | number;
7150
7267
  moduleId?: string | number;
7151
7268
  }
7269
+ declare interface KnownStatsPrinterColorFn {
7270
+ bold?: (str: string) => string;
7271
+ yellow?: (str: string) => string;
7272
+ red?: (str: string) => string;
7273
+ green?: (str: string) => string;
7274
+ magenta?: (str: string) => string;
7275
+ cyan?: (str: string) => string;
7276
+ }
7152
7277
  declare interface KnownStatsPrinterContext {
7153
7278
  type?: string;
7154
7279
  compilation?: StatsCompilation;
7155
7280
  chunkGroup?: StatsChunkGroup;
7281
+ chunkGroupKind?: string;
7156
7282
  asset?: StatsAsset;
7157
7283
  module?: StatsModule;
7158
7284
  chunk?: StatsChunk;
7159
7285
  moduleReason?: StatsModuleReason;
7160
- bold?: (str: string) => string;
7161
- yellow?: (str: string) => string;
7162
- red?: (str: string) => string;
7163
- green?: (str: string) => string;
7164
- magenta?: (str: string) => string;
7165
- cyan?: (str: string) => string;
7286
+ moduleIssuer?: StatsModuleIssuer;
7287
+ error?: StatsError;
7288
+ profile?: StatsProfile;
7289
+ logging?: StatsLogging;
7290
+ moduleTraceItem?: StatsModuleTraceItem;
7291
+ moduleTraceDependency?: StatsModuleTraceDependency;
7292
+ }
7293
+ declare interface KnownStatsPrinterFormaters {
7166
7294
  formatFilename?: (file: string, oversize?: boolean) => string;
7167
7295
  formatModuleId?: (id: string) => string;
7168
7296
  formatChunkId?: (
@@ -7170,10 +7298,11 @@ declare interface KnownStatsPrinterContext {
7170
7298
  direction?: "parent" | "child" | "sibling"
7171
7299
  ) => string;
7172
7300
  formatSize?: (size: number) => string;
7301
+ formatLayer?: (size: string) => string;
7173
7302
  formatDateTime?: (dateTime: number) => string;
7174
7303
  formatFlag?: (flag: string) => string;
7175
7304
  formatTime?: (time: number, boldQuantity?: boolean) => string;
7176
- chunkGroupKind?: string;
7305
+ formatError?: (message: string) => string;
7177
7306
  }
7178
7307
  declare interface KnownStatsProfile {
7179
7308
  total: number;
@@ -7550,8 +7679,13 @@ declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
7550
7679
  declare interface Loader {
7551
7680
  [index: string]: any;
7552
7681
  }
7553
- type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
7554
- LoaderRunnerLoaderContext<OptionsType> &
7682
+ type LoaderContextDeclarationsIndex<OptionsType> =
7683
+ NormalModuleLoaderContext<OptionsType> &
7684
+ LoaderRunnerLoaderContext<OptionsType> &
7685
+ LoaderPluginLoaderContext &
7686
+ HotModuleReplacementPluginLoaderContext;
7687
+ type LoaderContextNormalModule<T> = NormalModuleLoaderContext<T> &
7688
+ LoaderRunnerLoaderContext<T> &
7555
7689
  LoaderPluginLoaderContext &
7556
7690
  HotModuleReplacementPluginLoaderContext;
7557
7691
  type LoaderDefinition<
@@ -7637,14 +7771,14 @@ declare interface LoaderPluginLoaderContext {
7637
7771
  request: string,
7638
7772
  callback: (
7639
7773
  err: null | Error,
7640
- source: string,
7641
- sourceMap: any,
7642
- module: NormalModule
7774
+ source?: string | Buffer,
7775
+ sourceMap?: null | object,
7776
+ module?: Module
7643
7777
  ) => void
7644
7778
  ): void;
7645
7779
  importModule(
7646
7780
  request: string,
7647
- options: ImportModuleOptions,
7781
+ options: undefined | ImportModuleOptions,
7648
7782
  callback: (err?: null | Error, exports?: any) => any
7649
7783
  ): void;
7650
7784
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
@@ -7805,7 +7939,7 @@ declare class LoaderTargetPlugin {
7805
7939
  }
7806
7940
  declare interface LogEntry {
7807
7941
  type: string;
7808
- args: any[];
7942
+ args?: any[];
7809
7943
  time: number;
7810
7944
  trace?: string[];
7811
7945
  }
@@ -7865,25 +7999,81 @@ declare interface MainRenderContext {
7865
7999
  /**
7866
8000
  * rendering in strict context
7867
8001
  */
7868
- strictMode: boolean;
8002
+ strictMode?: boolean;
7869
8003
  }
7870
8004
  declare abstract class MainTemplate {
7871
8005
  hooks: Readonly<{
7872
- renderManifest: { tap: (options?: any, fn?: any) => void };
8006
+ renderManifest: {
8007
+ tap: <AdditionalOptions>(
8008
+ options:
8009
+ | string
8010
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8011
+ fn: (
8012
+ arg0: RenderManifestEntry[],
8013
+ arg1: RenderManifestOptions
8014
+ ) => RenderManifestEntry[]
8015
+ ) => void;
8016
+ };
7873
8017
  modules: { tap: () => never };
7874
8018
  moduleObj: { tap: () => never };
7875
- require: { tap: (options?: any, fn?: any) => void };
8019
+ require: {
8020
+ tap: <AdditionalOptions>(
8021
+ options:
8022
+ | string
8023
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8024
+ fn: (arg0: string, arg1: RenderBootstrapContext) => string
8025
+ ) => void;
8026
+ };
7876
8027
  beforeStartup: { tap: () => never };
7877
8028
  startup: { tap: () => never };
7878
8029
  afterStartup: { tap: () => never };
7879
- render: { tap: (options?: any, fn?: any) => void };
7880
- renderWithEntry: { tap: (options?: any, fn?: any) => void };
8030
+ render: {
8031
+ tap: <AdditionalOptions>(
8032
+ options:
8033
+ | string
8034
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8035
+ fn: (
8036
+ arg0: Source,
8037
+ arg1: Chunk,
8038
+ arg2: undefined | string,
8039
+ arg3: ModuleTemplate,
8040
+ arg4: DependencyTemplates
8041
+ ) => Source
8042
+ ) => void;
8043
+ };
8044
+ renderWithEntry: {
8045
+ tap: <AdditionalOptions>(
8046
+ options:
8047
+ | string
8048
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8049
+ fn: (arg0: Source, arg1: Chunk, arg2?: string) => Source
8050
+ ) => void;
8051
+ };
7881
8052
  assetPath: {
7882
- tap: (options?: any, fn?: any) => void;
7883
- call: (filename?: any, options?: any) => string;
8053
+ tap: <AdditionalOptions>(
8054
+ options:
8055
+ | string
8056
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8057
+ fn: (arg0: string, arg1: object, arg2?: AssetInfo) => string
8058
+ ) => void;
8059
+ call: (filename: TemplatePath, options: PathData) => string;
8060
+ };
8061
+ hash: {
8062
+ tap: <AdditionalOptions>(
8063
+ options:
8064
+ | string
8065
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8066
+ fn: (arg0: Hash) => void
8067
+ ) => void;
8068
+ };
8069
+ hashForChunk: {
8070
+ tap: <AdditionalOptions>(
8071
+ options:
8072
+ | string
8073
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8074
+ fn: (arg0: Hash, arg1: Chunk) => void
8075
+ ) => void;
7884
8076
  };
7885
- hash: { tap: (options?: any, fn?: any) => void };
7886
- hashForChunk: { tap: (options?: any, fn?: any) => void };
7887
8077
  globalHashPaths: { tap: () => void };
7888
8078
  globalHash: { tap: () => void };
7889
8079
  hotBootstrap: { tap: () => never };
@@ -7898,12 +8088,12 @@ declare abstract class MainTemplate {
7898
8088
  get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
7899
8089
  }>;
7900
8090
  renderCurrentHashCode: (hash: string, length?: number) => string;
7901
- getPublicPath: (options: object) => string;
7902
- getAssetPath: (path?: any, options?: any) => string;
8091
+ getPublicPath: (options: PathData) => string;
8092
+ getAssetPath: (path: TemplatePath, options: PathData) => string;
7903
8093
  getAssetPathWithInfo: (
7904
- path?: any,
7905
- options?: any
7906
- ) => { path: string; info: AssetInfo };
8094
+ path: TemplatePath,
8095
+ options: PathData
8096
+ ) => InterpolatedPathAndAssetInfo;
7907
8097
  get requireFn(): "__webpack_require__";
7908
8098
  get outputOptions(): Output;
7909
8099
  }
@@ -8033,7 +8223,7 @@ declare class Module extends DependenciesBlock {
8033
8223
  buildInfo?: BuildInfo;
8034
8224
  presentationalDependencies?: Dependency[];
8035
8225
  codeGenerationDependencies?: Dependency[];
8036
- id: ModuleId;
8226
+ id: null | string | number;
8037
8227
  get hash(): string;
8038
8228
  get renderedHash(): string;
8039
8229
  profile?: ModuleProfile;
@@ -8157,8 +8347,7 @@ declare class Module extends DependenciesBlock {
8157
8347
  used: any;
8158
8348
  }
8159
8349
  declare class ModuleConcatenationPlugin {
8160
- constructor(options?: any);
8161
- options: any;
8350
+ constructor();
8162
8351
 
8163
8352
  /**
8164
8353
  * Apply the plugin
@@ -8259,6 +8448,7 @@ declare interface ModuleFederationPluginOptions {
8259
8448
  | "jsonp"
8260
8449
  | "system"
8261
8450
  | "promise"
8451
+ | "module-import"
8262
8452
  | "script"
8263
8453
  | "node-commonjs";
8264
8454
 
@@ -8424,11 +8614,11 @@ declare class ModuleGraphConnection {
8424
8614
  ): void;
8425
8615
  addExplanation(explanation: string): void;
8426
8616
  get explanation(): string;
8427
- active: void;
8428
8617
  isActive(runtime: RuntimeSpec): boolean;
8429
8618
  isTargetActive(runtime: RuntimeSpec): boolean;
8430
8619
  getActiveState(runtime: RuntimeSpec): ConnectionState;
8431
8620
  setActive(value: boolean): void;
8621
+ active: void;
8432
8622
  static addConnectionStates: (
8433
8623
  a: ConnectionState,
8434
8624
  b: ConnectionState
@@ -8641,6 +8831,11 @@ declare interface ModuleReferenceOptions {
8641
8831
  */
8642
8832
  asiSafe?: boolean;
8643
8833
  }
8834
+ declare interface ModuleResult {
8835
+ client: string;
8836
+ data: string;
8837
+ active: boolean;
8838
+ }
8644
8839
  declare interface ModuleSettings {
8645
8840
  /**
8646
8841
  * Specifies the layer in which the module should be placed in.
@@ -8675,13 +8870,68 @@ declare interface ModuleSettings {
8675
8870
  declare abstract class ModuleTemplate {
8676
8871
  type: string;
8677
8872
  hooks: Readonly<{
8678
- content: { tap: (options?: any, fn?: any) => void };
8679
- module: { tap: (options?: any, fn?: any) => void };
8680
- render: { tap: (options?: any, fn?: any) => void };
8681
- package: { tap: (options?: any, fn?: any) => void };
8682
- hash: { tap: (options?: any, fn?: any) => void };
8873
+ content: {
8874
+ tap: <AdditionalOptions>(
8875
+ options:
8876
+ | string
8877
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8878
+ fn: (
8879
+ arg0: Source,
8880
+ arg1: Module,
8881
+ arg2: ChunkRenderContext,
8882
+ arg3: DependencyTemplates
8883
+ ) => Source
8884
+ ) => void;
8885
+ };
8886
+ module: {
8887
+ tap: <AdditionalOptions>(
8888
+ options:
8889
+ | string
8890
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8891
+ fn: (
8892
+ arg0: Source,
8893
+ arg1: Module,
8894
+ arg2: ChunkRenderContext,
8895
+ arg3: DependencyTemplates
8896
+ ) => Source
8897
+ ) => void;
8898
+ };
8899
+ render: {
8900
+ tap: <AdditionalOptions>(
8901
+ options:
8902
+ | string
8903
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8904
+ fn: (
8905
+ arg0: Source,
8906
+ arg1: Module,
8907
+ arg2: ChunkRenderContext,
8908
+ arg3: DependencyTemplates
8909
+ ) => Source
8910
+ ) => void;
8911
+ };
8912
+ package: {
8913
+ tap: <AdditionalOptions>(
8914
+ options:
8915
+ | string
8916
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8917
+ fn: (
8918
+ arg0: Source,
8919
+ arg1: Module,
8920
+ arg2: ChunkRenderContext,
8921
+ arg3: DependencyTemplates
8922
+ ) => Source
8923
+ ) => void;
8924
+ };
8925
+ hash: {
8926
+ tap: <AdditionalOptions>(
8927
+ options:
8928
+ | string
8929
+ | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8930
+ fn: (arg0: Hash) => void
8931
+ ) => void;
8932
+ };
8683
8933
  }>;
8684
- get runtimeTemplate(): any;
8934
+ get runtimeTemplate(): RuntimeTemplate;
8685
8935
  }
8686
8936
  declare interface ModuleTemplates {
8687
8937
  javascript: ModuleTemplate;
@@ -8735,8 +8985,8 @@ declare abstract class MultiStats {
8735
8985
  get hash(): string;
8736
8986
  hasErrors(): boolean;
8737
8987
  hasWarnings(): boolean;
8738
- toJson(options?: any): StatsCompilation;
8739
- toString(options?: any): string;
8988
+ toJson(options?: string | boolean | StatsOptions): StatsCompilation;
8989
+ toString(options?: string | boolean | StatsOptions): string;
8740
8990
  }
8741
8991
  declare abstract class MultiWatching {
8742
8992
  watchings: Watching[];
@@ -8907,7 +9157,7 @@ declare class NormalModule extends Module {
8907
9157
  createSource(
8908
9158
  context: string,
8909
9159
  content: string | Buffer,
8910
- sourceMap?: string | SourceMapSource,
9160
+ sourceMap?: null | string | SourceMapSource,
8911
9161
  associatedObjectForCache?: object
8912
9162
  ): Source;
8913
9163
  markModuleAsErrored(error: WebpackError): void;
@@ -8919,14 +9169,23 @@ declare class NormalModule extends Module {
8919
9169
  static deserialize(context?: any): NormalModule;
8920
9170
  }
8921
9171
  declare interface NormalModuleCompilationHooks {
8922
- loader: SyncHook<[object, NormalModule]>;
8923
- beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
9172
+ loader: SyncHook<[LoaderContextNormalModule<any>, NormalModule]>;
9173
+ beforeLoaders: SyncHook<
9174
+ [LoaderItem[], NormalModule, LoaderContextNormalModule<any>]
9175
+ >;
8924
9176
  beforeParse: SyncHook<[NormalModule]>;
8925
9177
  beforeSnapshot: SyncHook<[NormalModule]>;
8926
9178
  readResourceForScheme: HookMap<
8927
- AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
9179
+ FakeHook<
9180
+ AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
9181
+ >
9182
+ >;
9183
+ readResource: HookMap<
9184
+ AsyncSeriesBailHook<
9185
+ [LoaderContextNormalModule<any>],
9186
+ null | string | Buffer
9187
+ >
8928
9188
  >;
8929
- readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
8930
9189
  needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
8931
9190
  }
8932
9191
  declare interface NormalModuleCreateData {
@@ -9123,6 +9382,10 @@ declare interface NormalModuleLoaderContext<OptionsType> {
9123
9382
  sourceMap?: boolean;
9124
9383
  mode: "none" | "development" | "production";
9125
9384
  webpack?: boolean;
9385
+ hashFunction: HashFunction;
9386
+ hashDigest: string;
9387
+ hashDigestLength: number;
9388
+ hashSalt: string;
9126
9389
  _module?: NormalModule;
9127
9390
  _compilation?: Compilation;
9128
9391
  _compiler?: Compiler;
@@ -9222,6 +9485,9 @@ declare interface ObjectEncodingOptions {
9222
9485
  | "base64url"
9223
9486
  | "hex";
9224
9487
  }
9488
+ declare interface ObjectForExtract {
9489
+ [index: string]: any;
9490
+ }
9225
9491
  declare interface ObjectSerializer {
9226
9492
  serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
9227
9493
  deserialize: (arg0: ObjectDeserializerContext) => any;
@@ -9284,6 +9550,11 @@ declare interface Open {
9284
9550
  * Enables/Disables integrated optimizations.
9285
9551
  */
9286
9552
  declare interface Optimization {
9553
+ /**
9554
+ * Avoid wrapping the entry module in an IIFE.
9555
+ */
9556
+ avoidEntryIife?: boolean;
9557
+
9287
9558
  /**
9288
9559
  * Check for incompatible wasm types when importing/exporting from/to ESM.
9289
9560
  */
@@ -9674,11 +9945,47 @@ declare interface OptimizationSplitChunksOptions {
9674
9945
  */
9675
9946
  usedExports?: boolean;
9676
9947
  }
9948
+ declare interface Options {
9949
+ /**
9950
+ * source
9951
+ */
9952
+ source: string;
9953
+
9954
+ /**
9955
+ * absolute context path to which lib ident is relative to
9956
+ */
9957
+ context: string;
9958
+
9959
+ /**
9960
+ * content
9961
+ */
9962
+ content: DllReferencePluginOptionsContent;
9963
+
9964
+ /**
9965
+ * type
9966
+ */
9967
+ type?: "object" | "require";
9968
+
9969
+ /**
9970
+ * extensions
9971
+ */
9972
+ extensions?: string[];
9973
+
9974
+ /**
9975
+ * scope
9976
+ */
9977
+ scope?: string;
9978
+
9979
+ /**
9980
+ * object for caching
9981
+ */
9982
+ associatedObjectForCache?: object;
9983
+ }
9677
9984
  declare abstract class OptionsApply {
9678
9985
  process(options?: any, compiler?: any): void;
9679
9986
  }
9680
9987
  declare interface OriginRecord {
9681
- module: Module;
9988
+ module: null | Module;
9682
9989
  loc: DependencyLocation;
9683
9990
  request: string;
9684
9991
  }
@@ -11410,7 +11717,7 @@ declare interface RenderContext {
11410
11717
  /**
11411
11718
  * rendering in strict context
11412
11719
  */
11413
- strictMode: boolean;
11720
+ strictMode?: boolean;
11414
11721
  }
11415
11722
  type RenderManifestEntry =
11416
11723
  | RenderManifestEntryTemplated
@@ -11425,7 +11732,7 @@ declare interface RenderManifestEntryStatic {
11425
11732
  }
11426
11733
  declare interface RenderManifestEntryTemplated {
11427
11734
  render: () => Source;
11428
- filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
11735
+ filenameTemplate: TemplatePath;
11429
11736
  pathOptions?: PathData;
11430
11737
  info?: AssetInfo;
11431
11738
  identifier: string;
@@ -11487,7 +11794,7 @@ declare interface ResolveBuildDependenciesResult {
11487
11794
  /**
11488
11795
  * stored resolve results
11489
11796
  */
11490
- resolveResults: Map<string, string | false>;
11797
+ resolveResults: Map<string, undefined | string | false>;
11491
11798
 
11492
11799
  /**
11493
11800
  * dependencies of the resolving
@@ -12040,6 +12347,13 @@ declare interface ResourceDataWithData {
12040
12347
  context?: string;
12041
12348
  data: Record<string, any>;
12042
12349
  }
12350
+ declare abstract class RestoreProvidedData {
12351
+ exports: any;
12352
+ otherProvided: any;
12353
+ otherCanMangleProvide: any;
12354
+ otherTerminalBinding: any;
12355
+ serialize(__0: ObjectSerializerContext): void;
12356
+ }
12043
12357
  declare interface RmDirOptions {
12044
12358
  maxRetries?: number;
12045
12359
  recursive?: boolean;
@@ -12066,7 +12380,7 @@ declare interface RuleSet {
12066
12380
  /**
12067
12381
  * execute the rule set
12068
12382
  */
12069
- exec: (arg0: object) => Effect[];
12383
+ exec: (arg0: EffectData) => Effect[];
12070
12384
  }
12071
12385
  type RuleSetCondition =
12072
12386
  | string
@@ -12987,13 +13301,13 @@ declare abstract class RuntimeValue {
12987
13301
  fn: (arg0: {
12988
13302
  module: NormalModule;
12989
13303
  key: string;
12990
- readonly version?: string;
13304
+ readonly version: ValueCacheVersion;
12991
13305
  }) => CodeValuePrimitive;
12992
13306
  options: true | RuntimeValueOptions;
12993
13307
  get fileDependencies(): true | string[];
12994
13308
  exec(
12995
13309
  parser: JavascriptParser,
12996
- valueCacheVersions: Map<string, string | Set<string>>,
13310
+ valueCacheVersions: Map<string, ValueCacheVersion>,
12997
13311
  key: string
12998
13312
  ): CodeValuePrimitive;
12999
13313
  getCacheVersion(): undefined | string;
@@ -13138,6 +13452,7 @@ declare class SideEffectsFlagPlugin {
13138
13452
  cache: Map<string, RegExp>
13139
13453
  ): undefined | boolean;
13140
13454
  }
13455
+ type SimpleType = "string" | "number" | "boolean";
13141
13456
  declare class SizeOnlySource extends Source {
13142
13457
  constructor(size: number);
13143
13458
  }
@@ -13157,32 +13472,36 @@ declare abstract class Snapshot {
13157
13472
  children?: Set<Snapshot>;
13158
13473
  hasStartTime(): boolean;
13159
13474
  setStartTime(value: number): void;
13160
- setMergedStartTime(value?: any, snapshot?: any): void;
13475
+ setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
13161
13476
  hasFileTimestamps(): boolean;
13162
- setFileTimestamps(value?: any): void;
13477
+ setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
13163
13478
  hasFileHashes(): boolean;
13164
- setFileHashes(value?: any): void;
13479
+ setFileHashes(value: Map<string, null | string>): void;
13165
13480
  hasFileTshs(): boolean;
13166
- setFileTshs(value?: any): void;
13481
+ setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
13167
13482
  hasContextTimestamps(): boolean;
13168
- setContextTimestamps(value?: any): void;
13483
+ setContextTimestamps(
13484
+ value: Map<string, null | ResolvedContextFileSystemInfoEntry>
13485
+ ): void;
13169
13486
  hasContextHashes(): boolean;
13170
- setContextHashes(value?: any): void;
13487
+ setContextHashes(value: Map<string, null | string>): void;
13171
13488
  hasContextTshs(): boolean;
13172
- setContextTshs(value?: any): void;
13489
+ setContextTshs(
13490
+ value: Map<string, null | ResolvedContextTimestampAndHash>
13491
+ ): void;
13173
13492
  hasMissingExistence(): boolean;
13174
- setMissingExistence(value?: any): void;
13493
+ setMissingExistence(value: Map<string, boolean>): void;
13175
13494
  hasManagedItemInfo(): boolean;
13176
- setManagedItemInfo(value?: any): void;
13495
+ setManagedItemInfo(value: Map<string, string>): void;
13177
13496
  hasManagedFiles(): boolean;
13178
- setManagedFiles(value?: any): void;
13497
+ setManagedFiles(value: Set<string>): void;
13179
13498
  hasManagedContexts(): boolean;
13180
- setManagedContexts(value?: any): void;
13499
+ setManagedContexts(value: Set<string>): void;
13181
13500
  hasManagedMissing(): boolean;
13182
- setManagedMissing(value?: any): void;
13501
+ setManagedMissing(value: Set<string>): void;
13183
13502
  hasChildren(): boolean;
13184
- setChildren(value?: any): void;
13185
- addChild(child?: any): void;
13503
+ setChildren(value: Set<Snapshot>): void;
13504
+ addChild(child: Snapshot): void;
13186
13505
  serialize(__0: ObjectSerializerContext): void;
13187
13506
  deserialize(__0: ObjectDeserializerContext): void;
13188
13507
  getFileIterable(): Iterable<string>;
@@ -13276,11 +13595,14 @@ declare interface SnapshotOptionsWebpackOptions {
13276
13595
  */
13277
13596
  unmanagedPaths?: (string | RegExp)[];
13278
13597
  }
13598
+ declare interface SortFunction<T> {
13599
+ (arg0: T, arg1: T): number;
13600
+ }
13279
13601
  declare abstract class SortableSet<T> extends Set<T> {
13280
13602
  /**
13281
13603
  * Sort with a comparer function
13282
13604
  */
13283
- sortWith(sortFn: (arg0: T, arg1: T) => number): void;
13605
+ sortWith(sortFn?: SortFunction<T>): void;
13284
13606
  sort(): SortableSet<T>;
13285
13607
 
13286
13608
  /**
@@ -13293,11 +13615,6 @@ declare abstract class SortableSet<T> extends Set<T> {
13293
13615
  */
13294
13616
  getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
13295
13617
  toJSON(): T[];
13296
-
13297
- /**
13298
- * Iterates over values in the set.
13299
- */
13300
- [Symbol.iterator](): IterableIterator<T>;
13301
13618
  }
13302
13619
  declare class Source {
13303
13620
  constructor();
@@ -13447,7 +13764,7 @@ declare interface SplitChunksOptions {
13447
13764
  maxAsyncRequests: number;
13448
13765
  maxInitialRequests: number;
13449
13766
  hidePathInfo: boolean;
13450
- filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
13767
+ filename: TemplatePath;
13451
13768
  automaticNameDelimiter: string;
13452
13769
  getCacheGroups: (
13453
13770
  module: Module,
@@ -13652,59 +13969,73 @@ declare class Stats {
13652
13969
  toJson(options?: string | boolean | StatsOptions): StatsCompilation;
13653
13970
  toString(options?: string | boolean | StatsOptions): string;
13654
13971
  }
13655
- type StatsAsset = KnownStatsAsset & Record<string, any>;
13656
- type StatsChunk = KnownStatsChunk & Record<string, any>;
13657
- type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
13658
- type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
13659
- type StatsCompilation = KnownStatsCompilation & Record<string, any>;
13660
- type StatsError = KnownStatsError & Record<string, any>;
13972
+ type StatsAsset = Record<string, any> & KnownStatsAsset;
13973
+ type StatsChunk = Record<string, any> & KnownStatsChunk;
13974
+ type StatsChunkGroup = Record<string, any> & KnownStatsChunkGroup;
13975
+ type StatsChunkOrigin = Record<string, any> & KnownStatsChunkOrigin;
13976
+ type StatsCompilation = Record<string, any> & KnownStatsCompilation;
13977
+ type StatsError = Record<string, any> & KnownStatsError;
13661
13978
  declare abstract class StatsFactory {
13662
- hooks: Readonly<{
13663
- extract: HookMap<SyncBailHook<[object, any, StatsFactoryContext], any>>;
13664
- filter: HookMap<
13665
- SyncBailHook<[any, StatsFactoryContext, number, number], any>
13666
- >;
13667
- sort: HookMap<
13668
- SyncBailHook<
13669
- [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
13670
- any
13671
- >
13672
- >;
13673
- filterSorted: HookMap<
13674
- SyncBailHook<[any, StatsFactoryContext, number, number], any>
13675
- >;
13676
- groupResults: HookMap<
13677
- SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
13678
- >;
13679
- sortResults: HookMap<
13680
- SyncBailHook<
13681
- [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
13682
- any
13683
- >
13684
- >;
13685
- filterResults: HookMap<
13686
- SyncBailHook<[any, StatsFactoryContext, number, number], any>
13687
- >;
13688
- merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
13689
- result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
13690
- getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
13691
- getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
13692
- }>;
13979
+ hooks: StatsFactoryHooks;
13693
13980
  create(
13694
13981
  type: string,
13695
13982
  data: any,
13696
13983
  baseContext: Omit<StatsFactoryContext, "type">
13697
13984
  ): any;
13698
13985
  }
13699
- type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
13700
- type StatsLogging = KnownStatsLogging & Record<string, any>;
13701
- type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
13702
- type StatsModule = KnownStatsModule & Record<string, any>;
13703
- type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
13704
- type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
13705
- type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
13706
- Record<string, any>;
13707
- type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
13986
+ type StatsFactoryContext = Record<string, any> & KnownStatsFactoryContext;
13987
+ declare interface StatsFactoryHooks {
13988
+ extract: HookMap<
13989
+ SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], undefined>
13990
+ >;
13991
+ filter: HookMap<
13992
+ SyncBailHook<
13993
+ [any, StatsFactoryContext, number, number],
13994
+ undefined | boolean
13995
+ >
13996
+ >;
13997
+ sort: HookMap<
13998
+ SyncBailHook<
13999
+ [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
14000
+ undefined
14001
+ >
14002
+ >;
14003
+ filterSorted: HookMap<
14004
+ SyncBailHook<
14005
+ [any, StatsFactoryContext, number, number],
14006
+ undefined | boolean
14007
+ >
14008
+ >;
14009
+ groupResults: HookMap<
14010
+ SyncBailHook<[GroupConfig[], StatsFactoryContext], undefined>
14011
+ >;
14012
+ sortResults: HookMap<
14013
+ SyncBailHook<
14014
+ [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
14015
+ undefined
14016
+ >
14017
+ >;
14018
+ filterResults: HookMap<
14019
+ SyncBailHook<
14020
+ [any, StatsFactoryContext, number, number],
14021
+ undefined | boolean
14022
+ >
14023
+ >;
14024
+ merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
14025
+ result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
14026
+ getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string>>;
14027
+ getItemFactory: HookMap<
14028
+ SyncBailHook<[any, StatsFactoryContext], undefined | StatsFactory>
14029
+ >;
14030
+ }
14031
+ type StatsLogging = Record<string, any> & KnownStatsLogging;
14032
+ type StatsLoggingEntry = Record<string, any> & KnownStatsLoggingEntry;
14033
+ type StatsModule = Record<string, any> & KnownStatsModule;
14034
+ type StatsModuleIssuer = Record<string, any> & KnownStatsModuleIssuer;
14035
+ type StatsModuleReason = Record<string, any> & KnownStatsModuleReason;
14036
+ type StatsModuleTraceDependency = Record<string, any> &
14037
+ KnownStatsModuleTraceDependency;
14038
+ type StatsModuleTraceItem = Record<string, any> & KnownStatsModuleTraceItem;
13708
14039
 
13709
14040
  /**
13710
14041
  * Stats options object.
@@ -14153,22 +14484,28 @@ declare interface StatsOptions {
14153
14484
  */
14154
14485
  warningsSpace?: number;
14155
14486
  }
14156
- declare abstract class StatsPrinter {
14157
- hooks: Readonly<{
14158
- sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
14159
- printElements: HookMap<
14160
- SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
14161
- >;
14162
- sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
14163
- getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
14164
- printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
14165
- print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
14166
- result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
14167
- }>;
14168
- print(type: string, object: object, baseContext?: object): string;
14487
+ declare interface StatsPrintHooks {
14488
+ sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
14489
+ printElements: HookMap<
14490
+ SyncBailHook<[PrintedElement[], StatsPrinterContext], undefined | string>
14491
+ >;
14492
+ sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
14493
+ getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
14494
+ printItems: HookMap<
14495
+ SyncBailHook<[string[], StatsPrinterContext], undefined | string>
14496
+ >;
14497
+ print: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
14498
+ result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
14169
14499
  }
14170
- type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
14171
- type StatsProfile = KnownStatsProfile & Record<string, any>;
14500
+ declare abstract class StatsPrinter {
14501
+ hooks: StatsPrintHooks;
14502
+ print(type: string, object?: any, baseContext?: StatsPrinterContext): string;
14503
+ }
14504
+ type StatsPrinterContext = Record<string, any> &
14505
+ KnownStatsPrinterColorFn &
14506
+ KnownStatsPrinterFormaters &
14507
+ KnownStatsPrinterContext;
14508
+ type StatsProfile = Record<string, any> & KnownStatsProfile;
14172
14509
  type StatsValue =
14173
14510
  | boolean
14174
14511
  | StatsOptions
@@ -14197,7 +14534,7 @@ declare class SyncModuleIdsPlugin {
14197
14534
  /**
14198
14535
  * operation mode (defaults to merge)
14199
14536
  */
14200
- mode?: "read" | "merge" | "create" | "update";
14537
+ mode?: "read" | "create" | "merge" | "update";
14201
14538
  });
14202
14539
 
14203
14540
  /**
@@ -14223,6 +14560,15 @@ declare interface TagInfo {
14223
14560
  data: any;
14224
14561
  next?: TagInfo;
14225
14562
  }
14563
+ declare interface TargetItem {
14564
+ module: Module;
14565
+ connection: ModuleGraphConnection;
14566
+ export?: string[];
14567
+ }
14568
+ declare interface TargetItemWithoutConnection {
14569
+ module: Module;
14570
+ export: string[];
14571
+ }
14226
14572
  declare class Template {
14227
14573
  constructor();
14228
14574
  static getFunctionContent(fn: Function): string;
@@ -14239,7 +14585,7 @@ declare class Template {
14239
14585
  static renderChunkModules(
14240
14586
  renderContext: ChunkRenderContext,
14241
14587
  modules: Module[],
14242
- renderModule: (arg0: Module) => Source,
14588
+ renderModule: (arg0: Module) => null | Source,
14243
14589
  prefix?: string
14244
14590
  ): null | Source;
14245
14591
  static renderRuntimeModules(
@@ -14255,6 +14601,7 @@ declare class Template {
14255
14601
  static NUMBER_OF_IDENTIFIER_START_CHARS: number;
14256
14602
  static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
14257
14603
  }
14604
+ type TemplatePath = string | ((arg0: PathData, arg1?: AssetInfo) => string);
14258
14605
  declare interface TimestampAndHash {
14259
14606
  safeTime: number;
14260
14607
  timestamp?: number;
@@ -14305,6 +14652,9 @@ declare interface UpdateHashContextGenerator {
14305
14652
  runtimeTemplate?: RuntimeTemplate;
14306
14653
  }
14307
14654
  type UsageStateType = 0 | 1 | 2 | 3 | 4;
14655
+ type UsedName = string | false | string[];
14656
+ type Value = string | number | boolean | RegExp;
14657
+ type ValueCacheVersion = undefined | string | Set<string>;
14308
14658
  declare abstract class VariableInfo {
14309
14659
  declaredScope: ScopeInfo;
14310
14660
  freeName?: string | true;
@@ -14328,10 +14678,10 @@ declare interface WatchFileSystem {
14328
14678
  options: WatchOptions,
14329
14679
  callback: (
14330
14680
  arg0: null | Error,
14331
- arg1: Map<string, FileSystemInfoEntry | "ignore">,
14332
- arg2: Map<string, FileSystemInfoEntry | "ignore">,
14333
- arg3: Set<string>,
14334
- arg4: Set<string>
14681
+ arg1?: Map<string, FileSystemInfoEntry | "ignore">,
14682
+ arg2?: Map<string, FileSystemInfoEntry | "ignore">,
14683
+ arg3?: Set<string>,
14684
+ arg4?: Set<string>
14335
14685
  ) => void,
14336
14686
  callbackUndelayed: (arg0: string, arg1: number) => void
14337
14687
  ) => Watcher;
@@ -14446,28 +14796,7 @@ declare abstract class Watching {
14446
14796
  closed: boolean;
14447
14797
  suspended: boolean;
14448
14798
  blocked: boolean;
14449
- watchOptions: {
14450
- /**
14451
- * Delay the rebuilt after the first change. Value is a time in ms.
14452
- */
14453
- aggregateTimeout?: number;
14454
- /**
14455
- * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
14456
- */
14457
- followSymlinks?: boolean;
14458
- /**
14459
- * Ignore some files from watching (glob pattern or regexp).
14460
- */
14461
- ignored?: string | RegExp | string[];
14462
- /**
14463
- * Enable polling mode for watching.
14464
- */
14465
- poll?: number | boolean;
14466
- /**
14467
- * Stop watching when stdin stream has ended.
14468
- */
14469
- stdin?: boolean;
14470
- };
14799
+ watchOptions: WatchOptions;
14471
14800
  compiler: Compiler;
14472
14801
  running: boolean;
14473
14802
  watcher?: null | Watcher;
@@ -14574,7 +14903,7 @@ declare abstract class WebpackLogger {
14574
14903
  status(...args: any[]): void;
14575
14904
  group(...args: any[]): void;
14576
14905
  groupCollapsed(...args: any[]): void;
14577
- groupEnd(...args: any[]): void;
14906
+ groupEnd(): void;
14578
14907
  profile(label?: string): void;
14579
14908
  profileEnd(label?: string): void;
14580
14909
  time(label: string): void;
@@ -14673,6 +15002,7 @@ declare interface WebpackOptionsNormalized {
14673
15002
  | "jsonp"
14674
15003
  | "system"
14675
15004
  | "promise"
15005
+ | "module-import"
14676
15006
  | "script"
14677
15007
  | "node-commonjs";
14678
15008
 
@@ -14982,18 +15312,11 @@ declare namespace exports {
14982
15312
  ) => void;
14983
15313
  export const version: string;
14984
15314
  export namespace cli {
14985
- export let getArguments: (schema?: any) => Record<string, Argument>;
15315
+ export let getArguments: (schema?: any) => Flags;
14986
15316
  export let processArguments: (
14987
- args: Record<string, Argument>,
15317
+ args: Flags,
14988
15318
  config: any,
14989
- values: Record<
14990
- string,
14991
- | string
14992
- | number
14993
- | boolean
14994
- | RegExp
14995
- | (string | number | boolean | RegExp)[]
14996
- >
15319
+ values: Record<string, Value[]>
14997
15320
  ) => null | Problem[];
14998
15321
  }
14999
15322
  export namespace ModuleFilenameHelpers {
@@ -15289,7 +15612,7 @@ declare namespace exports {
15289
15612
  export { ProfilingPlugin };
15290
15613
  }
15291
15614
  export namespace util {
15292
- export const createHash: (algorithm: string | typeof Hash) => Hash;
15615
+ export const createHash: (algorithm: Algorithm) => Hash;
15293
15616
  export namespace comparators {
15294
15617
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
15295
15618
  export let compareModulesByIdentifier: (
@@ -15418,7 +15741,10 @@ declare namespace exports {
15418
15741
  ) => Serializer;
15419
15742
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
15420
15743
  }
15421
- export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
15744
+ export const cleverMerge: <T, O>(
15745
+ first?: null | T,
15746
+ second?: null | O
15747
+ ) => T | O | (T & O);
15422
15748
  export function compileBooleanMatcher(
15423
15749
  map: Record<string | number, boolean>
15424
15750
  ): boolean | ((arg0: string) => string);
@@ -15575,7 +15901,7 @@ declare namespace exports {
15575
15901
  LoaderDefinitionFunction,
15576
15902
  PitchLoaderDefinitionFunction,
15577
15903
  RawLoaderDefinitionFunction,
15578
- LoaderContext
15904
+ LoaderContextDeclarationsIndex as LoaderContext
15579
15905
  };
15580
15906
  }
15581
15907
  declare const topLevelSymbolTag: unique symbol;