webpack 5.76.1 → 5.88.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.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (436) hide show
  1. package/README.md +10 -4
  2. package/bin/webpack.js +26 -2
  3. package/hot/dev-server.js +2 -1
  4. package/hot/lazy-compilation-node.js +10 -0
  5. package/hot/lazy-compilation-web.js +9 -0
  6. package/hot/log-apply-result.js +5 -0
  7. package/hot/log.js +22 -0
  8. package/hot/only-dev-server.js +2 -1
  9. package/hot/poll.js +3 -0
  10. package/hot/signal.js +4 -0
  11. package/lib/APIPlugin.js +174 -116
  12. package/lib/AsyncDependenciesBlock.js +13 -5
  13. package/lib/AutomaticPrefetchPlugin.js +1 -0
  14. package/lib/BannerPlugin.js +4 -0
  15. package/lib/CacheFacade.js +4 -0
  16. package/lib/CaseSensitiveModulesWarning.js +3 -1
  17. package/lib/Chunk.js +36 -18
  18. package/lib/ChunkGraph.js +4 -4
  19. package/lib/ChunkGroup.js +25 -10
  20. package/lib/CleanPlugin.js +30 -7
  21. package/lib/CodeGenerationResults.js +2 -2
  22. package/lib/CompatibilityPlugin.js +85 -46
  23. package/lib/Compilation.js +17 -8
  24. package/lib/Compiler.js +12 -8
  25. package/lib/ConcatenationScope.js +2 -2
  26. package/lib/ConditionalInitFragment.js +11 -1
  27. package/lib/ConstPlugin.js +79 -44
  28. package/lib/ContextModule.js +20 -6
  29. package/lib/ContextModuleFactory.js +2 -1
  30. package/lib/ContextReplacementPlugin.js +13 -0
  31. package/lib/CssModule.js +169 -0
  32. package/lib/DefinePlugin.js +152 -86
  33. package/lib/DelegatedModule.js +22 -4
  34. package/lib/DelegatedModuleFactoryPlugin.js +6 -0
  35. package/lib/DependenciesBlock.js +17 -1
  36. package/lib/Dependency.js +19 -5
  37. package/lib/DllEntryPlugin.js +16 -1
  38. package/lib/DllModule.js +17 -2
  39. package/lib/DllModuleFactory.js +1 -1
  40. package/lib/DllReferencePlugin.js +13 -1
  41. package/lib/Entrypoint.js +1 -1
  42. package/lib/ErrorHelpers.js +62 -22
  43. package/lib/EvalSourceMapDevToolPlugin.js +9 -2
  44. package/lib/ExportsInfo.js +20 -3
  45. package/lib/ExportsInfoApiPlugin.js +30 -14
  46. package/lib/ExternalModule.js +30 -9
  47. package/lib/FileSystemInfo.js +9 -1
  48. package/lib/FlagAllModulesAsUsedPlugin.js +27 -27
  49. package/lib/FlagDependencyExportsPlugin.js +336 -348
  50. package/lib/FlagDependencyUsagePlugin.js +9 -9
  51. package/lib/FlagEntryExportAsUsedPlugin.js +26 -23
  52. package/lib/HookWebpackError.js +1 -1
  53. package/lib/HotModuleReplacementPlugin.js +60 -46
  54. package/lib/IgnoreErrorModuleFactory.js +1 -1
  55. package/lib/InitFragment.js +28 -5
  56. package/lib/JavascriptMetaInfoPlugin.js +27 -15
  57. package/lib/LibManifestPlugin.js +22 -5
  58. package/lib/LoaderOptionsPlugin.js +12 -2
  59. package/lib/MainTemplate.js +2 -2
  60. package/lib/Module.js +44 -12
  61. package/lib/ModuleBuildError.js +9 -0
  62. package/lib/ModuleDependencyError.js +4 -2
  63. package/lib/ModuleDependencyWarning.js +4 -2
  64. package/lib/ModuleError.js +9 -0
  65. package/lib/ModuleFactory.js +1 -1
  66. package/lib/ModuleFilenameHelpers.js +114 -4
  67. package/lib/ModuleGraph.js +33 -23
  68. package/lib/ModuleGraphConnection.js +19 -6
  69. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  70. package/lib/ModuleNotFoundError.js +5 -2
  71. package/lib/ModuleParseError.js +9 -0
  72. package/lib/ModuleProfile.js +1 -0
  73. package/lib/ModuleRestoreError.js +2 -0
  74. package/lib/ModuleStoreError.js +2 -1
  75. package/lib/ModuleTypeConstants.js +169 -0
  76. package/lib/ModuleWarning.js +9 -0
  77. package/lib/MultiWatching.js +4 -0
  78. package/lib/NodeStuffPlugin.js +65 -35
  79. package/lib/NormalModule.js +12 -2
  80. package/lib/NormalModuleFactory.js +56 -8
  81. package/lib/NormalModuleReplacementPlugin.js +5 -3
  82. package/lib/NullFactory.js +1 -1
  83. package/lib/PrefetchPlugin.js +4 -0
  84. package/lib/ProgressPlugin.js +71 -15
  85. package/lib/ProvidePlugin.js +30 -14
  86. package/lib/RawModule.js +13 -2
  87. package/lib/RecordIdsPlugin.js +4 -4
  88. package/lib/RequireJsStuffPlugin.js +22 -15
  89. package/lib/RuntimeGlobals.js +5 -0
  90. package/lib/RuntimeModule.js +12 -11
  91. package/lib/RuntimePlugin.js +10 -3
  92. package/lib/RuntimeTemplate.js +29 -11
  93. package/lib/SelfModuleFactory.js +12 -0
  94. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
  95. package/lib/SourceMapDevToolPlugin.js +47 -11
  96. package/lib/Template.js +5 -3
  97. package/lib/UseStrictPlugin.js +29 -11
  98. package/lib/WarnCaseSensitiveModulesPlugin.js +12 -0
  99. package/lib/WarnDeprecatedOptionPlugin.js +7 -0
  100. package/lib/WatchIgnorePlugin.js +4 -0
  101. package/lib/WebpackError.js +14 -5
  102. package/lib/WebpackIsIncludedPlugin.js +22 -13
  103. package/lib/WebpackOptionsApply.js +41 -44
  104. package/lib/WebpackOptionsDefaulter.js +10 -3
  105. package/lib/asset/AssetGenerator.js +24 -9
  106. package/lib/asset/AssetModulesPlugin.js +28 -12
  107. package/lib/asset/AssetParser.js +15 -7
  108. package/lib/asset/AssetSourceParser.js +8 -3
  109. package/lib/asset/RawDataUrlModule.js +15 -4
  110. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
  111. package/lib/async-modules/InferAsyncModulesPlugin.js +1 -1
  112. package/lib/cache/IdleFileCachePlugin.js +2 -1
  113. package/lib/cache/MemoryWithGcCachePlugin.js +2 -0
  114. package/lib/cache/PackFileCacheStrategy.js +42 -15
  115. package/lib/cache/ResolverCachePlugin.js +3 -0
  116. package/lib/config/browserslistTargetHandler.js +10 -10
  117. package/lib/config/defaults.js +306 -105
  118. package/lib/config/normalization.js +110 -71
  119. package/lib/config/target.js +37 -10
  120. package/lib/container/ContainerEntryModule.js +11 -1
  121. package/lib/container/ContainerEntryModuleFactory.js +1 -1
  122. package/lib/container/ContainerExposedDependency.js +9 -0
  123. package/lib/container/ContainerPlugin.js +3 -1
  124. package/lib/container/FallbackDependency.js +13 -0
  125. package/lib/container/FallbackItemDependency.js +3 -0
  126. package/lib/container/FallbackModule.js +12 -2
  127. package/lib/container/FallbackModuleFactory.js +1 -1
  128. package/lib/container/RemoteModule.js +11 -1
  129. package/lib/container/RemoteRuntimeModule.js +3 -2
  130. package/lib/container/RemoteToExternalDependency.js +3 -0
  131. package/lib/css/CssExportsGenerator.js +9 -0
  132. package/lib/css/CssGenerator.js +5 -1
  133. package/lib/css/CssLoadingRuntimeModule.js +53 -22
  134. package/lib/css/CssModulesPlugin.js +253 -74
  135. package/lib/css/CssParser.js +697 -282
  136. package/lib/css/walkCssTokens.js +269 -138
  137. package/lib/debug/ProfilingPlugin.js +33 -12
  138. package/lib/dependencies/AMDDefineDependency.js +54 -10
  139. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +13 -2
  140. package/lib/dependencies/AMDPlugin.js +33 -20
  141. package/lib/dependencies/AMDRequireArrayDependency.js +13 -0
  142. package/lib/dependencies/AMDRequireContextDependency.js +15 -0
  143. package/lib/dependencies/AMDRequireDependenciesBlock.js +6 -0
  144. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +8 -2
  145. package/lib/dependencies/AMDRequireDependency.js +16 -1
  146. package/lib/dependencies/AMDRequireItemDependency.js +6 -0
  147. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  148. package/lib/dependencies/CachedConstDependency.js +14 -0
  149. package/lib/dependencies/CommonJsDependencyHelpers.js +9 -0
  150. package/lib/dependencies/CommonJsExportRequireDependency.js +19 -0
  151. package/lib/dependencies/CommonJsExportsDependency.js +16 -0
  152. package/lib/dependencies/CommonJsExportsParserPlugin.js +77 -5
  153. package/lib/dependencies/CommonJsFullRequireDependency.js +10 -1
  154. package/lib/dependencies/CommonJsImportsParserPlugin.js +174 -63
  155. package/lib/dependencies/CommonJsPlugin.js +51 -26
  156. package/lib/dependencies/CommonJsRequireContextDependency.js +17 -0
  157. package/lib/dependencies/CommonJsRequireDependency.js +7 -0
  158. package/lib/dependencies/CommonJsSelfReferenceDependency.js +16 -0
  159. package/lib/dependencies/ConstDependency.js +11 -2
  160. package/lib/dependencies/ContextDependency.js +15 -2
  161. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  162. package/lib/dependencies/ContextElementDependency.js +8 -0
  163. package/lib/dependencies/CreateScriptUrlDependency.js +10 -1
  164. package/lib/dependencies/CriticalDependencyWarning.js +3 -0
  165. package/lib/dependencies/CssExportDependency.js +8 -0
  166. package/lib/dependencies/CssImportDependency.js +55 -3
  167. package/lib/dependencies/CssLocalIdentifierDependency.js +15 -1
  168. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +10 -1
  169. package/lib/dependencies/CssUrlDependency.js +46 -16
  170. package/lib/dependencies/DelegatedSourceDependency.js +3 -0
  171. package/lib/dependencies/DllEntryDependency.js +14 -0
  172. package/lib/dependencies/DynamicExports.js +10 -6
  173. package/lib/dependencies/ExportsInfoDependency.js +25 -4
  174. package/lib/dependencies/HarmonyAcceptDependency.js +10 -1
  175. package/lib/dependencies/HarmonyAcceptImportDependency.js +3 -0
  176. package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
  177. package/lib/dependencies/HarmonyDetectionParserPlugin.js +22 -2
  178. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +32 -6
  179. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +5 -0
  180. package/lib/dependencies/HarmonyExportExpressionDependency.js +20 -3
  181. package/lib/dependencies/HarmonyExportHeaderDependency.js +13 -0
  182. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +22 -6
  183. package/lib/dependencies/HarmonyExportInitFragment.js +2 -1
  184. package/lib/dependencies/HarmonyExportSpecifierDependency.js +12 -0
  185. package/lib/dependencies/HarmonyExports.js +11 -5
  186. package/lib/dependencies/HarmonyImportDependency.js +10 -1
  187. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +53 -22
  188. package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -2
  189. package/lib/dependencies/HarmonyImportSpecifierDependency.js +139 -16
  190. package/lib/dependencies/HarmonyModulesPlugin.js +23 -5
  191. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
  192. package/lib/dependencies/ImportContextDependency.js +15 -0
  193. package/lib/dependencies/ImportDependency.js +15 -4
  194. package/lib/dependencies/ImportEagerDependency.js +7 -4
  195. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +51 -13
  196. package/lib/dependencies/ImportMetaContextPlugin.js +18 -5
  197. package/lib/dependencies/ImportMetaHotAcceptDependency.js +6 -0
  198. package/lib/dependencies/ImportMetaHotDeclineDependency.js +6 -0
  199. package/lib/dependencies/ImportMetaPlugin.js +103 -51
  200. package/lib/dependencies/ImportParserPlugin.js +83 -25
  201. package/lib/dependencies/ImportPlugin.js +21 -7
  202. package/lib/dependencies/ImportWeakDependency.js +7 -4
  203. package/lib/dependencies/JsonExportsDependency.js +9 -1
  204. package/lib/dependencies/LocalModule.js +16 -0
  205. package/lib/dependencies/LocalModuleDependency.js +15 -0
  206. package/lib/dependencies/LocalModulesHelpers.js +18 -0
  207. package/lib/dependencies/ModuleDecoratorDependency.js +8 -0
  208. package/lib/dependencies/ModuleDependency.js +9 -1
  209. package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
  210. package/lib/dependencies/ModuleHotAcceptDependency.js +6 -0
  211. package/lib/dependencies/ModuleHotDeclineDependency.js +6 -0
  212. package/lib/dependencies/PrefetchDependency.js +3 -0
  213. package/lib/dependencies/ProvidedDependency.js +14 -2
  214. package/lib/dependencies/PureExpressionDependency.js +10 -1
  215. package/lib/dependencies/RequireContextDependency.js +6 -0
  216. package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
  217. package/lib/dependencies/RequireContextPlugin.js +19 -6
  218. package/lib/dependencies/RequireEnsureDependenciesBlock.js +7 -0
  219. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
  220. package/lib/dependencies/RequireEnsureDependency.js +16 -2
  221. package/lib/dependencies/RequireEnsureItemDependency.js +3 -0
  222. package/lib/dependencies/RequireEnsurePlugin.js +27 -7
  223. package/lib/dependencies/RequireHeaderDependency.js +14 -1
  224. package/lib/dependencies/RequireIncludeDependency.js +5 -0
  225. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +29 -5
  226. package/lib/dependencies/RequireIncludePlugin.js +25 -5
  227. package/lib/dependencies/RequireResolveContextDependency.js +17 -0
  228. package/lib/dependencies/RequireResolveDependency.js +6 -0
  229. package/lib/dependencies/RequireResolveHeaderDependency.js +18 -0
  230. package/lib/dependencies/RuntimeRequirementsDependency.js +8 -0
  231. package/lib/dependencies/StaticExportsDependency.js +8 -0
  232. package/lib/dependencies/SystemPlugin.js +48 -21
  233. package/lib/dependencies/SystemRuntimeModule.js +1 -1
  234. package/lib/dependencies/URLDependency.js +13 -4
  235. package/lib/dependencies/URLPlugin.js +31 -18
  236. package/lib/dependencies/UnsupportedDependency.js +13 -0
  237. package/lib/dependencies/WebAssemblyExportImportedDependency.js +14 -0
  238. package/lib/dependencies/WebAssemblyImportDependency.js +9 -1
  239. package/lib/dependencies/WebpackIsIncludedDependency.js +5 -0
  240. package/lib/dependencies/WorkerDependency.js +47 -3
  241. package/lib/dependencies/WorkerPlugin.js +105 -32
  242. package/lib/dependencies/getFunctionExpression.js +7 -0
  243. package/lib/esm/ExportWebpackRequireRuntimeModule.js +3 -2
  244. package/lib/esm/ModuleChunkFormatPlugin.js +21 -8
  245. package/lib/esm/ModuleChunkLoadingPlugin.js +9 -0
  246. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +19 -12
  247. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
  248. package/lib/hmr/LazyCompilationPlugin.js +14 -5
  249. package/lib/ids/ChunkModuleIdRangePlugin.js +11 -0
  250. package/lib/ids/DeterministicChunkIdsPlugin.js +11 -2
  251. package/lib/ids/DeterministicModuleIdsPlugin.js +11 -7
  252. package/lib/ids/HashedModuleIdsPlugin.js +9 -2
  253. package/lib/ids/IdHelpers.js +6 -0
  254. package/lib/ids/NamedChunkIdsPlugin.js +13 -1
  255. package/lib/ids/NamedModuleIdsPlugin.js +14 -3
  256. package/lib/ids/OccurrenceChunkIdsPlugin.js +6 -2
  257. package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
  258. package/lib/ids/SyncModuleIdsPlugin.js +3 -2
  259. package/lib/index.js +8 -0
  260. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +3 -3
  261. package/lib/javascript/BasicEvaluatedExpression.js +137 -11
  262. package/lib/javascript/ChunkHelpers.js +2 -2
  263. package/lib/javascript/CommonJsChunkFormatPlugin.js +7 -3
  264. package/lib/javascript/EnableChunkLoadingPlugin.js +4 -0
  265. package/lib/javascript/JavascriptModulesPlugin.js +194 -194
  266. package/lib/javascript/JavascriptParser.js +941 -256
  267. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  268. package/lib/javascript/StartupHelpers.js +2 -2
  269. package/lib/json/JsonData.js +26 -1
  270. package/lib/json/JsonGenerator.js +21 -7
  271. package/lib/json/JsonModulesPlugin.js +14 -5
  272. package/lib/json/JsonParser.js +27 -13
  273. package/lib/library/AbstractLibraryPlugin.js +4 -0
  274. package/lib/library/AmdLibraryPlugin.js +22 -6
  275. package/lib/library/AssignLibraryPlugin.js +6 -4
  276. package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
  277. package/lib/library/ModuleLibraryPlugin.js +8 -4
  278. package/lib/library/SystemLibraryPlugin.js +1 -0
  279. package/lib/library/UmdLibraryPlugin.js +4 -0
  280. package/lib/logging/runtime.js +1 -1
  281. package/lib/logging/truncateArgs.js +4 -0
  282. package/lib/node/CommonJsChunkLoadingPlugin.js +17 -2
  283. package/lib/node/NodeTargetPlugin.js +3 -0
  284. package/lib/node/NodeTemplatePlugin.js +10 -2
  285. package/lib/node/NodeWatchFileSystem.js +1 -1
  286. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +18 -9
  287. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +12 -2
  288. package/lib/node/ReadFileCompileWasmPlugin.js +21 -3
  289. package/lib/node/RequireChunkLoadingRuntimeModule.js +15 -8
  290. package/lib/node/nodeConsole.js +2 -4
  291. package/lib/optimize/AggressiveMergingPlugin.js +8 -0
  292. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  293. package/lib/optimize/ConcatenatedModule.js +8 -6
  294. package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
  295. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
  296. package/lib/optimize/InnerGraph.js +5 -5
  297. package/lib/optimize/InnerGraphPlugin.js +57 -48
  298. package/lib/optimize/LimitChunkCountPlugin.js +29 -4
  299. package/lib/optimize/MangleExportsPlugin.js +1 -1
  300. package/lib/optimize/MinMaxSizeWarning.js +5 -0
  301. package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
  302. package/lib/optimize/RealContentHashPlugin.js +86 -30
  303. package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
  304. package/lib/optimize/RuntimeChunkPlugin.js +9 -1
  305. package/lib/optimize/SideEffectsFlagPlugin.js +53 -44
  306. package/lib/optimize/SplitChunksPlugin.js +71 -31
  307. package/lib/performance/SizeLimitsPlugin.js +7 -4
  308. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
  309. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  310. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
  311. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
  312. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
  313. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  314. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  315. package/lib/rules/RuleSetCompiler.js +3 -3
  316. package/lib/rules/UseEffectRulePlugin.js +6 -4
  317. package/lib/runtime/AsyncModuleRuntimeModule.js +9 -6
  318. package/lib/runtime/AutoPublicPathRuntimeModule.js +16 -5
  319. package/lib/runtime/BaseUriRuntimeModule.js +8 -4
  320. package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
  321. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
  322. package/lib/runtime/CompatRuntimeModule.js +7 -2
  323. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
  324. package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
  325. package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
  326. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
  327. package/lib/runtime/EnsureChunkRuntimeModule.js +18 -4
  328. package/lib/runtime/GetChunkFilenameRuntimeModule.js +45 -26
  329. package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
  330. package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
  331. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +27 -6
  332. package/lib/runtime/GlobalRuntimeModule.js +1 -1
  333. package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
  334. package/lib/runtime/LoadScriptRuntimeModule.js +65 -50
  335. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
  336. package/lib/runtime/NonceRuntimeModule.js +1 -1
  337. package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
  338. package/lib/runtime/PublicPathRuntimeModule.js +9 -2
  339. package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
  340. package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
  341. package/lib/runtime/StartupChunkDependenciesPlugin.js +15 -0
  342. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +13 -4
  343. package/lib/runtime/StartupEntrypointRuntimeModule.js +11 -7
  344. package/lib/runtime/SystemContextRuntimeModule.js +1 -1
  345. package/lib/schemes/DataUriPlugin.js +16 -3
  346. package/lib/schemes/HttpUriPlugin.js +38 -0
  347. package/lib/serialization/ArraySerializer.js +22 -6
  348. package/lib/serialization/BinaryMiddleware.js +164 -1
  349. package/lib/serialization/DateObjectSerializer.js +15 -4
  350. package/lib/serialization/ErrorObjectSerializer.js +23 -8
  351. package/lib/serialization/FileMiddleware.js +17 -0
  352. package/lib/serialization/MapObjectSerializer.js +24 -8
  353. package/lib/serialization/NullPrototypeObjectSerializer.js +25 -8
  354. package/lib/serialization/ObjectMiddleware.js +33 -2
  355. package/lib/serialization/PlainObjectSerializer.js +23 -12
  356. package/lib/serialization/RegExpObjectSerializer.js +16 -5
  357. package/lib/serialization/SetObjectSerializer.js +21 -6
  358. package/lib/serialization/types.js +1 -1
  359. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  360. package/lib/sharing/ConsumeSharedModule.js +13 -2
  361. package/lib/sharing/ConsumeSharedPlugin.js +4 -0
  362. package/lib/sharing/ConsumeSharedRuntimeModule.js +22 -7
  363. package/lib/sharing/ProvideSharedDependency.js +17 -0
  364. package/lib/sharing/ProvideSharedModule.js +11 -1
  365. package/lib/sharing/ProvideSharedModuleFactory.js +1 -1
  366. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  367. package/lib/sharing/ShareRuntimeModule.js +19 -9
  368. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  369. package/lib/sharing/utils.js +320 -7
  370. package/lib/stats/DefaultStatsFactoryPlugin.js +105 -29
  371. package/lib/stats/DefaultStatsPresetPlugin.js +9 -0
  372. package/lib/stats/DefaultStatsPrinterPlugin.js +43 -0
  373. package/lib/util/AsyncQueue.js +4 -2
  374. package/lib/util/LazySet.js +10 -2
  375. package/lib/util/MapHelpers.js +19 -5
  376. package/lib/util/ParallelismFactorCalculator.js +10 -0
  377. package/lib/util/Semaphore.js +1 -1
  378. package/lib/util/StackedCacheMap.js +6 -0
  379. package/lib/util/StringXor.js +51 -0
  380. package/lib/util/binarySearchBounds.js +49 -0
  381. package/lib/util/compileBooleanMatcher.js +31 -0
  382. package/lib/util/createHash.js +35 -13
  383. package/lib/util/deprecation.js +18 -3
  384. package/lib/util/deterministicGrouping.js +50 -11
  385. package/lib/util/findGraphRoots.js +4 -2
  386. package/lib/util/hash/md4.js +2 -2
  387. package/lib/util/hash/xxhash64.js +1 -1
  388. package/lib/util/identifier.js +4 -0
  389. package/lib/util/internalSerializables.js +1 -0
  390. package/lib/util/makeSerializable.js +7 -0
  391. package/lib/util/memoize.js +3 -3
  392. package/lib/util/numberHash.js +75 -21
  393. package/lib/util/processAsyncTree.js +7 -1
  394. package/lib/util/propertyAccess.js +9 -54
  395. package/lib/util/propertyName.js +79 -0
  396. package/lib/util/registerExternalSerializer.js +1 -1
  397. package/lib/util/runtime.js +14 -1
  398. package/lib/util/semver.js +1 -1
  399. package/lib/util/serialization.js +10 -0
  400. package/lib/util/smartGrouping.js +1 -1
  401. package/lib/validateSchema.js +6 -2
  402. package/lib/wasm/EnableWasmLoadingPlugin.js +4 -0
  403. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +15 -2
  404. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +9 -1
  405. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +14 -3
  406. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +28 -8
  407. package/lib/wasm-async/AsyncWebAssemblyParser.js +11 -4
  408. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +39 -8
  409. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +17 -6
  410. package/lib/wasm-sync/WebAssemblyGenerator.js +19 -5
  411. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
  412. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +53 -43
  413. package/lib/wasm-sync/WebAssemblyParser.js +15 -4
  414. package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
  415. package/lib/web/FetchCompileAsyncWasmPlugin.js +11 -1
  416. package/lib/web/FetchCompileWasmPlugin.js +59 -42
  417. package/lib/web/JsonpChunkLoadingPlugin.js +9 -0
  418. package/lib/web/JsonpChunkLoadingRuntimeModule.js +26 -9
  419. package/lib/webpack.js +12 -3
  420. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +9 -0
  421. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +20 -17
  422. package/module.d.ts +55 -37
  423. package/package.json +59 -56
  424. package/schemas/WebpackOptions.check.js +1 -1
  425. package/schemas/WebpackOptions.json +132 -5
  426. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  427. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  428. package/schemas/plugins/SourceMapDevToolPlugin.json +4 -0
  429. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  430. package/schemas/plugins/container/ContainerPlugin.json +8 -0
  431. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  432. package/schemas/plugins/container/ModuleFederationPlugin.json +8 -0
  433. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  434. package/schemas/plugins/css/CssParserOptions.json +1 -1
  435. package/schemas/plugins/sharing/SharePlugin.check.js +1 -1
  436. package/types.d.ts +1608 -667
package/types.d.ts CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  ConditionalExpression,
27
27
  ContinueStatement,
28
28
  DebuggerStatement,
29
+ Directive,
29
30
  DoWhileStatement,
30
31
  EmptyStatement,
31
32
  ExportAllDeclaration,
@@ -82,7 +83,12 @@ import {
82
83
  WithStatement,
83
84
  YieldExpression
84
85
  } from "estree";
85
- import { ServerOptions as ServerOptionsImport } from "http";
86
+ import { Dirent } from "fs";
87
+ import {
88
+ IncomingMessage,
89
+ ServerOptions as ServerOptionsImport,
90
+ ServerResponse
91
+ } from "http";
86
92
  import { ListenOptions, Server } from "net";
87
93
  import { validate as validateFunction } from "schema-utils";
88
94
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
@@ -161,14 +167,20 @@ declare interface AdditionalData {
161
167
  webpackAST: object;
162
168
  }
163
169
  declare class AggressiveMergingPlugin {
164
- constructor(options?: any);
165
- options: any;
170
+ constructor(options?: AggressiveMergingPluginOptions);
171
+ options: AggressiveMergingPluginOptions;
166
172
 
167
173
  /**
168
174
  * Apply the plugin
169
175
  */
170
176
  apply(compiler: Compiler): void;
171
177
  }
178
+ declare interface AggressiveMergingPluginOptions {
179
+ /**
180
+ * minimal size reduction to trigger merging
181
+ */
182
+ minSizeReduce?: number;
183
+ }
172
184
  declare class AggressiveSplittingPlugin {
173
185
  constructor(options?: AggressiveSplittingPluginOptions);
174
186
  options: AggressiveSplittingPluginOptions;
@@ -200,8 +212,9 @@ declare interface AggressiveSplittingPluginOptions {
200
212
  */
201
213
  minSize?: number;
202
214
  }
215
+ type Alias = string | false | string[];
203
216
  declare interface AliasOption {
204
- alias: string | false | string[];
217
+ alias: Alias;
205
218
  name: string;
206
219
  onlyModule?: boolean;
207
220
  }
@@ -223,6 +236,9 @@ declare interface ArgumentConfig {
223
236
  type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
224
237
  values?: any[];
225
238
  }
239
+ declare interface Assertions {
240
+ [index: string]: any;
241
+ }
226
242
  declare interface Asset {
227
243
  /**
228
244
  * the filename of the asset
@@ -335,18 +351,20 @@ declare interface AssetResourceGeneratorOptions {
335
351
  }
336
352
  declare class AsyncDependenciesBlock extends DependenciesBlock {
337
353
  constructor(
338
- groupOptions: RawChunkGroupOptions & { name?: string } & {
339
- entryOptions?: EntryOptions;
340
- },
341
- loc?: SyntheticDependencyLocation | RealDependencyLocation,
342
- request?: string
354
+ groupOptions:
355
+ | null
356
+ | (RawChunkGroupOptions & { name?: string } & {
357
+ entryOptions?: EntryOptions;
358
+ }),
359
+ loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
360
+ request?: null | string
343
361
  );
344
362
  groupOptions: RawChunkGroupOptions & { name?: string } & {
345
363
  entryOptions?: EntryOptions;
346
364
  };
347
- loc?: SyntheticDependencyLocation | RealDependencyLocation;
348
- request?: string;
349
- chunkName: string;
365
+ loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
366
+ request?: null | string;
367
+ chunkName?: string;
350
368
  module: any;
351
369
  }
352
370
  declare abstract class AsyncQueue<T, K, R> {
@@ -373,18 +391,28 @@ declare abstract class AsyncQueue<T, K, R> {
373
391
  clear(): void;
374
392
  }
375
393
  declare class AsyncWebAssemblyModulesPlugin {
376
- constructor(options?: any);
377
- options: any;
394
+ constructor(options: AsyncWebAssemblyModulesPluginOptions);
395
+ options: AsyncWebAssemblyModulesPluginOptions;
378
396
 
379
397
  /**
380
398
  * Apply the plugin
381
399
  */
382
400
  apply(compiler: Compiler): void;
383
- renderModule(module?: any, renderContext?: any, hooks?: any): any;
401
+ renderModule(
402
+ module: Module,
403
+ renderContext: WebAssemblyRenderContext,
404
+ hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
405
+ ): Source;
384
406
  static getCompilationHooks(
385
407
  compilation: Compilation
386
408
  ): CompilationHooksAsyncWebAssemblyModulesPlugin;
387
409
  }
410
+ declare interface AsyncWebAssemblyModulesPluginOptions {
411
+ /**
412
+ * mangle imports
413
+ */
414
+ mangleImports?: boolean;
415
+ }
388
416
  declare class AutomaticPrefetchPlugin {
389
417
  constructor();
390
418
 
@@ -452,16 +480,20 @@ declare interface BannerPluginOptions {
452
480
  }
453
481
  declare interface BaseResolveRequest {
454
482
  path: string | false;
483
+ context?: object;
455
484
  descriptionFilePath?: string;
456
485
  descriptionFileRoot?: string;
457
- descriptionFileData?: object;
486
+ descriptionFileData?: JsonObject;
458
487
  relativePath?: string;
459
488
  ignoreSymlinks?: boolean;
460
489
  fullySpecified?: boolean;
490
+ __innerRequest?: string;
491
+ __innerRequest_request?: string;
492
+ __innerRequest_relativePath?: string;
461
493
  }
462
494
  declare abstract class BasicEvaluatedExpression {
463
495
  type: number;
464
- range: [number, number];
496
+ range?: [number, number];
465
497
  falsy: boolean;
466
498
  truthy: boolean;
467
499
  nullish?: boolean;
@@ -476,14 +508,89 @@ declare abstract class BasicEvaluatedExpression {
476
508
  array?: any[];
477
509
  items?: BasicEvaluatedExpression[];
478
510
  options?: BasicEvaluatedExpression[];
479
- prefix?: BasicEvaluatedExpression;
480
- postfix?: BasicEvaluatedExpression;
481
- wrappedInnerExpressions: any;
511
+ prefix?: null | BasicEvaluatedExpression;
512
+ postfix?: null | BasicEvaluatedExpression;
513
+ wrappedInnerExpressions?: BasicEvaluatedExpression[];
482
514
  identifier?: string | VariableInfoInterface;
483
- rootInfo: VariableInfoInterface;
484
- getMembers: () => string[];
485
- getMembersOptionals: () => boolean[];
486
- expression: NodeEstreeIndex;
515
+ rootInfo?: string | VariableInfoInterface;
516
+ getMembers?: () => string[];
517
+ getMembersOptionals?: () => boolean[];
518
+ getMemberRanges?: () => [number, number][];
519
+ expression?:
520
+ | UnaryExpression
521
+ | ArrayExpression
522
+ | ArrowFunctionExpression
523
+ | AssignmentExpression
524
+ | AwaitExpression
525
+ | BinaryExpression
526
+ | SimpleCallExpression
527
+ | NewExpression
528
+ | ChainExpression
529
+ | ClassExpression
530
+ | ConditionalExpression
531
+ | FunctionExpression
532
+ | Identifier
533
+ | ImportExpression
534
+ | SimpleLiteral
535
+ | RegExpLiteral
536
+ | BigIntLiteral
537
+ | LogicalExpression
538
+ | MemberExpression
539
+ | MetaProperty
540
+ | ObjectExpression
541
+ | SequenceExpression
542
+ | TaggedTemplateExpression
543
+ | TemplateLiteral
544
+ | ThisExpression
545
+ | UpdateExpression
546
+ | YieldExpression
547
+ | FunctionDeclaration
548
+ | VariableDeclaration
549
+ | ClassDeclaration
550
+ | PrivateIdentifier
551
+ | ExpressionStatement
552
+ | BlockStatement
553
+ | StaticBlock
554
+ | EmptyStatement
555
+ | DebuggerStatement
556
+ | WithStatement
557
+ | ReturnStatement
558
+ | LabeledStatement
559
+ | BreakStatement
560
+ | ContinueStatement
561
+ | IfStatement
562
+ | SwitchStatement
563
+ | ThrowStatement
564
+ | TryStatement
565
+ | WhileStatement
566
+ | DoWhileStatement
567
+ | ForStatement
568
+ | ForInStatement
569
+ | ForOfStatement
570
+ | ImportDeclaration
571
+ | ExportNamedDeclaration
572
+ | ExportDefaultDeclaration
573
+ | ExportAllDeclaration
574
+ | MethodDefinition
575
+ | PropertyDefinition
576
+ | VariableDeclarator
577
+ | Program
578
+ | SwitchCase
579
+ | CatchClause
580
+ | ObjectPattern
581
+ | ArrayPattern
582
+ | RestElement
583
+ | AssignmentPattern
584
+ | SpreadElement
585
+ | Property
586
+ | AssignmentProperty
587
+ | ClassBody
588
+ | ImportSpecifier
589
+ | ImportDefaultSpecifier
590
+ | ImportNamespaceSpecifier
591
+ | ExportSpecifier
592
+ | Super
593
+ | TemplateElement;
487
594
  isUnknown(): boolean;
488
595
  isNull(): boolean;
489
596
  isUndefined(): boolean;
@@ -521,43 +628,196 @@ declare abstract class BasicEvaluatedExpression {
521
628
  * Can this expression have side effects?
522
629
  */
523
630
  couldHaveSideEffects(): boolean;
524
- asBool(): any;
631
+
632
+ /**
633
+ * Creates a boolean representation of this evaluated expression.
634
+ */
635
+ asBool(): undefined | boolean;
636
+
637
+ /**
638
+ * Creates a nullish coalescing representation of this evaluated expression.
639
+ */
525
640
  asNullish(): undefined | boolean;
526
- asString(): any;
527
- setString(string?: any): BasicEvaluatedExpression;
641
+
642
+ /**
643
+ * Creates a string representation of this evaluated expression.
644
+ */
645
+ asString(): undefined | string;
646
+ setString(string: string): BasicEvaluatedExpression;
528
647
  setUndefined(): BasicEvaluatedExpression;
529
648
  setNull(): BasicEvaluatedExpression;
530
- setNumber(number?: any): BasicEvaluatedExpression;
531
- setBigInt(bigint?: any): BasicEvaluatedExpression;
532
- setBoolean(bool?: any): BasicEvaluatedExpression;
533
- setRegExp(regExp?: any): BasicEvaluatedExpression;
649
+
650
+ /**
651
+ * Set's the value of this expression to a number
652
+ */
653
+ setNumber(number: number): BasicEvaluatedExpression;
654
+
655
+ /**
656
+ * Set's the value of this expression to a BigInt
657
+ */
658
+ setBigInt(bigint: bigint): BasicEvaluatedExpression;
659
+
660
+ /**
661
+ * Set's the value of this expression to a boolean
662
+ */
663
+ setBoolean(bool: boolean): BasicEvaluatedExpression;
664
+
665
+ /**
666
+ * Set's the value of this expression to a regular expression
667
+ */
668
+ setRegExp(regExp: RegExp): BasicEvaluatedExpression;
669
+
670
+ /**
671
+ * Set's the value of this expression to a particular identifier and its members.
672
+ */
534
673
  setIdentifier(
535
- identifier?: any,
536
- rootInfo?: any,
537
- getMembers?: any,
538
- getMembersOptionals?: any
674
+ identifier: string | VariableInfoInterface,
675
+ rootInfo: string | VariableInfoInterface,
676
+ getMembers: () => string[],
677
+ getMembersOptionals?: () => boolean[],
678
+ getMemberRanges?: () => [number, number][]
539
679
  ): BasicEvaluatedExpression;
680
+
681
+ /**
682
+ * Wraps an array of expressions with a prefix and postfix expression.
683
+ */
540
684
  setWrapped(
541
- prefix?: any,
542
- postfix?: any,
543
- innerExpressions?: any
685
+ prefix: undefined | null | BasicEvaluatedExpression,
686
+ postfix: undefined | null | BasicEvaluatedExpression,
687
+ innerExpressions: BasicEvaluatedExpression[]
544
688
  ): BasicEvaluatedExpression;
545
- setOptions(options?: any): BasicEvaluatedExpression;
546
- addOptions(options?: any): BasicEvaluatedExpression;
547
- setItems(items?: any): BasicEvaluatedExpression;
548
- setArray(array?: any): BasicEvaluatedExpression;
689
+
690
+ /**
691
+ * Stores the options of a conditional expression.
692
+ */
693
+ setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
694
+
695
+ /**
696
+ * Adds options to a conditional expression.
697
+ */
698
+ addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
699
+
700
+ /**
701
+ * Set's the value of this expression to an array of expressions.
702
+ */
703
+ setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
704
+
705
+ /**
706
+ * Set's the value of this expression to an array of strings.
707
+ */
708
+ setArray(array: string[]): BasicEvaluatedExpression;
709
+
710
+ /**
711
+ * Set's the value of this expression to a processed/unprocessed template string. Used
712
+ * for evaluating TemplateLiteral expressions in the JavaScript Parser.
713
+ */
549
714
  setTemplateString(
550
- quasis?: any,
551
- parts?: any,
552
- kind?: any
715
+ quasis: BasicEvaluatedExpression[],
716
+ parts: BasicEvaluatedExpression[],
717
+ kind: "raw" | "cooked"
553
718
  ): BasicEvaluatedExpression;
554
- templateStringKind: any;
719
+ templateStringKind?: "raw" | "cooked";
555
720
  setTruthy(): BasicEvaluatedExpression;
556
721
  setFalsy(): BasicEvaluatedExpression;
557
- setNullish(value?: any): BasicEvaluatedExpression;
558
- setRange(range?: any): BasicEvaluatedExpression;
722
+
723
+ /**
724
+ * Set's the value of the expression to nullish.
725
+ */
726
+ setNullish(value: boolean): BasicEvaluatedExpression;
727
+
728
+ /**
729
+ * Set's the range for the expression.
730
+ */
731
+ setRange(range: [number, number]): BasicEvaluatedExpression;
732
+
733
+ /**
734
+ * Set whether or not the expression has side effects.
735
+ */
559
736
  setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
560
- setExpression(expression?: any): BasicEvaluatedExpression;
737
+
738
+ /**
739
+ * Set the expression node for the expression.
740
+ */
741
+ setExpression(
742
+ expression?:
743
+ | UnaryExpression
744
+ | ArrayExpression
745
+ | ArrowFunctionExpression
746
+ | AssignmentExpression
747
+ | AwaitExpression
748
+ | BinaryExpression
749
+ | SimpleCallExpression
750
+ | NewExpression
751
+ | ChainExpression
752
+ | ClassExpression
753
+ | ConditionalExpression
754
+ | FunctionExpression
755
+ | Identifier
756
+ | ImportExpression
757
+ | SimpleLiteral
758
+ | RegExpLiteral
759
+ | BigIntLiteral
760
+ | LogicalExpression
761
+ | MemberExpression
762
+ | MetaProperty
763
+ | ObjectExpression
764
+ | SequenceExpression
765
+ | TaggedTemplateExpression
766
+ | TemplateLiteral
767
+ | ThisExpression
768
+ | UpdateExpression
769
+ | YieldExpression
770
+ | FunctionDeclaration
771
+ | VariableDeclaration
772
+ | ClassDeclaration
773
+ | PrivateIdentifier
774
+ | ExpressionStatement
775
+ | BlockStatement
776
+ | StaticBlock
777
+ | EmptyStatement
778
+ | DebuggerStatement
779
+ | WithStatement
780
+ | ReturnStatement
781
+ | LabeledStatement
782
+ | BreakStatement
783
+ | ContinueStatement
784
+ | IfStatement
785
+ | SwitchStatement
786
+ | ThrowStatement
787
+ | TryStatement
788
+ | WhileStatement
789
+ | DoWhileStatement
790
+ | ForStatement
791
+ | ForInStatement
792
+ | ForOfStatement
793
+ | ImportDeclaration
794
+ | ExportNamedDeclaration
795
+ | ExportDefaultDeclaration
796
+ | ExportAllDeclaration
797
+ | MethodDefinition
798
+ | PropertyDefinition
799
+ | VariableDeclarator
800
+ | Program
801
+ | SwitchCase
802
+ | CatchClause
803
+ | ObjectPattern
804
+ | ArrayPattern
805
+ | RestElement
806
+ | AssignmentPattern
807
+ | SpreadElement
808
+ | Property
809
+ | AssignmentProperty
810
+ | ClassBody
811
+ | ImportSpecifier
812
+ | ImportDefaultSpecifier
813
+ | ImportNamespaceSpecifier
814
+ | ExportSpecifier
815
+ | Super
816
+ | TemplateElement
817
+ ): BasicEvaluatedExpression;
818
+ }
819
+ declare interface BuildInfo {
820
+ [index: string]: any;
561
821
  }
562
822
  type BuildMeta = KnownBuildMeta & Record<string, any>;
563
823
  declare abstract class ByTypeGenerator extends Generator {
@@ -650,7 +910,7 @@ declare interface CacheGroupSource {
650
910
  chunks?: Chunk[],
651
911
  key?: string
652
912
  ) => undefined | string;
653
- chunksFilter?: (chunk: Chunk) => boolean;
913
+ chunksFilter?: (chunk: Chunk) => undefined | boolean;
654
914
  enforce?: boolean;
655
915
  minSize: SplitChunksSizes;
656
916
  minSizeReduction: SplitChunksSizes;
@@ -663,7 +923,7 @@ declare interface CacheGroupSource {
663
923
  maxInitialRequests?: number;
664
924
  filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
665
925
  idHint?: string;
666
- automaticNameDelimiter: string;
926
+ automaticNameDelimiter?: string;
667
927
  reuseExistingChunk?: boolean;
668
928
  usedExports?: boolean;
669
929
  }
@@ -689,6 +949,7 @@ declare interface CallExpressionInfo {
689
949
  name: string;
690
950
  getMembers: () => string[];
691
951
  getMembersOptionals: () => boolean[];
952
+ getMemberRanges: () => [number, number][];
692
953
  }
693
954
  declare interface CallbackAsyncQueue<T> {
694
955
  (err?: null | WebpackError, result?: T): any;
@@ -709,19 +970,13 @@ type Cell<T> = undefined | T;
709
970
  declare class Chunk {
710
971
  constructor(name?: string, backCompat?: boolean);
711
972
  id: null | string | number;
712
- ids: null | (string | number)[];
973
+ ids: null | ChunkId[];
713
974
  debugId: number;
714
- name: string;
975
+ name?: string;
715
976
  idNameHints: SortableSet<string>;
716
977
  preventIntegration: boolean;
717
- filenameTemplate:
718
- | null
719
- | string
720
- | ((arg0: PathData, arg1?: AssetInfo) => string);
721
- cssFilenameTemplate:
722
- | null
723
- | string
724
- | ((arg0: PathData, arg1?: AssetInfo) => string);
978
+ filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
979
+ cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
725
980
  runtime: RuntimeSpec;
726
981
  files: Set<string>;
727
982
  auxiliaryFiles: Set<string>;
@@ -762,7 +1017,7 @@ declare class Chunk {
762
1017
  removeGroup(chunkGroup: ChunkGroup): void;
763
1018
  isInGroup(chunkGroup: ChunkGroup): boolean;
764
1019
  getNumberOfGroups(): number;
765
- get groupsIterable(): Iterable<ChunkGroup>;
1020
+ get groupsIterable(): SortableSet<ChunkGroup>;
766
1021
  disconnectFromGroups(): void;
767
1022
  split(newChunk: Chunk): void;
768
1023
  updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
@@ -778,7 +1033,7 @@ declare class Chunk {
778
1033
  getChildrenOfTypeInOrder(
779
1034
  chunkGraph: ChunkGraph,
780
1035
  type: string
781
- ): { onChunks: Chunk[]; chunks: Set<Chunk> }[];
1036
+ ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
782
1037
  getChildIdsByOrdersMap(
783
1038
  chunkGraph: ChunkGraph,
784
1039
  includeDirectChildren?: boolean,
@@ -966,7 +1221,7 @@ declare abstract class ChunkGroup {
966
1221
  options: ChunkGroupOptions;
967
1222
  chunks: Chunk[];
968
1223
  origins: OriginRecord[];
969
- index: number;
1224
+ index?: number;
970
1225
 
971
1226
  /**
972
1227
  * when a new chunk is added to a chunkGroup, addingOptions will occur.
@@ -1019,9 +1274,9 @@ declare abstract class ChunkGroup {
1019
1274
  removeParent(chunkGroup: ChunkGroup): boolean;
1020
1275
  addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
1021
1276
  get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
1022
- getBlocks(): any[];
1277
+ getBlocks(): AsyncDependenciesBlock[];
1023
1278
  getNumberOfBlocks(): number;
1024
- hasBlock(block?: any): boolean;
1279
+ hasBlock(block: AsyncDependenciesBlock): boolean;
1025
1280
  get blocksIterable(): Iterable<AsyncDependenciesBlock>;
1026
1281
  addBlock(block: AsyncDependenciesBlock): boolean;
1027
1282
  addOrigin(module: Module, loc: DependencyLocation, request: string): void;
@@ -1047,7 +1302,7 @@ declare abstract class ChunkGroup {
1047
1302
  /**
1048
1303
  * Gets the top-down index of a module in this ChunkGroup
1049
1304
  */
1050
- getModulePreOrderIndex(module: Module): number;
1305
+ getModulePreOrderIndex(module: Module): undefined | number;
1051
1306
 
1052
1307
  /**
1053
1308
  * Sets the bottom-up index of a module in this ChunkGroup
@@ -1057,10 +1312,10 @@ declare abstract class ChunkGroup {
1057
1312
  /**
1058
1313
  * Gets the bottom-up index of a module in this ChunkGroup
1059
1314
  */
1060
- getModulePostOrderIndex(module: Module): number;
1315
+ getModulePostOrderIndex(module: Module): undefined | number;
1061
1316
  checkConstraints(): void;
1062
- getModuleIndex: (module: Module) => number;
1063
- getModuleIndex2: (module: Module) => number;
1317
+ getModuleIndex: (module: Module) => undefined | number;
1318
+ getModuleIndex2: (module: Module) => undefined | number;
1064
1319
  }
1065
1320
  type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
1066
1321
  declare interface ChunkHashContext {
@@ -1084,20 +1339,42 @@ declare interface ChunkHashContext {
1084
1339
  */
1085
1340
  chunkGraph: ChunkGraph;
1086
1341
  }
1342
+ type ChunkId = string | number;
1087
1343
  declare interface ChunkMaps {
1088
1344
  hash: Record<string | number, string>;
1089
1345
  contentHash: Record<string | number, Record<string, string>>;
1090
1346
  name: Record<string | number, string>;
1091
1347
  }
1092
1348
  declare class ChunkModuleIdRangePlugin {
1093
- constructor(options?: any);
1094
- options: any;
1349
+ constructor(options: ChunkModuleIdRangePluginOptions);
1350
+ options: ChunkModuleIdRangePluginOptions;
1095
1351
 
1096
1352
  /**
1097
1353
  * Apply the plugin
1098
1354
  */
1099
1355
  apply(compiler: Compiler): void;
1100
1356
  }
1357
+ declare interface ChunkModuleIdRangePluginOptions {
1358
+ /**
1359
+ * the chunk name
1360
+ */
1361
+ name: string;
1362
+
1363
+ /**
1364
+ * order
1365
+ */
1366
+ order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
1367
+
1368
+ /**
1369
+ * start id
1370
+ */
1371
+ start?: number;
1372
+
1373
+ /**
1374
+ * end id
1375
+ */
1376
+ end?: number;
1377
+ }
1101
1378
  declare interface ChunkModuleMaps {
1102
1379
  id: Record<string | number, (string | number)[]>;
1103
1380
  hash: Record<string | number, string>;
@@ -1375,6 +1652,11 @@ declare class Compilation {
1375
1652
  unseal: SyncHook<[]>;
1376
1653
  seal: SyncHook<[]>;
1377
1654
  beforeChunks: SyncHook<[]>;
1655
+ /**
1656
+ * The `afterChunks` hook is called directly after the chunks and module graph have
1657
+ * been created and before the chunks and modules have been optimized. This hook is useful to
1658
+ * inspect, analyze, and/or modify the chunk graph.
1659
+ */
1378
1660
  afterChunks: SyncHook<[Iterable<Chunk>]>;
1379
1661
  optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
1380
1662
  afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
@@ -1390,7 +1672,7 @@ declare class Compilation {
1390
1672
  any
1391
1673
  >;
1392
1674
  afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
1393
- shouldRecord: SyncBailHook<[], boolean>;
1675
+ shouldRecord: SyncBailHook<[], undefined | boolean>;
1394
1676
  additionalChunkRuntimeRequirements: SyncHook<
1395
1677
  [Chunk, Set<string>, RuntimeRequirementsContext]
1396
1678
  >;
@@ -1898,8 +2180,8 @@ declare interface CompilationHooksJavascriptModulesPlugin {
1898
2180
  [Module, RenderBootstrapContext],
1899
2181
  string
1900
2182
  >;
1901
- embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
1902
- strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
2183
+ embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
2184
+ strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
1903
2185
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
1904
2186
  useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
1905
2187
  }
@@ -1914,7 +2196,7 @@ declare class Compiler {
1914
2196
  constructor(context: string, options?: WebpackOptionsNormalized);
1915
2197
  hooks: Readonly<{
1916
2198
  initialize: SyncHook<[]>;
1917
- shouldEmit: SyncBailHook<[Compilation], boolean>;
2199
+ shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
1918
2200
  done: AsyncSeriesHook<[Stats]>;
1919
2201
  afterDone: SyncHook<[Stats]>;
1920
2202
  additionalPass: AsyncSeriesHook<[]>;
@@ -2066,7 +2348,7 @@ declare class ConcatenationScope {
2066
2348
  static isModuleReference(name: string): boolean;
2067
2349
  static matchModuleReference(
2068
2350
  name: string
2069
- ): ModuleReferenceOptions & { index: number };
2351
+ ): null | (ModuleReferenceOptions & { index: number });
2070
2352
  static DEFAULT_EXPORT: string;
2071
2353
  static NAMESPACE_OBJECT_EXPORT: string;
2072
2354
  }
@@ -2119,6 +2401,11 @@ declare interface Configuration {
2119
2401
  */
2120
2402
  experiments?: Experiments;
2121
2403
 
2404
+ /**
2405
+ * Extend configuration from another configuration (only works when using webpack-cli).
2406
+ */
2407
+ extends?: string | string[];
2408
+
2122
2409
  /**
2123
2410
  * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
2124
2411
  */
@@ -2243,6 +2530,11 @@ declare interface Configuration {
2243
2530
  * Add additional plugins to the compiler.
2244
2531
  */
2245
2532
  plugins?: (
2533
+ | undefined
2534
+ | null
2535
+ | false
2536
+ | ""
2537
+ | 0
2246
2538
  | ((this: Compiler, compiler: Compiler) => void)
2247
2539
  | WebpackPluginInstance
2248
2540
  )[];
@@ -2320,7 +2612,7 @@ declare class ConstDependency extends NullDependency {
2320
2612
  constructor(
2321
2613
  expression: string,
2322
2614
  range: number | [number, number],
2323
- runtimeRequirements?: string[]
2615
+ runtimeRequirements?: null | string[]
2324
2616
  );
2325
2617
  expression: string;
2326
2618
  range: number | [number, number];
@@ -2550,7 +2842,8 @@ declare interface ContextModuleOptions {
2550
2842
  /**
2551
2843
  * exports referenced from modules (won't be mangled)
2552
2844
  */
2553
- referencedExports?: string[][];
2845
+ referencedExports?: null | string[][];
2846
+ layer?: string;
2554
2847
  resource: string | false | string[];
2555
2848
  resourceQuery?: string;
2556
2849
  resourceFragment?: string;
@@ -2558,18 +2851,22 @@ declare interface ContextModuleOptions {
2558
2851
  }
2559
2852
  declare class ContextReplacementPlugin {
2560
2853
  constructor(
2561
- resourceRegExp?: any,
2854
+ resourceRegExp: RegExp,
2562
2855
  newContentResource?: any,
2563
2856
  newContentRecursive?: any,
2564
2857
  newContentRegExp?: any
2565
2858
  );
2566
- resourceRegExp: any;
2859
+ resourceRegExp: RegExp;
2567
2860
  newContentCallback: any;
2568
2861
  newContentResource: any;
2569
2862
  newContentCreateContextMap: any;
2570
2863
  newContentRecursive: any;
2571
2864
  newContentRegExp: any;
2572
- apply(compiler?: any): void;
2865
+
2866
+ /**
2867
+ * Apply the plugin
2868
+ */
2869
+ apply(compiler: Compiler): void;
2573
2870
  }
2574
2871
  declare interface ContextTimestampAndHash {
2575
2872
  safeTime: number;
@@ -2626,7 +2923,7 @@ declare interface DepConstructor {
2626
2923
  declare abstract class DependenciesBlock {
2627
2924
  dependencies: Dependency[];
2628
2925
  blocks: AsyncDependenciesBlock[];
2629
- parent: DependenciesBlock;
2926
+ parent?: DependenciesBlock;
2630
2927
  getRootBlock(): DependenciesBlock;
2631
2928
 
2632
2929
  /**
@@ -2642,8 +2939,8 @@ declare abstract class DependenciesBlock {
2642
2939
  */
2643
2940
  clearDependenciesAndBlocks(): void;
2644
2941
  updateHash(hash: Hash, context: UpdateHashContextDependency): void;
2645
- serialize(__0: { write: any }): void;
2646
- deserialize(__0: { read: any }): void;
2942
+ serialize(__0: ObjectSerializerContext): void;
2943
+ deserialize(__0: ObjectDeserializerContext): void;
2647
2944
  }
2648
2945
  declare interface DependenciesBlockLike {
2649
2946
  dependencies: Dependency[];
@@ -2657,10 +2954,10 @@ declare class Dependency {
2657
2954
  get category(): string;
2658
2955
  loc: DependencyLocation;
2659
2956
  setLoc(
2660
- startLine?: any,
2661
- startColumn?: any,
2662
- endLine?: any,
2663
- endColumn?: any
2957
+ startLine: number,
2958
+ startColumn: number,
2959
+ endLine: number,
2960
+ endColumn: number
2664
2961
  ): void;
2665
2962
  getContext(): undefined | string;
2666
2963
  getResourceIdentifier(): null | string;
@@ -2693,12 +2990,12 @@ declare class Dependency {
2693
2990
  /**
2694
2991
  * Returns warnings
2695
2992
  */
2696
- getWarnings(moduleGraph: ModuleGraph): WebpackError[];
2993
+ getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2697
2994
 
2698
2995
  /**
2699
2996
  * Returns errors
2700
2997
  */
2701
- getErrors(moduleGraph: ModuleGraph): WebpackError[];
2998
+ getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2702
2999
 
2703
3000
  /**
2704
3001
  * Update the hash
@@ -2712,9 +3009,9 @@ declare class Dependency {
2712
3009
  getModuleEvaluationSideEffectsState(
2713
3010
  moduleGraph: ModuleGraph
2714
3011
  ): ConnectionState;
2715
- createIgnoredModule(context: string): Module;
2716
- serialize(__0: { write: any }): void;
2717
- deserialize(__0: { read: any }): void;
3012
+ createIgnoredModule(context: string): null | Module;
3013
+ serialize(__0: ObjectSerializerContext): void;
3014
+ deserialize(__0: ObjectDeserializerContext): void;
2718
3015
  module: any;
2719
3016
  get disconnect(): any;
2720
3017
  static NO_EXPORTS_REFERENCED: string[][];
@@ -2795,98 +3092,90 @@ declare abstract class DependencyTemplates {
2795
3092
  clone(): DependencyTemplates;
2796
3093
  }
2797
3094
  declare class DeterministicChunkIdsPlugin {
2798
- constructor(options?: any);
2799
- options: any;
3095
+ constructor(options?: DeterministicChunkIdsPluginOptions);
3096
+ options: DeterministicChunkIdsPluginOptions;
2800
3097
 
2801
3098
  /**
2802
3099
  * Apply the plugin
2803
3100
  */
2804
3101
  apply(compiler: Compiler): void;
2805
3102
  }
3103
+ declare interface DeterministicChunkIdsPluginOptions {
3104
+ /**
3105
+ * context for ids
3106
+ */
3107
+ context?: string;
3108
+
3109
+ /**
3110
+ * maximum length of ids
3111
+ */
3112
+ maxLength?: number;
3113
+ }
2806
3114
  declare class DeterministicModuleIdsPlugin {
2807
- constructor(options?: {
3115
+ constructor(options?: DeterministicModuleIdsPluginOptions);
3116
+ options: DeterministicModuleIdsPluginOptions;
3117
+
3118
+ /**
3119
+ * Apply the plugin
3120
+ */
3121
+ apply(compiler: Compiler): void;
3122
+ }
3123
+ declare interface DeterministicModuleIdsPluginOptions {
3124
+ /**
3125
+ * context relative to which module identifiers are computed
3126
+ */
3127
+ context?: string;
3128
+
3129
+ /**
3130
+ * selector function for modules
3131
+ */
3132
+ test?: (arg0: Module) => boolean;
3133
+
3134
+ /**
3135
+ * maximum id length in digits (used as starting point)
3136
+ */
3137
+ maxLength?: number;
3138
+
3139
+ /**
3140
+ * hash salt for ids
3141
+ */
3142
+ salt?: number;
3143
+
3144
+ /**
3145
+ * do not increase the maxLength to find an optimal id space size
3146
+ */
3147
+ fixedLength?: boolean;
3148
+
3149
+ /**
3150
+ * throw an error when id conflicts occur (instead of rehashing)
3151
+ */
3152
+ failOnConflict?: boolean;
3153
+ }
3154
+
3155
+ /**
3156
+ * Options for the webpack-dev-server.
3157
+ */
3158
+ declare interface DevServer {
3159
+ [index: string]: any;
3160
+ }
3161
+ declare class DllPlugin {
3162
+ constructor(options: DllPluginOptions);
3163
+ options: {
3164
+ entryOnly: boolean;
2808
3165
  /**
2809
- * context relative to which module identifiers are computed
3166
+ * Context of requests in the manifest file (defaults to the webpack context).
2810
3167
  */
2811
3168
  context?: string;
2812
3169
  /**
2813
- * selector function for modules
3170
+ * If true, manifest json file (output) will be formatted.
2814
3171
  */
2815
- test?: (arg0: Module) => boolean;
3172
+ format?: boolean;
2816
3173
  /**
2817
- * maximum id length in digits (used as starting point)
3174
+ * Name of the exposed dll function (external name, use value of 'output.library').
2818
3175
  */
2819
- maxLength?: number;
3176
+ name?: string;
2820
3177
  /**
2821
- * hash salt for ids
2822
- */
2823
- salt?: number;
2824
- /**
2825
- * do not increase the maxLength to find an optimal id space size
2826
- */
2827
- fixedLength?: boolean;
2828
- /**
2829
- * throw an error when id conflicts occur (instead of rehashing)
2830
- */
2831
- failOnConflict?: boolean;
2832
- });
2833
- options: {
2834
- /**
2835
- * context relative to which module identifiers are computed
2836
- */
2837
- context?: string;
2838
- /**
2839
- * selector function for modules
2840
- */
2841
- test?: (arg0: Module) => boolean;
2842
- /**
2843
- * maximum id length in digits (used as starting point)
2844
- */
2845
- maxLength?: number;
2846
- /**
2847
- * hash salt for ids
2848
- */
2849
- salt?: number;
2850
- /**
2851
- * do not increase the maxLength to find an optimal id space size
2852
- */
2853
- fixedLength?: boolean;
2854
- /**
2855
- * throw an error when id conflicts occur (instead of rehashing)
2856
- */
2857
- failOnConflict?: boolean;
2858
- };
2859
-
2860
- /**
2861
- * Apply the plugin
2862
- */
2863
- apply(compiler: Compiler): void;
2864
- }
2865
-
2866
- /**
2867
- * Options for the webpack-dev-server.
2868
- */
2869
- declare interface DevServer {
2870
- [index: string]: any;
2871
- }
2872
- declare class DllPlugin {
2873
- constructor(options: DllPluginOptions);
2874
- options: {
2875
- entryOnly: boolean;
2876
- /**
2877
- * Context of requests in the manifest file (defaults to the webpack context).
2878
- */
2879
- context?: string;
2880
- /**
2881
- * If true, manifest json file (output) will be formatted.
2882
- */
2883
- format?: boolean;
2884
- /**
2885
- * Name of the exposed dll function (external name, use value of 'output.library').
2886
- */
2887
- name?: string;
2888
- /**
2889
- * Absolute path to the manifest json file (output).
3178
+ * Absolute path to the manifest json file (output).
2890
3179
  */
2891
3180
  path: string;
2892
3181
  /**
@@ -2934,7 +3223,11 @@ declare interface DllPluginOptions {
2934
3223
  declare class DllReferencePlugin {
2935
3224
  constructor(options: DllReferencePluginOptions);
2936
3225
  options: DllReferencePluginOptions;
2937
- apply(compiler?: any): void;
3226
+
3227
+ /**
3228
+ * Apply the plugin
3229
+ */
3230
+ apply(compiler: Compiler): void;
2938
3231
  }
2939
3232
  type DllReferencePluginOptions =
2940
3233
  | {
@@ -3394,11 +3687,21 @@ declare interface Environment {
3394
3687
  */
3395
3688
  dynamicImport?: boolean;
3396
3689
 
3690
+ /**
3691
+ * The environment supports an async import() is available when creating a worker.
3692
+ */
3693
+ dynamicImportInWorker?: boolean;
3694
+
3397
3695
  /**
3398
3696
  * The environment supports 'for of' iteration ('for (const x of array) { ... }').
3399
3697
  */
3400
3698
  forOf?: boolean;
3401
3699
 
3700
+ /**
3701
+ * The environment supports 'globalThis'.
3702
+ */
3703
+ globalThis?: boolean;
3704
+
3402
3705
  /**
3403
3706
  * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
3404
3707
  */
@@ -3424,6 +3727,7 @@ declare class EnvironmentPlugin {
3424
3727
  */
3425
3728
  apply(compiler: Compiler): void;
3426
3729
  }
3730
+ type ErrorWithDetail = Error & { details?: string };
3427
3731
  declare interface Etag {
3428
3732
  toString: () => string;
3429
3733
  }
@@ -3825,38 +4129,39 @@ declare interface ExposesObject {
3825
4129
  }
3826
4130
  type Expression =
3827
4131
  | UnaryExpression
3828
- | ThisExpression
3829
4132
  | ArrayExpression
3830
- | ObjectExpression
3831
- | FunctionExpression
3832
4133
  | ArrowFunctionExpression
3833
- | YieldExpression
4134
+ | AssignmentExpression
4135
+ | AwaitExpression
4136
+ | BinaryExpression
4137
+ | SimpleCallExpression
4138
+ | NewExpression
4139
+ | ChainExpression
4140
+ | ClassExpression
4141
+ | ConditionalExpression
4142
+ | FunctionExpression
4143
+ | Identifier
4144
+ | ImportExpression
3834
4145
  | SimpleLiteral
3835
4146
  | RegExpLiteral
3836
4147
  | BigIntLiteral
3837
- | UpdateExpression
3838
- | BinaryExpression
3839
- | AssignmentExpression
3840
4148
  | LogicalExpression
3841
4149
  | MemberExpression
3842
- | ConditionalExpression
3843
- | SimpleCallExpression
3844
- | NewExpression
4150
+ | MetaProperty
4151
+ | ObjectExpression
3845
4152
  | SequenceExpression
3846
- | TemplateLiteral
3847
4153
  | TaggedTemplateExpression
3848
- | ClassExpression
3849
- | MetaProperty
3850
- | Identifier
3851
- | AwaitExpression
3852
- | ImportExpression
3853
- | ChainExpression;
4154
+ | TemplateLiteral
4155
+ | ThisExpression
4156
+ | UpdateExpression
4157
+ | YieldExpression;
3854
4158
  declare interface ExpressionExpressionInfo {
3855
4159
  type: "expression";
3856
4160
  rootInfo: string | VariableInfo;
3857
4161
  name: string;
3858
4162
  getMembers: () => string[];
3859
4163
  getMembersOptionals: () => boolean[];
4164
+ getMemberRanges: () => [number, number][];
3860
4165
  }
3861
4166
  declare interface ExtensionAliasOption {
3862
4167
  alias: string | string[];
@@ -3936,7 +4241,11 @@ declare interface ExternalItemObjectUnknown {
3936
4241
  }
3937
4242
  type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
3938
4243
  declare class ExternalModule extends Module {
3939
- constructor(request?: any, type?: any, userRequest?: any);
4244
+ constructor(
4245
+ request: string | string[] | Record<string, string | string[]>,
4246
+ type: any,
4247
+ userRequest: string
4248
+ );
3940
4249
  request: string | string[] | Record<string, string | string[]>;
3941
4250
  externalType: string;
3942
4251
  userRequest: string;
@@ -4052,10 +4361,13 @@ declare interface FactorizeModuleOptions {
4052
4361
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
4053
4362
  context?: string;
4054
4363
  }
4364
+ declare interface FactoryMeta {
4365
+ sideEffectFree?: boolean;
4366
+ }
4055
4367
  type FakeHook<T> = T & FakeHookMarker;
4056
4368
  declare interface FakeHookMarker {}
4057
4369
  declare interface FallbackCacheGroup {
4058
- chunksFilter: (chunk: Chunk) => boolean;
4370
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
4059
4371
  minSize: SplitChunksSizes;
4060
4372
  maxAsyncSize: SplitChunksSizes;
4061
4373
  maxInitialSize: SplitChunksSizes;
@@ -4070,14 +4382,20 @@ declare class FetchCompileAsyncWasmPlugin {
4070
4382
  apply(compiler: Compiler): void;
4071
4383
  }
4072
4384
  declare class FetchCompileWasmPlugin {
4073
- constructor(options?: any);
4074
- options: any;
4385
+ constructor(options?: FetchCompileWasmPluginOptions);
4386
+ options: FetchCompileWasmPluginOptions;
4075
4387
 
4076
4388
  /**
4077
4389
  * Apply the plugin
4078
4390
  */
4079
4391
  apply(compiler: Compiler): void;
4080
4392
  }
4393
+ declare interface FetchCompileWasmPluginOptions {
4394
+ /**
4395
+ * mangle imports
4396
+ */
4397
+ mangleImports?: boolean;
4398
+ }
4081
4399
 
4082
4400
  /**
4083
4401
  * Options object for persistent file-based caching.
@@ -4163,6 +4481,11 @@ declare interface FileCacheOptions {
4163
4481
  */
4164
4482
  profile?: boolean;
4165
4483
 
4484
+ /**
4485
+ * Enable/disable readonly mode.
4486
+ */
4487
+ readonly?: boolean;
4488
+
4166
4489
  /**
4167
4490
  * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
4168
4491
  */
@@ -4187,17 +4510,32 @@ declare interface FileSystem {
4187
4510
  arg2: FileSystemCallback<string | Buffer>
4188
4511
  ): void;
4189
4512
  };
4190
- readdir: {
4191
- (
4192
- arg0: string,
4193
- arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
4194
- ): void;
4195
- (
4196
- arg0: string,
4197
- arg1: object,
4198
- arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
4199
- ): void;
4200
- };
4513
+ readdir: (
4514
+ arg0: string,
4515
+ arg1?:
4516
+ | null
4517
+ | "ascii"
4518
+ | "utf8"
4519
+ | "utf16le"
4520
+ | "ucs2"
4521
+ | "latin1"
4522
+ | "binary"
4523
+ | ((
4524
+ arg0?: null | NodeJS.ErrnoException,
4525
+ arg1?: (string | Buffer)[] | (typeof Dirent)[]
4526
+ ) => void)
4527
+ | ReaddirOptions
4528
+ | "utf-8"
4529
+ | "ucs-2"
4530
+ | "base64"
4531
+ | "base64url"
4532
+ | "hex"
4533
+ | "buffer",
4534
+ arg2?: (
4535
+ arg0?: null | NodeJS.ErrnoException,
4536
+ arg1?: (string | Buffer)[] | (typeof Dirent)[]
4537
+ ) => void
4538
+ ) => void;
4201
4539
  readJson?: {
4202
4540
  (arg0: string, arg1: FileSystemCallback<object>): void;
4203
4541
  (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
@@ -4230,11 +4568,6 @@ declare interface FileSystem {
4230
4568
  declare interface FileSystemCallback<T> {
4231
4569
  (err?: null | (PossibleFileSystemError & Error), result?: T): any;
4232
4570
  }
4233
- declare interface FileSystemDirent {
4234
- name: string | Buffer;
4235
- isDirectory: () => boolean;
4236
- isFile: () => boolean;
4237
- }
4238
4571
  declare abstract class FileSystemInfo {
4239
4572
  fs: InputFileSystem;
4240
4573
  logger?: WebpackLogger;
@@ -4521,11 +4854,7 @@ declare interface HandleModuleCreationOptions {
4521
4854
  connectOrigin?: boolean;
4522
4855
  }
4523
4856
  declare class HarmonyImportDependency extends ModuleDependency {
4524
- constructor(
4525
- request: string,
4526
- sourceOrder: number,
4527
- assertions?: Record<string, any>
4528
- );
4857
+ constructor(request: string, sourceOrder: number, assertions?: Assertions);
4529
4858
  sourceOrder: number;
4530
4859
  getImportVar(moduleGraph: ModuleGraph): string;
4531
4860
  getImportStatement(
@@ -4575,7 +4904,11 @@ declare interface HashableObject {
4575
4904
  declare class HashedModuleIdsPlugin {
4576
4905
  constructor(options?: HashedModuleIdsPluginOptions);
4577
4906
  options: HashedModuleIdsPluginOptions;
4578
- apply(compiler?: any): void;
4907
+
4908
+ /**
4909
+ * Apply the plugin
4910
+ */
4911
+ apply(compiler: Compiler): void;
4579
4912
  }
4580
4913
  declare interface HashedModuleIdsPluginOptions {
4581
4914
  /**
@@ -4586,7 +4919,7 @@ declare interface HashedModuleIdsPluginOptions {
4586
4919
  /**
4587
4920
  * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
4588
4921
  */
4589
- hashDigest?: "latin1" | "hex" | "base64";
4922
+ hashDigest?: "latin1" | "base64" | "hex";
4590
4923
 
4591
4924
  /**
4592
4925
  * The prefix length of the hash digest to use, defaults to 4.
@@ -4802,8 +5135,8 @@ declare abstract class InitFragment<Context> {
4802
5135
  endContent?: string | Source;
4803
5136
  getContent(context: Context): string | Source;
4804
5137
  getEndContent(context: Context): undefined | string | Source;
4805
- serialize(context?: any): void;
4806
- deserialize(context?: any): void;
5138
+ serialize(context: ObjectSerializerContext): void;
5139
+ deserialize(context: ObjectDeserializerContext): void;
4807
5140
  merge: any;
4808
5141
  }
4809
5142
  declare interface InputFileSystem {
@@ -4946,13 +5279,13 @@ declare class JavascriptParser extends Parser {
4946
5279
  >;
4947
5280
  evaluateIdentifier: HookMap<
4948
5281
  SyncBailHook<
4949
- [ThisExpression | MemberExpression | MetaProperty | Identifier],
5282
+ [Identifier | MemberExpression | MetaProperty | ThisExpression],
4950
5283
  undefined | null | BasicEvaluatedExpression
4951
5284
  >
4952
5285
  >;
4953
5286
  evaluateDefinedIdentifier: HookMap<
4954
5287
  SyncBailHook<
4955
- [ThisExpression | MemberExpression | Identifier],
5288
+ [Identifier | MemberExpression | ThisExpression],
4956
5289
  undefined | null | BasicEvaluatedExpression
4957
5290
  >
4958
5291
  >;
@@ -4976,32 +5309,32 @@ declare class JavascriptParser extends Parser {
4976
5309
  [
4977
5310
  (
4978
5311
  | UnaryExpression
4979
- | ThisExpression
4980
5312
  | ArrayExpression
4981
- | ObjectExpression
4982
- | FunctionExpression
4983
5313
  | ArrowFunctionExpression
4984
- | YieldExpression
5314
+ | AssignmentExpression
5315
+ | AwaitExpression
5316
+ | BinaryExpression
5317
+ | SimpleCallExpression
5318
+ | NewExpression
5319
+ | ChainExpression
5320
+ | ClassExpression
5321
+ | ConditionalExpression
5322
+ | FunctionExpression
5323
+ | Identifier
5324
+ | ImportExpression
4985
5325
  | SimpleLiteral
4986
5326
  | RegExpLiteral
4987
5327
  | BigIntLiteral
4988
- | UpdateExpression
4989
- | BinaryExpression
4990
- | AssignmentExpression
4991
5328
  | LogicalExpression
4992
5329
  | MemberExpression
4993
- | ConditionalExpression
4994
- | SimpleCallExpression
4995
- | NewExpression
5330
+ | MetaProperty
5331
+ | ObjectExpression
4996
5332
  | SequenceExpression
4997
- | TemplateLiteral
4998
5333
  | TaggedTemplateExpression
4999
- | ClassExpression
5000
- | MetaProperty
5001
- | Identifier
5002
- | AwaitExpression
5003
- | ImportExpression
5004
- | ChainExpression
5334
+ | TemplateLiteral
5335
+ | ThisExpression
5336
+ | UpdateExpression
5337
+ | YieldExpression
5005
5338
  | FunctionDeclaration
5006
5339
  | VariableDeclaration
5007
5340
  | ClassDeclaration
@@ -5112,7 +5445,7 @@ declare class JavascriptParser extends Parser {
5112
5445
  >;
5113
5446
  classBodyElement: SyncBailHook<
5114
5447
  [
5115
- MethodDefinition | PropertyDefinition,
5448
+ StaticBlock | MethodDefinition | PropertyDefinition,
5116
5449
  ClassExpression | ClassDeclaration
5117
5450
  ],
5118
5451
  boolean | void
@@ -5183,11 +5516,14 @@ declare class JavascriptParser extends Parser {
5183
5516
  SyncBailHook<[AssignmentExpression, string[]], boolean | void>
5184
5517
  >;
5185
5518
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
5186
- importCall: SyncBailHook<[Expression], boolean | void>;
5519
+ importCall: SyncBailHook<[ImportExpression], boolean | void>;
5187
5520
  topLevelAwait: SyncBailHook<[Expression], boolean | void>;
5188
- call: HookMap<SyncBailHook<[Expression], boolean | void>>;
5521
+ call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
5189
5522
  callMemberChain: HookMap<
5190
- SyncBailHook<[CallExpression, string[], boolean[]], boolean | void>
5523
+ SyncBailHook<
5524
+ [CallExpression, string[], boolean[], [number, number][]],
5525
+ boolean | void
5526
+ >
5191
5527
  >;
5192
5528
  memberChainOfCallMemberChain: HookMap<
5193
5529
  SyncBailHook<
@@ -5197,7 +5533,7 @@ declare class JavascriptParser extends Parser {
5197
5533
  >;
5198
5534
  callMemberChainOfCallMemberChain: HookMap<
5199
5535
  SyncBailHook<
5200
- [Expression, string[], CallExpression, string[]],
5536
+ [CallExpression, string[], CallExpression, string[]],
5201
5537
  boolean | void
5202
5538
  >
5203
5539
  >;
@@ -5206,13 +5542,22 @@ declare class JavascriptParser extends Parser {
5206
5542
  binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
5207
5543
  expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
5208
5544
  expressionMemberChain: HookMap<
5209
- SyncBailHook<[Expression, string[], boolean[]], boolean | void>
5545
+ SyncBailHook<
5546
+ [MemberExpression, string[], boolean[], [number, number][]],
5547
+ boolean | void
5548
+ >
5210
5549
  >;
5211
5550
  unhandledExpressionMemberChain: HookMap<
5212
- SyncBailHook<[Expression, string[]], boolean | void>
5551
+ SyncBailHook<[MemberExpression, string[]], boolean | void>
5552
+ >;
5553
+ expressionConditionalOperator: SyncBailHook<
5554
+ [ConditionalExpression],
5555
+ boolean | void
5556
+ >;
5557
+ expressionLogicalOperator: SyncBailHook<
5558
+ [LogicalExpression],
5559
+ boolean | void
5213
5560
  >;
5214
- expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
5215
- expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
5216
5561
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
5217
5562
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
5218
5563
  }>;
@@ -5223,32 +5568,87 @@ declare class JavascriptParser extends Parser {
5223
5568
  semicolons: any;
5224
5569
  statementPath: (
5225
5570
  | UnaryExpression
5226
- | ThisExpression
5227
5571
  | ArrayExpression
5228
- | ObjectExpression
5229
- | FunctionExpression
5230
5572
  | ArrowFunctionExpression
5231
- | YieldExpression
5573
+ | AssignmentExpression
5574
+ | AwaitExpression
5575
+ | BinaryExpression
5576
+ | SimpleCallExpression
5577
+ | NewExpression
5578
+ | ChainExpression
5579
+ | ClassExpression
5580
+ | ConditionalExpression
5581
+ | FunctionExpression
5582
+ | Identifier
5583
+ | ImportExpression
5232
5584
  | SimpleLiteral
5233
5585
  | RegExpLiteral
5234
5586
  | BigIntLiteral
5235
- | UpdateExpression
5236
- | BinaryExpression
5237
- | AssignmentExpression
5238
5587
  | LogicalExpression
5239
5588
  | MemberExpression
5240
- | ConditionalExpression
5241
- | SimpleCallExpression
5242
- | NewExpression
5589
+ | MetaProperty
5590
+ | ObjectExpression
5243
5591
  | SequenceExpression
5244
- | TemplateLiteral
5245
5592
  | TaggedTemplateExpression
5593
+ | TemplateLiteral
5594
+ | ThisExpression
5595
+ | UpdateExpression
5596
+ | YieldExpression
5597
+ | FunctionDeclaration
5598
+ | VariableDeclaration
5599
+ | ClassDeclaration
5600
+ | ExpressionStatement
5601
+ | BlockStatement
5602
+ | StaticBlock
5603
+ | EmptyStatement
5604
+ | DebuggerStatement
5605
+ | WithStatement
5606
+ | ReturnStatement
5607
+ | LabeledStatement
5608
+ | BreakStatement
5609
+ | ContinueStatement
5610
+ | IfStatement
5611
+ | SwitchStatement
5612
+ | ThrowStatement
5613
+ | TryStatement
5614
+ | WhileStatement
5615
+ | DoWhileStatement
5616
+ | ForStatement
5617
+ | ForInStatement
5618
+ | ForOfStatement
5619
+ | ImportDeclaration
5620
+ | ExportNamedDeclaration
5621
+ | ExportDefaultDeclaration
5622
+ | ExportAllDeclaration
5623
+ )[];
5624
+ prevStatement?:
5625
+ | UnaryExpression
5626
+ | ArrayExpression
5627
+ | ArrowFunctionExpression
5628
+ | AssignmentExpression
5629
+ | AwaitExpression
5630
+ | BinaryExpression
5631
+ | SimpleCallExpression
5632
+ | NewExpression
5633
+ | ChainExpression
5246
5634
  | ClassExpression
5247
- | MetaProperty
5635
+ | ConditionalExpression
5636
+ | FunctionExpression
5248
5637
  | Identifier
5249
- | AwaitExpression
5250
5638
  | ImportExpression
5251
- | ChainExpression
5639
+ | SimpleLiteral
5640
+ | RegExpLiteral
5641
+ | BigIntLiteral
5642
+ | LogicalExpression
5643
+ | MemberExpression
5644
+ | MetaProperty
5645
+ | ObjectExpression
5646
+ | SequenceExpression
5647
+ | TaggedTemplateExpression
5648
+ | TemplateLiteral
5649
+ | ThisExpression
5650
+ | UpdateExpression
5651
+ | YieldExpression
5252
5652
  | FunctionDeclaration
5253
5653
  | VariableDeclaration
5254
5654
  | ClassDeclaration
@@ -5271,17 +5671,212 @@ declare class JavascriptParser extends Parser {
5271
5671
  | ForStatement
5272
5672
  | ForInStatement
5273
5673
  | ForOfStatement
5274
- )[];
5275
- prevStatement: any;
5674
+ | ImportDeclaration
5675
+ | ExportNamedDeclaration
5676
+ | ExportDefaultDeclaration
5677
+ | ExportAllDeclaration;
5678
+ destructuringAssignmentProperties: WeakMap<Expression, Set<string>>;
5276
5679
  currentTagData: any;
5277
- getRenameIdentifier(expr?: any): undefined | string | VariableInfoInterface;
5680
+ destructuringAssignmentPropertiesFor(
5681
+ node: Expression
5682
+ ): undefined | Set<string>;
5683
+ getRenameIdentifier(
5684
+ expr: Expression
5685
+ ): undefined | string | VariableInfoInterface;
5278
5686
  walkClass(classy: ClassExpression | ClassDeclaration): void;
5279
- preWalkStatements(statements?: any): void;
5280
- blockPreWalkStatements(statements?: any): void;
5281
- walkStatements(statements?: any): void;
5282
- preWalkStatement(statement?: any): void;
5283
- blockPreWalkStatement(statement?: any): void;
5284
- walkStatement(statement?: any): void;
5687
+
5688
+ /**
5689
+ * Pre walking iterates the scope for variable declarations
5690
+ */
5691
+ preWalkStatements(
5692
+ statements: (
5693
+ | FunctionDeclaration
5694
+ | VariableDeclaration
5695
+ | ClassDeclaration
5696
+ | ExpressionStatement
5697
+ | BlockStatement
5698
+ | StaticBlock
5699
+ | EmptyStatement
5700
+ | DebuggerStatement
5701
+ | WithStatement
5702
+ | ReturnStatement
5703
+ | LabeledStatement
5704
+ | BreakStatement
5705
+ | ContinueStatement
5706
+ | IfStatement
5707
+ | SwitchStatement
5708
+ | ThrowStatement
5709
+ | TryStatement
5710
+ | WhileStatement
5711
+ | DoWhileStatement
5712
+ | ForStatement
5713
+ | ForInStatement
5714
+ | ForOfStatement
5715
+ | ImportDeclaration
5716
+ | ExportNamedDeclaration
5717
+ | ExportDefaultDeclaration
5718
+ | ExportAllDeclaration
5719
+ )[]
5720
+ ): void;
5721
+
5722
+ /**
5723
+ * Block pre walking iterates the scope for block variable declarations
5724
+ */
5725
+ blockPreWalkStatements(
5726
+ statements: (
5727
+ | FunctionDeclaration
5728
+ | VariableDeclaration
5729
+ | ClassDeclaration
5730
+ | ExpressionStatement
5731
+ | BlockStatement
5732
+ | StaticBlock
5733
+ | EmptyStatement
5734
+ | DebuggerStatement
5735
+ | WithStatement
5736
+ | ReturnStatement
5737
+ | LabeledStatement
5738
+ | BreakStatement
5739
+ | ContinueStatement
5740
+ | IfStatement
5741
+ | SwitchStatement
5742
+ | ThrowStatement
5743
+ | TryStatement
5744
+ | WhileStatement
5745
+ | DoWhileStatement
5746
+ | ForStatement
5747
+ | ForInStatement
5748
+ | ForOfStatement
5749
+ | ImportDeclaration
5750
+ | ExportNamedDeclaration
5751
+ | ExportDefaultDeclaration
5752
+ | ExportAllDeclaration
5753
+ )[]
5754
+ ): void;
5755
+
5756
+ /**
5757
+ * Walking iterates the statements and expressions and processes them
5758
+ */
5759
+ walkStatements(
5760
+ statements: (
5761
+ | FunctionDeclaration
5762
+ | VariableDeclaration
5763
+ | ClassDeclaration
5764
+ | ExpressionStatement
5765
+ | BlockStatement
5766
+ | StaticBlock
5767
+ | EmptyStatement
5768
+ | DebuggerStatement
5769
+ | WithStatement
5770
+ | ReturnStatement
5771
+ | LabeledStatement
5772
+ | BreakStatement
5773
+ | ContinueStatement
5774
+ | IfStatement
5775
+ | SwitchStatement
5776
+ | ThrowStatement
5777
+ | TryStatement
5778
+ | WhileStatement
5779
+ | DoWhileStatement
5780
+ | ForStatement
5781
+ | ForInStatement
5782
+ | ForOfStatement
5783
+ | ImportDeclaration
5784
+ | ExportNamedDeclaration
5785
+ | ExportDefaultDeclaration
5786
+ | ExportAllDeclaration
5787
+ )[]
5788
+ ): void;
5789
+
5790
+ /**
5791
+ * Walking iterates the statements and expressions and processes them
5792
+ */
5793
+ preWalkStatement(
5794
+ statement:
5795
+ | FunctionDeclaration
5796
+ | VariableDeclaration
5797
+ | ClassDeclaration
5798
+ | ExpressionStatement
5799
+ | BlockStatement
5800
+ | StaticBlock
5801
+ | EmptyStatement
5802
+ | DebuggerStatement
5803
+ | WithStatement
5804
+ | ReturnStatement
5805
+ | LabeledStatement
5806
+ | BreakStatement
5807
+ | ContinueStatement
5808
+ | IfStatement
5809
+ | SwitchStatement
5810
+ | ThrowStatement
5811
+ | TryStatement
5812
+ | WhileStatement
5813
+ | DoWhileStatement
5814
+ | ForStatement
5815
+ | ForInStatement
5816
+ | ForOfStatement
5817
+ | ImportDeclaration
5818
+ | ExportNamedDeclaration
5819
+ | ExportDefaultDeclaration
5820
+ | ExportAllDeclaration
5821
+ ): void;
5822
+ blockPreWalkStatement(
5823
+ statement:
5824
+ | FunctionDeclaration
5825
+ | VariableDeclaration
5826
+ | ClassDeclaration
5827
+ | ExpressionStatement
5828
+ | BlockStatement
5829
+ | StaticBlock
5830
+ | EmptyStatement
5831
+ | DebuggerStatement
5832
+ | WithStatement
5833
+ | ReturnStatement
5834
+ | LabeledStatement
5835
+ | BreakStatement
5836
+ | ContinueStatement
5837
+ | IfStatement
5838
+ | SwitchStatement
5839
+ | ThrowStatement
5840
+ | TryStatement
5841
+ | WhileStatement
5842
+ | DoWhileStatement
5843
+ | ForStatement
5844
+ | ForInStatement
5845
+ | ForOfStatement
5846
+ | ImportDeclaration
5847
+ | ExportNamedDeclaration
5848
+ | ExportDefaultDeclaration
5849
+ | ExportAllDeclaration
5850
+ ): void;
5851
+ walkStatement(
5852
+ statement:
5853
+ | FunctionDeclaration
5854
+ | VariableDeclaration
5855
+ | ClassDeclaration
5856
+ | ExpressionStatement
5857
+ | BlockStatement
5858
+ | StaticBlock
5859
+ | EmptyStatement
5860
+ | DebuggerStatement
5861
+ | WithStatement
5862
+ | ReturnStatement
5863
+ | LabeledStatement
5864
+ | BreakStatement
5865
+ | ContinueStatement
5866
+ | IfStatement
5867
+ | SwitchStatement
5868
+ | ThrowStatement
5869
+ | TryStatement
5870
+ | WhileStatement
5871
+ | DoWhileStatement
5872
+ | ForStatement
5873
+ | ForInStatement
5874
+ | ForOfStatement
5875
+ | ImportDeclaration
5876
+ | ExportNamedDeclaration
5877
+ | ExportDefaultDeclaration
5878
+ | ExportAllDeclaration
5879
+ ): void;
5285
5880
 
5286
5881
  /**
5287
5882
  * Walks a statements that is nested within a parent statement
@@ -5289,81 +5884,118 @@ declare class JavascriptParser extends Parser {
5289
5884
  * This enforces the nested statement to never be in ASI position.
5290
5885
  */
5291
5886
  walkNestedStatement(statement: Statement): void;
5292
- preWalkBlockStatement(statement?: any): void;
5293
- walkBlockStatement(statement?: any): void;
5294
- walkExpressionStatement(statement?: any): void;
5295
- preWalkIfStatement(statement?: any): void;
5296
- walkIfStatement(statement?: any): void;
5297
- preWalkLabeledStatement(statement?: any): void;
5298
- walkLabeledStatement(statement?: any): void;
5299
- preWalkWithStatement(statement?: any): void;
5300
- walkWithStatement(statement?: any): void;
5301
- preWalkSwitchStatement(statement?: any): void;
5302
- walkSwitchStatement(statement?: any): void;
5303
- walkTerminatingStatement(statement?: any): void;
5304
- walkReturnStatement(statement?: any): void;
5305
- walkThrowStatement(statement?: any): void;
5306
- preWalkTryStatement(statement?: any): void;
5307
- walkTryStatement(statement?: any): void;
5308
- preWalkWhileStatement(statement?: any): void;
5309
- walkWhileStatement(statement?: any): void;
5310
- preWalkDoWhileStatement(statement?: any): void;
5311
- walkDoWhileStatement(statement?: any): void;
5312
- preWalkForStatement(statement?: any): void;
5313
- walkForStatement(statement?: any): void;
5314
- preWalkForInStatement(statement?: any): void;
5315
- walkForInStatement(statement?: any): void;
5887
+ preWalkBlockStatement(statement: BlockStatement): void;
5888
+ walkBlockStatement(statement: BlockStatement): void;
5889
+ walkExpressionStatement(statement: ExpressionStatement): void;
5890
+ preWalkIfStatement(statement: IfStatement): void;
5891
+ walkIfStatement(statement: IfStatement): void;
5892
+ preWalkLabeledStatement(statement: LabeledStatement): void;
5893
+ walkLabeledStatement(statement: LabeledStatement): void;
5894
+ preWalkWithStatement(statement: WithStatement): void;
5895
+ walkWithStatement(statement: WithStatement): void;
5896
+ preWalkSwitchStatement(statement: SwitchStatement): void;
5897
+ walkSwitchStatement(statement: SwitchStatement): void;
5898
+ walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
5899
+ walkReturnStatement(statement: ReturnStatement): void;
5900
+ walkThrowStatement(statement: ThrowStatement): void;
5901
+ preWalkTryStatement(statement: TryStatement): void;
5902
+ walkTryStatement(statement: TryStatement): void;
5903
+ preWalkWhileStatement(statement: WhileStatement): void;
5904
+ walkWhileStatement(statement: WhileStatement): void;
5905
+ preWalkDoWhileStatement(statement: DoWhileStatement): void;
5906
+ walkDoWhileStatement(statement: DoWhileStatement): void;
5907
+ preWalkForStatement(statement: ForStatement): void;
5908
+ walkForStatement(statement: ForStatement): void;
5909
+ preWalkForInStatement(statement: ForInStatement): void;
5910
+ walkForInStatement(statement: ForInStatement): void;
5316
5911
  preWalkForOfStatement(statement?: any): void;
5317
- walkForOfStatement(statement?: any): void;
5318
- preWalkFunctionDeclaration(statement?: any): void;
5319
- walkFunctionDeclaration(statement?: any): void;
5912
+ walkForOfStatement(statement: ForOfStatement): void;
5913
+ preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
5914
+ walkFunctionDeclaration(statement: FunctionDeclaration): void;
5915
+ blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
5916
+ preWalkAssignmentExpression(expression: AssignmentExpression): void;
5320
5917
  blockPreWalkImportDeclaration(statement?: any): void;
5321
5918
  enterDeclaration(declaration?: any, onIdent?: any): void;
5322
5919
  blockPreWalkExportNamedDeclaration(statement?: any): void;
5323
- walkExportNamedDeclaration(statement?: any): void;
5920
+ walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
5324
5921
  blockPreWalkExportDefaultDeclaration(statement?: any): void;
5325
5922
  walkExportDefaultDeclaration(statement?: any): void;
5326
5923
  blockPreWalkExportAllDeclaration(statement?: any): void;
5327
- preWalkVariableDeclaration(statement?: any): void;
5328
- blockPreWalkVariableDeclaration(statement?: any): void;
5329
- walkVariableDeclaration(statement?: any): void;
5330
- blockPreWalkClassDeclaration(statement?: any): void;
5331
- walkClassDeclaration(statement?: any): void;
5332
- preWalkSwitchCases(switchCases?: any): void;
5333
- walkSwitchCases(switchCases?: any): void;
5334
- preWalkCatchClause(catchClause?: any): void;
5335
- walkCatchClause(catchClause?: any): void;
5336
- walkPattern(pattern?: any): void;
5337
- walkAssignmentPattern(pattern?: any): void;
5924
+ preWalkVariableDeclaration(statement: VariableDeclaration): void;
5925
+ blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
5926
+ preWalkVariableDeclarator(declarator: VariableDeclarator): void;
5927
+ walkVariableDeclaration(statement: VariableDeclaration): void;
5928
+ blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
5929
+ walkClassDeclaration(statement: ClassDeclaration): void;
5930
+ preWalkSwitchCases(switchCases: SwitchCase[]): void;
5931
+ walkSwitchCases(switchCases: SwitchCase[]): void;
5932
+ preWalkCatchClause(catchClause: CatchClause): void;
5933
+ walkCatchClause(catchClause: CatchClause): void;
5934
+ walkPattern(pattern: Pattern): void;
5935
+ walkAssignmentPattern(pattern: AssignmentPattern): void;
5338
5936
  walkObjectPattern(pattern?: any): void;
5339
- walkArrayPattern(pattern?: any): void;
5340
- walkRestElement(pattern?: any): void;
5341
- walkExpressions(expressions?: any): void;
5937
+ walkArrayPattern(pattern: ArrayPattern): void;
5938
+ walkRestElement(pattern: RestElement): void;
5939
+ walkExpressions(
5940
+ expressions: (
5941
+ | null
5942
+ | UnaryExpression
5943
+ | ArrayExpression
5944
+ | ArrowFunctionExpression
5945
+ | AssignmentExpression
5946
+ | AwaitExpression
5947
+ | BinaryExpression
5948
+ | SimpleCallExpression
5949
+ | NewExpression
5950
+ | ChainExpression
5951
+ | ClassExpression
5952
+ | ConditionalExpression
5953
+ | FunctionExpression
5954
+ | Identifier
5955
+ | ImportExpression
5956
+ | SimpleLiteral
5957
+ | RegExpLiteral
5958
+ | BigIntLiteral
5959
+ | LogicalExpression
5960
+ | MemberExpression
5961
+ | MetaProperty
5962
+ | ObjectExpression
5963
+ | SequenceExpression
5964
+ | TaggedTemplateExpression
5965
+ | TemplateLiteral
5966
+ | ThisExpression
5967
+ | UpdateExpression
5968
+ | YieldExpression
5969
+ | SpreadElement
5970
+ )[]
5971
+ ): void;
5342
5972
  walkExpression(expression?: any): void;
5343
- walkAwaitExpression(expression?: any): void;
5344
- walkArrayExpression(expression?: any): void;
5345
- walkSpreadElement(expression?: any): void;
5346
- walkObjectExpression(expression?: any): void;
5347
- walkProperty(prop?: any): void;
5348
- walkFunctionExpression(expression?: any): void;
5349
- walkArrowFunctionExpression(expression?: any): void;
5973
+ walkAwaitExpression(expression: AwaitExpression): void;
5974
+ walkArrayExpression(expression: ArrayExpression): void;
5975
+ walkSpreadElement(expression: SpreadElement): void;
5976
+ walkObjectExpression(expression: ObjectExpression): void;
5977
+ walkProperty(prop: SpreadElement | Property): void;
5978
+ walkFunctionExpression(expression: FunctionExpression): void;
5979
+ walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
5350
5980
  walkSequenceExpression(expression: SequenceExpression): void;
5351
- walkUpdateExpression(expression?: any): void;
5352
- walkUnaryExpression(expression?: any): void;
5353
- walkLeftRightExpression(expression?: any): void;
5354
- walkBinaryExpression(expression?: any): void;
5355
- walkLogicalExpression(expression?: any): void;
5356
- walkAssignmentExpression(expression?: any): void;
5357
- walkConditionalExpression(expression?: any): void;
5358
- walkNewExpression(expression?: any): void;
5359
- walkYieldExpression(expression?: any): void;
5360
- walkTemplateLiteral(expression?: any): void;
5361
- walkTaggedTemplateExpression(expression?: any): void;
5362
- walkClassExpression(expression?: any): void;
5981
+ walkUpdateExpression(expression: UpdateExpression): void;
5982
+ walkUnaryExpression(expression: UnaryExpression): void;
5983
+ walkLeftRightExpression(
5984
+ expression: BinaryExpression | LogicalExpression
5985
+ ): void;
5986
+ walkBinaryExpression(expression: BinaryExpression): void;
5987
+ walkLogicalExpression(expression: LogicalExpression): void;
5988
+ walkAssignmentExpression(expression: AssignmentExpression): void;
5989
+ walkConditionalExpression(expression: ConditionalExpression): void;
5990
+ walkNewExpression(expression: NewExpression): void;
5991
+ walkYieldExpression(expression: YieldExpression): void;
5992
+ walkTemplateLiteral(expression: TemplateLiteral): void;
5993
+ walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
5994
+ walkClassExpression(expression: ClassExpression): void;
5363
5995
  walkChainExpression(expression: ChainExpression): void;
5364
- walkImportExpression(expression?: any): void;
5996
+ walkImportExpression(expression: ImportExpression): void;
5365
5997
  walkCallExpression(expression?: any): void;
5366
- walkMemberExpression(expression?: any): void;
5998
+ walkMemberExpression(expression: MemberExpression): void;
5367
5999
  walkMemberExpressionWithExpressionName(
5368
6000
  expression?: any,
5369
6001
  name?: any,
@@ -5371,58 +6003,91 @@ declare class JavascriptParser extends Parser {
5371
6003
  members?: any,
5372
6004
  onUnhandled?: any
5373
6005
  ): void;
5374
- walkThisExpression(expression?: any): void;
5375
- walkIdentifier(expression?: any): void;
6006
+ walkThisExpression(expression: ThisExpression): void;
6007
+ walkIdentifier(expression: Identifier): void;
5376
6008
  walkMetaProperty(metaProperty: MetaProperty): void;
5377
6009
  callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
5378
6010
  callHooksForExpressionWithFallback<T, R>(
5379
6011
  hookMap: HookMap<SyncBailHook<T, R>>,
5380
6012
  expr: MemberExpression,
5381
- fallback: (
5382
- arg0: string,
5383
- arg1: string | ScopeInfo | VariableInfo,
5384
- arg2: () => string[]
5385
- ) => any,
5386
- defined: (arg0: string) => any,
6013
+ fallback:
6014
+ | undefined
6015
+ | ((
6016
+ arg0: string,
6017
+ arg1: string | ScopeInfo | VariableInfo,
6018
+ arg2: () => string[]
6019
+ ) => any),
6020
+ defined: undefined | ((arg0: string) => any),
5387
6021
  ...args: AsArray<T>
5388
- ): R;
6022
+ ): undefined | R;
5389
6023
  callHooksForName<T, R>(
5390
6024
  hookMap: HookMap<SyncBailHook<T, R>>,
5391
6025
  name: string,
5392
6026
  ...args: AsArray<T>
5393
- ): R;
6027
+ ): undefined | R;
5394
6028
  callHooksForInfo<T, R>(
5395
6029
  hookMap: HookMap<SyncBailHook<T, R>>,
5396
6030
  info: ExportedVariableInfo,
5397
6031
  ...args: AsArray<T>
5398
- ): R;
6032
+ ): undefined | R;
5399
6033
  callHooksForInfoWithFallback<T, R>(
5400
6034
  hookMap: HookMap<SyncBailHook<T, R>>,
5401
6035
  info: ExportedVariableInfo,
5402
- fallback: (arg0: string) => any,
5403
- defined: () => any,
6036
+ fallback: undefined | ((arg0: string) => any),
6037
+ defined: undefined | (() => any),
5404
6038
  ...args: AsArray<T>
5405
- ): R;
6039
+ ): undefined | R;
5406
6040
  callHooksForNameWithFallback<T, R>(
5407
6041
  hookMap: HookMap<SyncBailHook<T, R>>,
5408
6042
  name: string,
5409
- fallback: (arg0: string) => any,
5410
- defined: () => any,
6043
+ fallback: undefined | ((arg0: string) => any),
6044
+ defined: undefined | (() => any),
5411
6045
  ...args: AsArray<T>
5412
- ): R;
6046
+ ): undefined | R;
5413
6047
  inScope(params: any, fn: () => void): void;
5414
- inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
5415
- inBlockScope(fn?: any): void;
5416
- detectMode(statements?: any): void;
6048
+ inClassScope(hasThis: boolean, params: any, fn: () => void): void;
6049
+ inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
6050
+ inBlockScope(fn: () => void): void;
6051
+ detectMode(
6052
+ statements: (
6053
+ | FunctionDeclaration
6054
+ | VariableDeclaration
6055
+ | ClassDeclaration
6056
+ | ExpressionStatement
6057
+ | BlockStatement
6058
+ | StaticBlock
6059
+ | EmptyStatement
6060
+ | DebuggerStatement
6061
+ | WithStatement
6062
+ | ReturnStatement
6063
+ | LabeledStatement
6064
+ | BreakStatement
6065
+ | ContinueStatement
6066
+ | IfStatement
6067
+ | SwitchStatement
6068
+ | ThrowStatement
6069
+ | TryStatement
6070
+ | WhileStatement
6071
+ | DoWhileStatement
6072
+ | ForStatement
6073
+ | ForInStatement
6074
+ | ForOfStatement
6075
+ | ImportDeclaration
6076
+ | ExportNamedDeclaration
6077
+ | ExportDefaultDeclaration
6078
+ | ExportAllDeclaration
6079
+ | Directive
6080
+ )[]
6081
+ ): void;
5417
6082
  enterPatterns(patterns?: any, onIdent?: any): void;
5418
6083
  enterPattern(pattern?: any, onIdent?: any): void;
5419
- enterIdentifier(pattern?: any, onIdent?: any): void;
5420
- enterObjectPattern(pattern?: any, onIdent?: any): void;
5421
- enterArrayPattern(pattern?: any, onIdent?: any): void;
5422
- enterRestElement(pattern?: any, onIdent?: any): void;
5423
- enterAssignmentPattern(pattern?: any, onIdent?: any): void;
5424
- evaluateExpression(expression: Expression): BasicEvaluatedExpression;
5425
- parseString(expression?: any): any;
6084
+ enterIdentifier(pattern: Identifier, onIdent?: any): void;
6085
+ enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
6086
+ enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
6087
+ enterRestElement(pattern: RestElement, onIdent?: any): void;
6088
+ enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
6089
+ evaluateExpression(expression?: any): BasicEvaluatedExpression;
6090
+ parseString(expression: Expression): string;
5426
6091
  parseCalculatedString(expression?: any): any;
5427
6092
  evaluate(source: string): BasicEvaluatedExpression;
5428
6093
  isPure(
@@ -5430,99 +6095,101 @@ declare class JavascriptParser extends Parser {
5430
6095
  | undefined
5431
6096
  | null
5432
6097
  | UnaryExpression
5433
- | ThisExpression
5434
6098
  | ArrayExpression
5435
- | ObjectExpression
5436
- | FunctionExpression
5437
6099
  | ArrowFunctionExpression
5438
- | YieldExpression
6100
+ | AssignmentExpression
6101
+ | AwaitExpression
6102
+ | BinaryExpression
6103
+ | SimpleCallExpression
6104
+ | NewExpression
6105
+ | ChainExpression
6106
+ | ClassExpression
6107
+ | ConditionalExpression
6108
+ | FunctionExpression
6109
+ | Identifier
6110
+ | ImportExpression
5439
6111
  | SimpleLiteral
5440
6112
  | RegExpLiteral
5441
6113
  | BigIntLiteral
5442
- | UpdateExpression
5443
- | BinaryExpression
5444
- | AssignmentExpression
5445
6114
  | LogicalExpression
5446
6115
  | MemberExpression
5447
- | ConditionalExpression
5448
- | SimpleCallExpression
5449
- | NewExpression
6116
+ | MetaProperty
6117
+ | ObjectExpression
5450
6118
  | SequenceExpression
5451
- | TemplateLiteral
5452
6119
  | TaggedTemplateExpression
5453
- | ClassExpression
5454
- | MetaProperty
5455
- | Identifier
5456
- | AwaitExpression
5457
- | ImportExpression
5458
- | ChainExpression
6120
+ | TemplateLiteral
6121
+ | ThisExpression
6122
+ | UpdateExpression
6123
+ | YieldExpression
5459
6124
  | FunctionDeclaration
5460
6125
  | VariableDeclaration
5461
6126
  | ClassDeclaration
5462
6127
  | PrivateIdentifier,
5463
6128
  commentsStartPos: number
5464
6129
  ): boolean;
5465
- getComments(range?: any): any[];
6130
+ getComments(range: [number, number]): any[];
5466
6131
  isAsiPosition(pos: number): boolean;
5467
6132
  unsetAsiPosition(pos: number): void;
5468
- isStatementLevelExpression(expr?: any): boolean;
6133
+ isStatementLevelExpression(expr: Expression): boolean;
5469
6134
  getTagData(name?: any, tag?: any): any;
5470
6135
  tagVariable(name?: any, tag?: any, data?: any): void;
5471
- defineVariable(name?: any): void;
5472
- undefineVariable(name?: any): void;
5473
- isVariableDefined(name?: any): boolean;
6136
+ defineVariable(name: string): void;
6137
+ undefineVariable(name: string): void;
6138
+ isVariableDefined(name: string): boolean;
5474
6139
  getVariableInfo(name: string): ExportedVariableInfo;
5475
6140
  setVariable(name: string, variableInfo: ExportedVariableInfo): void;
5476
- evaluatedVariable(tagInfo?: any): VariableInfo;
5477
- parseCommentOptions(
5478
- range?: any
5479
- ): { options: null; errors: null } | { options: object; errors: unknown[] };
6141
+ evaluatedVariable(tagInfo: TagInfo): VariableInfo;
6142
+ parseCommentOptions(range: [number, number]): any;
5480
6143
  extractMemberExpressionChain(expression: MemberExpression): {
5481
6144
  members: string[];
5482
6145
  object:
5483
6146
  | UnaryExpression
5484
- | ThisExpression
5485
6147
  | ArrayExpression
5486
- | ObjectExpression
5487
- | FunctionExpression
5488
6148
  | ArrowFunctionExpression
5489
- | YieldExpression
6149
+ | AssignmentExpression
6150
+ | AwaitExpression
6151
+ | BinaryExpression
6152
+ | SimpleCallExpression
6153
+ | NewExpression
6154
+ | ChainExpression
6155
+ | ClassExpression
6156
+ | ConditionalExpression
6157
+ | FunctionExpression
6158
+ | Identifier
6159
+ | ImportExpression
5490
6160
  | SimpleLiteral
5491
6161
  | RegExpLiteral
5492
6162
  | BigIntLiteral
5493
- | UpdateExpression
5494
- | BinaryExpression
5495
- | AssignmentExpression
5496
6163
  | LogicalExpression
5497
6164
  | MemberExpression
5498
- | ConditionalExpression
5499
- | SimpleCallExpression
5500
- | NewExpression
6165
+ | MetaProperty
6166
+ | ObjectExpression
5501
6167
  | SequenceExpression
5502
- | TemplateLiteral
5503
6168
  | TaggedTemplateExpression
5504
- | ClassExpression
5505
- | MetaProperty
5506
- | Identifier
5507
- | AwaitExpression
5508
- | ImportExpression
5509
- | ChainExpression
6169
+ | TemplateLiteral
6170
+ | ThisExpression
6171
+ | UpdateExpression
6172
+ | YieldExpression
5510
6173
  | Super;
5511
6174
  membersOptionals: boolean[];
6175
+ memberRanges: [number, number][];
5512
6176
  };
5513
- getFreeInfoFromVariable(varName: string): {
5514
- name: string;
5515
- info: string | VariableInfo;
5516
- };
6177
+ getFreeInfoFromVariable(
6178
+ varName: string
6179
+ ): undefined | { name: string; info: string | VariableInfo };
5517
6180
  getMemberExpressionInfo(
5518
6181
  expression: MemberExpression,
5519
6182
  allowedTypes: number
5520
6183
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5521
- getNameForExpression(expression: MemberExpression): {
5522
- name: string;
5523
- rootInfo: ExportedVariableInfo;
5524
- getMembers: () => string[];
5525
- };
6184
+ getNameForExpression(
6185
+ expression: MemberExpression
6186
+ ):
6187
+ | undefined
6188
+ | {
6189
+ name: string;
6190
+ rootInfo: ExportedVariableInfo;
6191
+ getMembers: () => string[];
6192
+ };
5526
6193
  static ALLOWED_MEMBER_TYPES_ALL: 3;
5527
6194
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
5528
6195
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
@@ -5559,6 +6226,11 @@ declare interface JavascriptParserOptions {
5559
6226
  */
5560
6227
  createRequire?: string | boolean;
5561
6228
 
6229
+ /**
6230
+ * Specifies global fetchPriority for dynamic import.
6231
+ */
6232
+ dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6233
+
5562
6234
  /**
5563
6235
  * Specifies global mode for dynamic import.
5564
6236
  */
@@ -5714,8 +6386,19 @@ declare interface JavascriptParserOptions {
5714
6386
  */
5715
6387
  wrappedContextRegExp?: RegExp;
5716
6388
  }
6389
+ type JsonObject = { [index: string]: JsonValue } & {
6390
+ [index: string]:
6391
+ | undefined
6392
+ | null
6393
+ | string
6394
+ | number
6395
+ | boolean
6396
+ | JsonObject
6397
+ | JsonValue[];
6398
+ };
6399
+ type JsonValue = null | string | number | boolean | JsonObject | JsonValue[];
5717
6400
  declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
5718
- constructor(runtimeRequirements?: any);
6401
+ constructor(runtimeRequirements: Set<string>);
5719
6402
  static getCompilationHooks(
5720
6403
  compilation: Compilation
5721
6404
  ): JsonpCompilationPluginHooks;
@@ -5830,6 +6513,23 @@ declare interface KnownBuildMeta {
5830
6513
  declare interface KnownCreateStatsOptionsContext {
5831
6514
  forToString?: boolean;
5832
6515
  }
6516
+ declare interface KnownHooks {
6517
+ resolveStep: SyncHook<
6518
+ [
6519
+ AsyncSeriesBailHook<
6520
+ [ResolveRequest, ResolveContext],
6521
+ null | ResolveRequest
6522
+ >,
6523
+ ResolveRequest
6524
+ ]
6525
+ >;
6526
+ noResolve: SyncHook<[ResolveRequest, Error]>;
6527
+ resolve: AsyncSeriesBailHook<
6528
+ [ResolveRequest, ResolveContext],
6529
+ null | ResolveRequest
6530
+ >;
6531
+ result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
6532
+ }
5833
6533
  declare interface KnownNormalizedStatsOptions {
5834
6534
  context: string;
5835
6535
  requestShortener: RequestShortener;
@@ -6133,7 +6833,10 @@ declare interface LazyCompilationDefaultBackendOptions {
6133
6833
  /**
6134
6834
  * Specifies how to create the server handling the EventSource requests.
6135
6835
  */
6136
- server?: ServerOptionsImport | ServerOptionsHttps | (() => typeof Server);
6836
+ server?:
6837
+ | ServerOptionsImport<typeof IncomingMessage>
6838
+ | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
6839
+ | (() => typeof Server);
6137
6840
  }
6138
6841
 
6139
6842
  /**
@@ -6181,9 +6884,9 @@ declare class LazySet<T> {
6181
6884
  has(item: T): boolean;
6182
6885
  keys(): IterableIterator<T>;
6183
6886
  values(): IterableIterator<T>;
6184
- serialize(__0: { write: any }): void;
6887
+ serialize(__0: ObjectSerializerContext): void;
6185
6888
  [Symbol.iterator](): IterableIterator<T>;
6186
- static deserialize(__0: { read: any }): LazySet<any>;
6889
+ static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
6187
6890
  }
6188
6891
  declare interface LibIdentOptions {
6189
6892
  /**
@@ -6197,13 +6900,44 @@ declare interface LibIdentOptions {
6197
6900
  associatedObjectForCache?: Object;
6198
6901
  }
6199
6902
  declare class LibManifestPlugin {
6200
- constructor(options?: any);
6201
- options: any;
6903
+ constructor(options: LibManifestPluginOptions);
6904
+ options: LibManifestPluginOptions;
6202
6905
 
6203
6906
  /**
6204
6907
  * Apply the plugin
6205
6908
  */
6206
- apply(compiler: Compiler): void;
6909
+ apply(compiler: Compiler): void;
6910
+ }
6911
+ declare interface LibManifestPluginOptions {
6912
+ /**
6913
+ * Context of requests in the manifest file (defaults to the webpack context).
6914
+ */
6915
+ context?: string;
6916
+
6917
+ /**
6918
+ * If true, only entry points will be exposed (default: true).
6919
+ */
6920
+ entryOnly?: boolean;
6921
+
6922
+ /**
6923
+ * If true, manifest json file (output) will be formatted.
6924
+ */
6925
+ format?: boolean;
6926
+
6927
+ /**
6928
+ * Name of the exposed dll function (external name, use value of 'output.library').
6929
+ */
6930
+ name?: string;
6931
+
6932
+ /**
6933
+ * Absolute path to the manifest json file (output).
6934
+ */
6935
+ path: string;
6936
+
6937
+ /**
6938
+ * Type of the dll bundle (external type, use value of 'output.libraryTarget').
6939
+ */
6940
+ type?: string;
6207
6941
  }
6208
6942
  declare interface LibraryContext<T> {
6209
6943
  compilation: Compilation;
@@ -6262,6 +6996,11 @@ type LibraryName = string | string[] | LibraryCustomUmdObject;
6262
6996
  * Options for library.
6263
6997
  */
6264
6998
  declare interface LibraryOptions {
6999
+ /**
7000
+ * Add a container for define/require functions in the AMD module.
7001
+ */
7002
+ amdContainer?: string;
7003
+
6265
7004
  /**
6266
7005
  * Add a comment in the UMD wrapper.
6267
7006
  */
@@ -6333,7 +7072,7 @@ declare interface LoadScriptCompilationHooks {
6333
7072
  createScript: SyncWaterfallHook<[string, Chunk]>;
6334
7073
  }
6335
7074
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
6336
- constructor(withCreateScriptUrl?: boolean);
7075
+ constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
6337
7076
  static getCompilationHooks(
6338
7077
  compilation: Compilation
6339
7078
  ): LoadScriptCompilationHooks;
@@ -6405,8 +7144,8 @@ declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
6405
7144
  pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
6406
7145
  }
6407
7146
  declare class LoaderOptionsPlugin {
6408
- constructor(options?: LoaderOptionsPluginOptions);
6409
- options: LoaderOptionsPluginOptions;
7147
+ constructor(options?: LoaderOptionsPluginOptions & MatchObject);
7148
+ options: LoaderOptionsPluginOptions & MatchObject;
6410
7149
 
6411
7150
  /**
6412
7151
  * Apply the plugin
@@ -6570,6 +7309,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
6570
7309
  data?: object;
6571
7310
  pitchExecuted: boolean;
6572
7311
  normalExecuted: boolean;
7312
+ type?: "module" | "commonjs";
6573
7313
  }[];
6574
7314
 
6575
7315
  /**
@@ -6601,6 +7341,12 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
6601
7341
  * Example: "web"
6602
7342
  */
6603
7343
  target: string;
7344
+
7345
+ /**
7346
+ * Tell what kind of ES-features may be used in the generated runtime-code.
7347
+ * Example: { arrowFunction: true }
7348
+ */
7349
+ environment: Environment;
6604
7350
  }
6605
7351
  declare class LoaderTargetPlugin {
6606
7352
  constructor(target: string);
@@ -6704,6 +7450,12 @@ declare interface MapOptions {
6704
7450
  columns?: boolean;
6705
7451
  module?: boolean;
6706
7452
  }
7453
+ declare interface MatchObject {
7454
+ test?: string | RegExp | (string | RegExp)[];
7455
+ include?: string | RegExp | (string | RegExp)[];
7456
+ exclude?: string | RegExp | (string | RegExp)[];
7457
+ }
7458
+ type Matcher = string | RegExp | (string | RegExp)[];
6707
7459
 
6708
7460
  /**
6709
7461
  * Options object for in-memory caching.
@@ -6758,27 +7510,27 @@ declare interface MinChunkSizePluginOptions {
6758
7510
  minChunkSize: number;
6759
7511
  }
6760
7512
  declare class Module extends DependenciesBlock {
6761
- constructor(type: string, context?: string, layer?: string);
7513
+ constructor(type: string, context?: null | string, layer?: null | string);
6762
7514
  type: string;
6763
7515
  context: null | string;
6764
7516
  layer: null | string;
6765
7517
  needId: boolean;
6766
7518
  debugId: number;
6767
- resolveOptions: ResolveOptionsWebpackOptions;
6768
- factoryMeta?: object;
7519
+ resolveOptions?: ResolveOptionsWebpackOptions;
7520
+ factoryMeta?: FactoryMeta;
6769
7521
  useSourceMap: boolean;
6770
7522
  useSimpleSourceMap: boolean;
6771
- buildMeta: BuildMeta;
6772
- buildInfo: Record<string, any>;
7523
+ buildMeta?: BuildMeta;
7524
+ buildInfo?: BuildInfo;
6773
7525
  presentationalDependencies?: Dependency[];
6774
7526
  codeGenerationDependencies?: Dependency[];
6775
7527
  id: string | number;
6776
7528
  get hash(): string;
6777
7529
  get renderedHash(): string;
6778
7530
  profile: null | ModuleProfile;
6779
- index: number;
6780
- index2: number;
6781
- depth: number;
7531
+ index: null | number;
7532
+ index2: null | number;
7533
+ depth: null | number;
6782
7534
  issuer: null | Module;
6783
7535
  get usedExports(): null | boolean | SortableSet<string>;
6784
7536
  get optimizationBailout(): (
@@ -6786,9 +7538,9 @@ declare class Module extends DependenciesBlock {
6786
7538
  | ((requestShortener: RequestShortener) => string)
6787
7539
  )[];
6788
7540
  get optional(): boolean;
6789
- addChunk(chunk?: any): boolean;
6790
- removeChunk(chunk?: any): void;
6791
- isInChunk(chunk?: any): boolean;
7541
+ addChunk(chunk: Chunk): boolean;
7542
+ removeChunk(chunk: Chunk): void;
7543
+ isInChunk(chunk: Chunk): boolean;
6792
7544
  isEntryModule(): boolean;
6793
7545
  getChunks(): Chunk[];
6794
7546
  getNumberOfChunks(): number;
@@ -6798,7 +7550,7 @@ declare class Module extends DependenciesBlock {
6798
7550
  get moduleArgument(): string;
6799
7551
  getExportsType(
6800
7552
  moduleGraph: ModuleGraph,
6801
- strict: boolean
7553
+ strict?: boolean
6802
7554
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
6803
7555
  addPresentationalDependency(presentationalDependency: Dependency): void;
6804
7556
  addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
@@ -6918,7 +7670,7 @@ declare class ModuleDependency extends Dependency {
6918
7670
  declare abstract class ModuleFactory {
6919
7671
  create(
6920
7672
  data: ModuleFactoryCreateData,
6921
- callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
7673
+ callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
6922
7674
  ): void;
6923
7675
  }
6924
7676
  declare interface ModuleFactoryCreateData {
@@ -7062,11 +7814,11 @@ declare class ModuleGraph {
7062
7814
  filterConnection: (arg0: ModuleGraphConnection) => boolean
7063
7815
  ): void;
7064
7816
  addExtraReason(module: Module, explanation: string): void;
7065
- getResolvedModule(dependency: Dependency): Module;
7817
+ getResolvedModule(dependency: Dependency): null | Module;
7066
7818
  getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
7067
- getModule(dependency: Dependency): Module;
7068
- getOrigin(dependency: Dependency): Module;
7069
- getResolvedOrigin(dependency: Dependency): Module;
7819
+ getModule(dependency: Dependency): null | Module;
7820
+ getOrigin(dependency: Dependency): null | Module;
7821
+ getResolvedOrigin(dependency: Dependency): null | Module;
7070
7822
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
7071
7823
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
7072
7824
  getIncomingConnectionsByOriginModule(
@@ -7095,19 +7847,19 @@ declare class ModuleGraph {
7095
7847
  module: Module,
7096
7848
  runtime: RuntimeSpec
7097
7849
  ): null | boolean | SortableSet<string>;
7098
- getPreOrderIndex(module: Module): number;
7099
- getPostOrderIndex(module: Module): number;
7850
+ getPreOrderIndex(module: Module): null | number;
7851
+ getPostOrderIndex(module: Module): null | number;
7100
7852
  setPreOrderIndex(module: Module, index: number): void;
7101
7853
  setPreOrderIndexIfUnset(module: Module, index: number): boolean;
7102
7854
  setPostOrderIndex(module: Module, index: number): void;
7103
7855
  setPostOrderIndexIfUnset(module: Module, index: number): boolean;
7104
- getDepth(module: Module): number;
7856
+ getDepth(module: Module): null | number;
7105
7857
  setDepth(module: Module, depth: number): void;
7106
7858
  setDepthIfLower(module: Module, depth: number): boolean;
7107
7859
  isAsync(module: Module): boolean;
7108
7860
  setAsync(module: Module): void;
7109
7861
  getMeta(thing?: any): Object;
7110
- getMetaIfExisting(thing?: any): Object;
7862
+ getMetaIfExisting(thing?: any): undefined | Object;
7111
7863
  freeze(cacheStage?: string): void;
7112
7864
  unfreeze(): void;
7113
7865
  cached<T extends any[], V>(
@@ -7148,11 +7900,11 @@ declare class ModuleGraphConnection {
7148
7900
  module: Module;
7149
7901
  weak: boolean;
7150
7902
  conditional: boolean;
7151
- condition: (
7903
+ condition?: (
7152
7904
  arg0: ModuleGraphConnection,
7153
7905
  arg1: RuntimeSpec
7154
7906
  ) => ConnectionState;
7155
- explanations: Set<string>;
7907
+ explanations?: Set<string>;
7156
7908
  clone(): ModuleGraphConnection;
7157
7909
  addCondition(
7158
7910
  condition: (
@@ -7183,7 +7935,7 @@ declare interface ModuleOptions {
7183
7935
  /**
7184
7936
  * An array of rules applied by default for modules.
7185
7937
  */
7186
- defaultRules?: (RuleSetRule | "...")[];
7938
+ defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7187
7939
 
7188
7940
  /**
7189
7941
  * Enable warnings for full dynamic dependencies.
@@ -7223,7 +7975,7 @@ declare interface ModuleOptions {
7223
7975
  /**
7224
7976
  * An array of rules applied for modules.
7225
7977
  */
7226
- rules?: (RuleSetRule | "...")[];
7978
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7227
7979
 
7228
7980
  /**
7229
7981
  * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
@@ -7283,7 +8035,7 @@ declare interface ModuleOptionsNormalized {
7283
8035
  /**
7284
8036
  * An array of rules applied by default for modules.
7285
8037
  */
7286
- defaultRules: (RuleSetRule | "...")[];
8038
+ defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7287
8039
 
7288
8040
  /**
7289
8041
  * Specify options for each generator.
@@ -7303,7 +8055,7 @@ declare interface ModuleOptionsNormalized {
7303
8055
  /**
7304
8056
  * An array of rules applied for modules.
7305
8057
  */
7306
- rules: (RuleSetRule | "...")[];
8058
+ rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7307
8059
 
7308
8060
  /**
7309
8061
  * Cache the resolving of module requests.
@@ -7337,7 +8089,7 @@ declare abstract class ModuleProfile {
7337
8089
  storingEndTime: number;
7338
8090
  storing: number;
7339
8091
  storingParallelismFactor: number;
7340
- additionalFactoryTimes: any;
8092
+ additionalFactoryTimes?: { start: number; end: number }[];
7341
8093
  additionalFactories: number;
7342
8094
  additionalFactoriesParallelismFactor: number;
7343
8095
  additionalIntegration: number;
@@ -7475,30 +8227,47 @@ declare abstract class MultiStats {
7475
8227
  declare abstract class MultiWatching {
7476
8228
  watchings: Watching[];
7477
8229
  compiler: MultiCompiler;
7478
- invalidate(callback?: any): void;
8230
+ invalidate(callback?: CallbackFunction<void>): void;
7479
8231
  suspend(): void;
7480
8232
  resume(): void;
7481
8233
  close(callback: CallbackFunction<void>): void;
7482
8234
  }
7483
8235
  declare class NamedChunkIdsPlugin {
7484
- constructor(options?: any);
7485
- delimiter: any;
7486
- context: any;
8236
+ constructor(options?: NamedChunkIdsPluginOptions);
8237
+ delimiter: string;
8238
+ context?: string;
7487
8239
 
7488
8240
  /**
7489
8241
  * Apply the plugin
7490
8242
  */
7491
8243
  apply(compiler: Compiler): void;
7492
8244
  }
8245
+ declare interface NamedChunkIdsPluginOptions {
8246
+ /**
8247
+ * context
8248
+ */
8249
+ context?: string;
8250
+
8251
+ /**
8252
+ * delimiter
8253
+ */
8254
+ delimiter?: string;
8255
+ }
7493
8256
  declare class NamedModuleIdsPlugin {
7494
- constructor(options?: any);
7495
- options: any;
8257
+ constructor(options?: NamedModuleIdsPluginOptions);
8258
+ options: NamedModuleIdsPluginOptions;
7496
8259
 
7497
8260
  /**
7498
8261
  * Apply the plugin
7499
8262
  */
7500
8263
  apply(compiler: Compiler): void;
7501
8264
  }
8265
+ declare interface NamedModuleIdsPluginOptions {
8266
+ /**
8267
+ * context
8268
+ */
8269
+ context?: string;
8270
+ }
7502
8271
  declare class NaturalModuleIdsPlugin {
7503
8272
  constructor();
7504
8273
 
@@ -7520,6 +8289,7 @@ declare class NoEmitOnErrorsPlugin {
7520
8289
  */
7521
8290
  apply(compiler: Compiler): void;
7522
8291
  }
8292
+ type Node = false | NodeOptions;
7523
8293
  declare class NodeEnvironmentPlugin {
7524
8294
  constructor(options: {
7525
8295
  /**
@@ -7539,81 +8309,6 @@ declare class NodeEnvironmentPlugin {
7539
8309
  */
7540
8310
  apply(compiler: Compiler): void;
7541
8311
  }
7542
- type NodeEstreeIndex =
7543
- | UnaryExpression
7544
- | ThisExpression
7545
- | ArrayExpression
7546
- | ObjectExpression
7547
- | FunctionExpression
7548
- | ArrowFunctionExpression
7549
- | YieldExpression
7550
- | SimpleLiteral
7551
- | RegExpLiteral
7552
- | BigIntLiteral
7553
- | UpdateExpression
7554
- | BinaryExpression
7555
- | AssignmentExpression
7556
- | LogicalExpression
7557
- | MemberExpression
7558
- | ConditionalExpression
7559
- | SimpleCallExpression
7560
- | NewExpression
7561
- | SequenceExpression
7562
- | TemplateLiteral
7563
- | TaggedTemplateExpression
7564
- | ClassExpression
7565
- | MetaProperty
7566
- | Identifier
7567
- | AwaitExpression
7568
- | ImportExpression
7569
- | ChainExpression
7570
- | FunctionDeclaration
7571
- | VariableDeclaration
7572
- | ClassDeclaration
7573
- | PrivateIdentifier
7574
- | ExpressionStatement
7575
- | BlockStatement
7576
- | StaticBlock
7577
- | EmptyStatement
7578
- | DebuggerStatement
7579
- | WithStatement
7580
- | ReturnStatement
7581
- | LabeledStatement
7582
- | BreakStatement
7583
- | ContinueStatement
7584
- | IfStatement
7585
- | SwitchStatement
7586
- | ThrowStatement
7587
- | TryStatement
7588
- | WhileStatement
7589
- | DoWhileStatement
7590
- | ForStatement
7591
- | ForInStatement
7592
- | ForOfStatement
7593
- | ImportDeclaration
7594
- | ExportNamedDeclaration
7595
- | ExportDefaultDeclaration
7596
- | ExportAllDeclaration
7597
- | MethodDefinition
7598
- | PropertyDefinition
7599
- | VariableDeclarator
7600
- | Program
7601
- | SwitchCase
7602
- | CatchClause
7603
- | Property
7604
- | AssignmentProperty
7605
- | Super
7606
- | TemplateElement
7607
- | SpreadElement
7608
- | ObjectPattern
7609
- | ArrayPattern
7610
- | RestElement
7611
- | AssignmentPattern
7612
- | ClassBody
7613
- | ImportSpecifier
7614
- | ImportDefaultSpecifier
7615
- | ImportNamespaceSpecifier
7616
- | ExportSpecifier;
7617
8312
 
7618
8313
  /**
7619
8314
  * Options object for node compatibility features.
@@ -7651,14 +8346,19 @@ declare class NodeTargetPlugin {
7651
8346
  apply(compiler: Compiler): void;
7652
8347
  }
7653
8348
  declare class NodeTemplatePlugin {
7654
- constructor(options?: any);
8349
+ constructor(options?: NodeTemplatePluginOptions);
7655
8350
 
7656
8351
  /**
7657
8352
  * Apply the plugin
7658
8353
  */
7659
8354
  apply(compiler: Compiler): void;
7660
8355
  }
7661
- type NodeWebpackOptions = false | NodeOptions;
8356
+ declare interface NodeTemplatePluginOptions {
8357
+ /**
8358
+ * enable async chunk loading
8359
+ */
8360
+ asyncChunkLoading?: boolean;
8361
+ }
7662
8362
  declare class NormalModule extends Module {
7663
8363
  constructor(__0: NormalModuleCreateData);
7664
8364
  request: string;
@@ -7718,9 +8418,9 @@ declare interface NormalModuleCreateData {
7718
8418
  layer?: string;
7719
8419
 
7720
8420
  /**
7721
- * module type
8421
+ * module type. When deserializing, this is set to an empty string "".
7722
8422
  */
7723
- type: string;
8423
+ type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
7724
8424
 
7725
8425
  /**
7726
8426
  * request string
@@ -7818,6 +8518,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
7818
8518
  parser: HookMap<SyncHook<any>>;
7819
8519
  createGenerator: HookMap<SyncBailHook<any, any>>;
7820
8520
  generator: HookMap<SyncHook<any>>;
8521
+ createModuleClass: HookMap<SyncBailHook<any, any>>;
7821
8522
  }>;
7822
8523
  resolverFactory: ResolverFactory;
7823
8524
  ruleSet: RuleSet;
@@ -7863,9 +8564,9 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7863
8564
  context: string,
7864
8565
  request: string,
7865
8566
  callback: (
7866
- arg0: null | Error,
7867
- arg1?: string | false,
7868
- arg2?: ResolveRequest
8567
+ err: null | ErrorWithDetail,
8568
+ res?: string | false,
8569
+ req?: ResolveRequest
7869
8570
  ) => void
7870
8571
  ): any;
7871
8572
  getResolve(options?: ResolveOptionsWithDependencyType): {
@@ -7873,9 +8574,9 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7873
8574
  context: string,
7874
8575
  request: string,
7875
8576
  callback: (
7876
- arg0: null | Error,
7877
- arg1?: string | false,
7878
- arg2?: ResolveRequest
8577
+ err: null | ErrorWithDetail,
8578
+ res?: string | false,
8579
+ req?: ResolveRequest
7879
8580
  ) => void
7880
8581
  ): void;
7881
8582
  (context: string, request: string): Promise<string>;
@@ -7907,10 +8608,10 @@ declare class NormalModuleReplacementPlugin {
7907
8608
  */
7908
8609
  constructor(
7909
8610
  resourceRegExp: RegExp,
7910
- newResource: string | ((arg0?: any) => void)
8611
+ newResource: string | ((arg0: ResolveData) => void)
7911
8612
  );
7912
8613
  resourceRegExp: RegExp;
7913
- newResource: string | ((arg0?: any) => void);
8614
+ newResource: string | ((arg0: ResolveData) => void);
7914
8615
 
7915
8616
  /**
7916
8617
  * Apply the plugin
@@ -7972,6 +8673,7 @@ declare class NullDependencyTemplate extends DependencyTemplate {
7972
8673
  }
7973
8674
  declare interface ObjectDeserializerContext {
7974
8675
  read: () => any;
8676
+ setCircularReference: (arg0?: any) => void;
7975
8677
  }
7976
8678
  declare interface ObjectSerializer {
7977
8679
  serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
@@ -7979,6 +8681,7 @@ declare interface ObjectSerializer {
7979
8681
  }
7980
8682
  declare interface ObjectSerializerContext {
7981
8683
  write: (arg0?: any) => void;
8684
+ setCircularReference: (arg0?: any) => void;
7982
8685
  }
7983
8686
  declare class OccurrenceChunkIdsPlugin {
7984
8687
  constructor(options?: OccurrenceChunkIdsPluginOptions);
@@ -8075,6 +8778,11 @@ declare interface Optimization {
8075
8778
  * Minimizer(s) to use for minimizing the output.
8076
8779
  */
8077
8780
  minimizer?: (
8781
+ | undefined
8782
+ | null
8783
+ | false
8784
+ | ""
8785
+ | 0
8078
8786
  | ((this: Compiler, compiler: Compiler) => void)
8079
8787
  | WebpackPluginInstance
8080
8788
  | "..."
@@ -8162,7 +8870,7 @@ declare interface OptimizationSplitChunksCacheGroup {
8162
8870
  /**
8163
8871
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
8164
8872
  */
8165
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8873
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8166
8874
 
8167
8875
  /**
8168
8876
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -8289,7 +8997,7 @@ declare interface OptimizationSplitChunksOptions {
8289
8997
  /**
8290
8998
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8291
8999
  */
8292
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9000
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8293
9001
 
8294
9002
  /**
8295
9003
  * Sets the size types which are used when a number is used for sizes.
@@ -8312,7 +9020,7 @@ declare interface OptimizationSplitChunksOptions {
8312
9020
  /**
8313
9021
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8314
9022
  */
8315
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9023
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8316
9024
  /**
8317
9025
  * Maximal size hint for the on-demand chunks.
8318
9026
  */
@@ -8417,6 +9125,11 @@ declare class OriginalSource extends Source {
8417
9125
  * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
8418
9126
  */
8419
9127
  declare interface Output {
9128
+ /**
9129
+ * Add a container for define/require functions in the AMD module.
9130
+ */
9131
+ amdContainer?: string;
9132
+
8420
9133
  /**
8421
9134
  * The filename of asset modules as relative path inside the 'output.path' directory.
8422
9135
  */
@@ -8575,6 +9288,11 @@ declare interface Output {
8575
9288
  */
8576
9289
  hotUpdateMainFilename?: string;
8577
9290
 
9291
+ /**
9292
+ * Ignore warnings in the browser.
9293
+ */
9294
+ ignoreBrowserWarnings?: boolean;
9295
+
8578
9296
  /**
8579
9297
  * Wrap javascript code into IIFE's to avoid leaking into global scope.
8580
9298
  */
@@ -8680,6 +9398,11 @@ declare interface Output {
8680
9398
  */
8681
9399
  workerChunkLoading?: string | false;
8682
9400
 
9401
+ /**
9402
+ * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
9403
+ */
9404
+ workerPublicPath?: string;
9405
+
8683
9406
  /**
8684
9407
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
8685
9408
  */
@@ -8884,6 +9607,11 @@ declare interface OutputNormalized {
8884
9607
  */
8885
9608
  hotUpdateMainFilename?: string;
8886
9609
 
9610
+ /**
9611
+ * Ignore warnings in the browser.
9612
+ */
9613
+ ignoreBrowserWarnings?: boolean;
9614
+
8887
9615
  /**
8888
9616
  * Wrap javascript code into IIFE's to avoid leaking into global scope.
8889
9617
  */
@@ -8974,6 +9702,11 @@ declare interface OutputNormalized {
8974
9702
  */
8975
9703
  workerChunkLoading?: string | false;
8976
9704
 
9705
+ /**
9706
+ * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
9707
+ */
9708
+ workerPublicPath?: string;
9709
+
8977
9710
  /**
8978
9711
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
8979
9712
  */
@@ -9076,6 +9809,13 @@ declare interface PathData {
9076
9809
  noChunkHash?: boolean;
9077
9810
  url?: string;
9078
9811
  }
9812
+ type Pattern =
9813
+ | Identifier
9814
+ | MemberExpression
9815
+ | ObjectPattern
9816
+ | ArrayPattern
9817
+ | RestElement
9818
+ | AssignmentPattern;
9079
9819
 
9080
9820
  /**
9081
9821
  * Configuration object for web performance recommendations.
@@ -9117,6 +9857,11 @@ declare interface PitchLoaderDefinitionFunction<
9117
9857
  ): string | void | Buffer | Promise<string | Buffer>;
9118
9858
  }
9119
9859
  type Plugin =
9860
+ | undefined
9861
+ | null
9862
+ | false
9863
+ | ""
9864
+ | 0
9120
9865
  | { apply: (arg0: Resolver) => void }
9121
9866
  | ((this: Resolver, arg1: Resolver) => void);
9122
9867
  declare interface PnpApiImpl {
@@ -9129,9 +9874,9 @@ declare interface PossibleFileSystemError {
9129
9874
  syscall?: string;
9130
9875
  }
9131
9876
  declare class PrefetchPlugin {
9132
- constructor(context?: any, request?: any);
9133
- context: any;
9134
- request: any;
9877
+ constructor(context: string, request?: string);
9878
+ context: null | string;
9879
+ request: string;
9135
9880
 
9136
9881
  /**
9137
9882
  * Apply the plugin
@@ -9173,14 +9918,18 @@ declare class Profiler {
9173
9918
  inspector: any;
9174
9919
  hasSession(): boolean;
9175
9920
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
9176
- sendCommand(method?: any, params?: any): Promise<any>;
9921
+ sendCommand(method: string, params?: object): Promise<any>;
9177
9922
  destroy(): Promise<void>;
9178
9923
  stopProfiling(): Promise<{ profile: any }>;
9179
9924
  }
9180
9925
  declare class ProfilingPlugin {
9181
9926
  constructor(options?: ProfilingPluginOptions);
9182
9927
  outputPath: string;
9183
- apply(compiler?: any): void;
9928
+
9929
+ /**
9930
+ * Apply the plugin
9931
+ */
9932
+ apply(compiler: Compiler): void;
9184
9933
  static Profiler: typeof Profiler;
9185
9934
  }
9186
9935
  declare interface ProfilingPluginOptions {
@@ -9199,11 +9948,11 @@ declare class ProgressPlugin {
9199
9948
  showModules?: boolean;
9200
9949
  showDependencies?: boolean;
9201
9950
  showActiveModules?: boolean;
9202
- percentBy?: null | "modules" | "dependencies" | "entries";
9951
+ percentBy?: null | "entries" | "modules" | "dependencies";
9203
9952
  apply(compiler: Compiler | MultiCompiler): void;
9204
9953
  static getReporter(
9205
9954
  compiler: Compiler
9206
- ): (p: number, ...args: string[]) => void;
9955
+ ): undefined | ((p: number, ...args: string[]) => void);
9207
9956
  static defaultOptions: {
9208
9957
  profile: boolean;
9209
9958
  modulesCount: number;
@@ -9213,6 +9962,10 @@ declare class ProgressPlugin {
9213
9962
  activeModules: boolean;
9214
9963
  entries: boolean;
9215
9964
  };
9965
+ static createDefaultHandler: (
9966
+ profile: undefined | null | boolean,
9967
+ logger: WebpackLogger
9968
+ ) => (percentage: number, msg: string, ...args: string[]) => void;
9216
9969
  }
9217
9970
  type ProgressPluginArgument =
9218
9971
  | ProgressPluginOptions
@@ -9260,7 +10013,7 @@ declare interface ProgressPluginOptions {
9260
10013
  /**
9261
10014
  * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
9262
10015
  */
9263
- percentBy?: null | "modules" | "dependencies" | "entries";
10016
+ percentBy?: null | "entries" | "modules" | "dependencies";
9264
10017
 
9265
10018
  /**
9266
10019
  * Collect profile data for progress steps. Default: false.
@@ -9331,6 +10084,7 @@ declare interface ProvidesObject {
9331
10084
  declare interface RawChunkGroupOptions {
9332
10085
  preloadOrder?: number;
9333
10086
  prefetchOrder?: number;
10087
+ fetchPriority?: "auto" | "low" | "high";
9334
10088
  }
9335
10089
  type RawLoaderDefinition<
9336
10090
  OptionsType = {},
@@ -9358,17 +10112,58 @@ declare class RawSource extends Source {
9358
10112
  constructor(source: string | Buffer, convertToString?: boolean);
9359
10113
  isBuffer(): boolean;
9360
10114
  }
10115
+ declare interface RawSourceMap {
10116
+ version: number;
10117
+ sources: string[];
10118
+ names: string[];
10119
+ sourceRoot?: string;
10120
+ sourcesContent?: string[];
10121
+ mappings: string;
10122
+ file: string;
10123
+ }
9361
10124
  declare class ReadFileCompileWasmPlugin {
9362
- constructor(options?: any);
9363
- options: any;
10125
+ constructor(options?: ReadFileCompileWasmPluginOptions);
10126
+ options: ReadFileCompileWasmPluginOptions;
9364
10127
 
9365
10128
  /**
9366
10129
  * Apply the plugin
9367
10130
  */
9368
10131
  apply(compiler: Compiler): void;
9369
10132
  }
10133
+ declare interface ReadFileCompileWasmPluginOptions {
10134
+ /**
10135
+ * mangle imports
10136
+ */
10137
+ mangleImports?: boolean;
10138
+ }
10139
+ declare interface ReaddirOptions {
10140
+ encoding?:
10141
+ | null
10142
+ | "ascii"
10143
+ | "utf8"
10144
+ | "utf16le"
10145
+ | "ucs2"
10146
+ | "latin1"
10147
+ | "binary"
10148
+ | "utf-8"
10149
+ | "ucs-2"
10150
+ | "base64"
10151
+ | "base64url"
10152
+ | "hex"
10153
+ | "buffer";
10154
+ withFileTypes?: boolean;
10155
+ }
9370
10156
  declare class RealContentHashPlugin {
9371
- constructor(__0: { hashFunction: any; hashDigest: any });
10157
+ constructor(__0: {
10158
+ /**
10159
+ * the hash function to use
10160
+ */
10161
+ hashFunction: string | typeof Hash;
10162
+ /**
10163
+ * the hash digest to use
10164
+ */
10165
+ hashDigest: string;
10166
+ });
9372
10167
 
9373
10168
  /**
9374
10169
  * Apply the plugin
@@ -9796,7 +10591,15 @@ declare interface ResolveOptionsWebpackOptions {
9796
10591
  /**
9797
10592
  * Plugins for the resolver.
9798
10593
  */
9799
- plugins?: (ResolvePluginInstance | "...")[];
10594
+ plugins?: (
10595
+ | undefined
10596
+ | null
10597
+ | false
10598
+ | ""
10599
+ | 0
10600
+ | ResolvePluginInstance
10601
+ | "..."
10602
+ )[];
9800
10603
 
9801
10604
  /**
9802
10605
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -9867,23 +10670,7 @@ declare interface ResolvedContextTimestampAndHash {
9867
10670
  declare abstract class Resolver {
9868
10671
  fileSystem: FileSystem;
9869
10672
  options: ResolveOptionsTypes;
9870
- hooks: {
9871
- resolveStep: SyncHook<
9872
- [
9873
- AsyncSeriesBailHook<
9874
- [ResolveRequest, ResolveContext],
9875
- null | ResolveRequest
9876
- >,
9877
- ResolveRequest
9878
- ]
9879
- >;
9880
- noResolve: SyncHook<[ResolveRequest, Error]>;
9881
- resolve: AsyncSeriesBailHook<
9882
- [ResolveRequest, ResolveContext],
9883
- null | ResolveRequest
9884
- >;
9885
- result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
9886
- };
10673
+ hooks: KnownHooks;
9887
10674
  ensureHook(
9888
10675
  name:
9889
10676
  | string
@@ -9913,24 +10700,27 @@ declare abstract class Resolver {
9913
10700
  request: string,
9914
10701
  resolveContext: ResolveContext,
9915
10702
  callback: (
9916
- arg0: null | Error,
9917
- arg1?: string | false,
9918
- arg2?: ResolveRequest
10703
+ err: null | ErrorWithDetail,
10704
+ res?: string | false,
10705
+ req?: ResolveRequest
9919
10706
  ) => void
9920
10707
  ): void;
9921
10708
  doResolve(
9922
- hook?: any,
9923
- request?: any,
9924
- message?: any,
9925
- resolveContext?: any,
9926
- callback?: any
9927
- ): any;
10709
+ hook: AsyncSeriesBailHook<
10710
+ [ResolveRequest, ResolveContext],
10711
+ null | ResolveRequest
10712
+ >,
10713
+ request: ResolveRequest,
10714
+ message: null | string,
10715
+ resolveContext: ResolveContext,
10716
+ callback: (err?: null | Error, result?: ResolveRequest) => void
10717
+ ): void;
9928
10718
  parse(identifier: string): ParsedIdentifier;
9929
- isModule(path?: any): boolean;
9930
- isPrivate(path?: any): boolean;
10719
+ isModule(path: string): boolean;
10720
+ isPrivate(path: string): boolean;
9931
10721
  isDirectory(path: string): boolean;
9932
- join(path?: any, request?: any): string;
9933
- normalize(path?: any): string;
10722
+ join(path: string, request: string): string;
10723
+ normalize(path: string): string;
9934
10724
  }
9935
10725
  declare interface ResolverCache {
9936
10726
  direct: WeakMap<Object, ResolverWithOptions>;
@@ -10149,7 +10939,7 @@ declare interface RuleSetRule {
10149
10939
  /**
10150
10940
  * Only execute the first matching rule in this array.
10151
10941
  */
10152
- oneOf?: RuleSetRule[];
10942
+ oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10153
10943
 
10154
10944
  /**
10155
10945
  * Shortcut for use.options.
@@ -10209,7 +10999,7 @@ declare interface RuleSetRule {
10209
10999
  /**
10210
11000
  * Match and execute these rules when this rule is matched.
10211
11001
  */
10212
- rules?: RuleSetRule[];
11002
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10213
11003
 
10214
11004
  /**
10215
11005
  * Match module scheme.
@@ -10246,14 +11036,52 @@ declare interface RuleSetRule {
10246
11036
  */
10247
11037
  use?:
10248
11038
  | string
10249
- | RuleSetUseItem[]
11039
+ | (
11040
+ | undefined
11041
+ | null
11042
+ | string
11043
+ | false
11044
+ | 0
11045
+ | {
11046
+ /**
11047
+ * Unique loader options identifier.
11048
+ */
11049
+ ident?: string;
11050
+ /**
11051
+ * Loader name.
11052
+ */
11053
+ loader?: string;
11054
+ /**
11055
+ * Loader options.
11056
+ */
11057
+ options?: string | { [index: string]: any };
11058
+ }
11059
+ | ((data: object) =>
11060
+ | string
11061
+ | {
11062
+ /**
11063
+ * Unique loader options identifier.
11064
+ */
11065
+ ident?: string;
11066
+ /**
11067
+ * Loader name.
11068
+ */
11069
+ loader?: string;
11070
+ /**
11071
+ * Loader options.
11072
+ */
11073
+ options?: string | { [index: string]: any };
11074
+ }
11075
+ | __TypeWebpackOptions
11076
+ | __Type_2[])
11077
+ )[]
10250
11078
  | ((data: {
10251
11079
  resource: string;
10252
11080
  realResource: string;
10253
11081
  resourceQuery: string;
10254
11082
  issuer: string;
10255
11083
  compiler: string;
10256
- }) => RuleSetUseItem[])
11084
+ }) => __Type_2[])
10257
11085
  | {
10258
11086
  /**
10259
11087
  * Unique loader options identifier.
@@ -10268,35 +11096,56 @@ declare interface RuleSetRule {
10268
11096
  */
10269
11097
  options?: string | { [index: string]: any };
10270
11098
  }
10271
- | ((data: object) =>
10272
- | string
10273
- | {
10274
- /**
10275
- * Unique loader options identifier.
10276
- */
10277
- ident?: string;
10278
- /**
10279
- * Loader name.
10280
- */
10281
- loader?: string;
10282
- /**
10283
- * Loader options.
10284
- */
10285
- options?: string | { [index: string]: any };
10286
- }
10287
- | __TypeWebpackOptions
10288
- | RuleSetUseItem[]);
11099
+ | __TypeWebpackOptions;
10289
11100
  }
10290
11101
  type RuleSetUse =
10291
11102
  | string
10292
- | RuleSetUseItem[]
11103
+ | (
11104
+ | undefined
11105
+ | null
11106
+ | string
11107
+ | false
11108
+ | 0
11109
+ | {
11110
+ /**
11111
+ * Unique loader options identifier.
11112
+ */
11113
+ ident?: string;
11114
+ /**
11115
+ * Loader name.
11116
+ */
11117
+ loader?: string;
11118
+ /**
11119
+ * Loader options.
11120
+ */
11121
+ options?: string | { [index: string]: any };
11122
+ }
11123
+ | ((data: object) =>
11124
+ | string
11125
+ | {
11126
+ /**
11127
+ * Unique loader options identifier.
11128
+ */
11129
+ ident?: string;
11130
+ /**
11131
+ * Loader name.
11132
+ */
11133
+ loader?: string;
11134
+ /**
11135
+ * Loader options.
11136
+ */
11137
+ options?: string | { [index: string]: any };
11138
+ }
11139
+ | __TypeWebpackOptions
11140
+ | __Type_2[])
11141
+ )[]
10293
11142
  | ((data: {
10294
11143
  resource: string;
10295
11144
  realResource: string;
10296
11145
  resourceQuery: string;
10297
11146
  issuer: string;
10298
11147
  compiler: string;
10299
- }) => RuleSetUseItem[])
11148
+ }) => __Type_2[])
10300
11149
  | {
10301
11150
  /**
10302
11151
  * Unique loader options identifier.
@@ -10343,14 +11192,14 @@ declare class RuntimeModule extends Module {
10343
11192
  constructor(name: string, stage?: number);
10344
11193
  name: string;
10345
11194
  stage: number;
10346
- compilation: Compilation;
10347
- chunk: Chunk;
10348
- chunkGraph: ChunkGraph;
11195
+ compilation?: Compilation;
11196
+ chunk?: Chunk;
11197
+ chunkGraph?: ChunkGraph;
10349
11198
  fullHash: boolean;
10350
11199
  dependentHash: boolean;
10351
11200
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
10352
- generate(): string;
10353
- getGeneratedCode(): string;
11201
+ generate(): null | string;
11202
+ getGeneratedCode(): null | string;
10354
11203
  shouldIsolate(): boolean;
10355
11204
 
10356
11205
  /**
@@ -10387,20 +11236,20 @@ declare interface RuntimeRequirementsContext {
10387
11236
  type RuntimeSpec = undefined | string | SortableSet<string>;
10388
11237
  declare class RuntimeSpecMap<T> {
10389
11238
  constructor(clone?: RuntimeSpecMap<T>);
10390
- get(runtime: RuntimeSpec): T;
11239
+ get(runtime: RuntimeSpec): undefined | T;
10391
11240
  has(runtime: RuntimeSpec): boolean;
10392
11241
  set(runtime?: any, value?: any): void;
10393
11242
  provide(runtime?: any, computer?: any): any;
10394
- delete(runtime?: any): void;
11243
+ delete(runtime: RuntimeSpec): void;
10395
11244
  update(runtime?: any, fn?: any): void;
10396
11245
  keys(): RuntimeSpec[];
10397
11246
  values(): IterableIterator<T>;
10398
11247
  get size(): number;
10399
11248
  }
10400
11249
  declare class RuntimeSpecSet {
10401
- constructor(iterable?: any);
10402
- add(runtime?: any): void;
10403
- has(runtime?: any): boolean;
11250
+ constructor(iterable?: Iterable<RuntimeSpec>);
11251
+ add(runtime: RuntimeSpec): void;
11252
+ has(runtime: RuntimeSpec): boolean;
10404
11253
  get size(): number;
10405
11254
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
10406
11255
  }
@@ -10530,7 +11379,7 @@ declare abstract class RuntimeTemplate {
10530
11379
  /**
10531
11380
  * the module
10532
11381
  */
10533
- module: Module;
11382
+ module: null | Module;
10534
11383
  /**
10535
11384
  * the chunk graph
10536
11385
  */
@@ -10552,7 +11401,7 @@ declare abstract class RuntimeTemplate {
10552
11401
  /**
10553
11402
  * the module
10554
11403
  */
10555
- module: Module;
11404
+ module: null | Module;
10556
11405
  /**
10557
11406
  * the chunk graph
10558
11407
  */
@@ -10714,7 +11563,7 @@ declare abstract class RuntimeTemplate {
10714
11563
  /**
10715
11564
  * when false, call context will not be preserved
10716
11565
  */
10717
- callContext: boolean;
11566
+ callContext: null | boolean;
10718
11567
  /**
10719
11568
  * when true and accessing the default exports, interop code will be generated
10720
11569
  */
@@ -10841,13 +11690,20 @@ declare interface RuntimeValueOptions {
10841
11690
  buildDependencies?: string[];
10842
11691
  version?: string | (() => string);
10843
11692
  }
11693
+
11694
+ /**
11695
+ * Helper function for joining two ranges into a single range. This is useful
11696
+ * when working with AST nodes, as it allows you to combine the ranges of child nodes
11697
+ * to create the range of the _parent node_.
11698
+ */
10844
11699
  declare interface ScopeInfo {
10845
11700
  definitions: StackedMap<string, ScopeInfo | VariableInfo>;
10846
11701
  topLevelScope: boolean | "arrow";
10847
- inShorthand: boolean;
11702
+ inShorthand: string | boolean;
11703
+ inTaggedTemplateTag: boolean;
11704
+ inTry: boolean;
10848
11705
  isStrict: boolean;
10849
11706
  isAsmJs: boolean;
10850
- inTry: boolean;
10851
11707
  }
10852
11708
  declare interface Selector<A, B> {
10853
11709
  (input: A): B;
@@ -10859,9 +11715,10 @@ declare abstract class Serializer {
10859
11715
  serialize(obj?: any, context?: any): any;
10860
11716
  deserialize(value?: any, context?: any): any;
10861
11717
  }
10862
- type ServerOptionsHttps = SecureContextOptions &
10863
- TlsOptions &
10864
- ServerOptionsImport;
11718
+ type ServerOptionsHttps<
11719
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
11720
+ Response extends typeof ServerResponse = typeof ServerResponse
11721
+ > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
10865
11722
  declare class SharePlugin {
10866
11723
  constructor(options: SharePluginOptions);
10867
11724
 
@@ -10951,10 +11808,10 @@ declare class SideEffectsFlagPlugin {
10951
11808
  */
10952
11809
  apply(compiler: Compiler): void;
10953
11810
  static moduleHasSideEffects(
10954
- moduleName?: any,
10955
- flagValue?: any,
10956
- cache?: any
10957
- ): any;
11811
+ moduleName: string,
11812
+ flagValue: undefined | string | boolean | string[],
11813
+ cache: Map<string, RegExp>
11814
+ ): undefined | boolean;
10958
11815
  }
10959
11816
  declare class SizeOnlySource extends Source {
10960
11817
  constructor(size: number);
@@ -11001,8 +11858,8 @@ declare abstract class Snapshot {
11001
11858
  hasChildren(): boolean;
11002
11859
  setChildren(value?: any): void;
11003
11860
  addChild(child?: any): void;
11004
- serialize(__0: { write: any }): void;
11005
- deserialize(__0: { read: any }): void;
11861
+ serialize(__0: ObjectSerializerContext): void;
11862
+ deserialize(__0: ObjectDeserializerContext): void;
11006
11863
  getFileIterable(): Iterable<string>;
11007
11864
  getContextIterable(): Iterable<string>;
11008
11865
  getMissingIterable(): Iterable<string>;
@@ -11104,7 +11961,7 @@ declare abstract class SortableSet<T> extends Set<T> {
11104
11961
  declare class Source {
11105
11962
  constructor();
11106
11963
  size(): number;
11107
- map(options?: MapOptions): Object;
11964
+ map(options?: MapOptions): null | RawSourceMap;
11108
11965
  sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
11109
11966
  updateHash(hash: Hash): void;
11110
11967
  source(): string | Buffer;
@@ -11125,7 +11982,10 @@ declare interface SourceMap {
11125
11982
  declare class SourceMapDevToolPlugin {
11126
11983
  constructor(options?: SourceMapDevToolPluginOptions);
11127
11984
  sourceMapFilename: string | false;
11128
- sourceMappingURLComment: string | false;
11985
+ sourceMappingURLComment:
11986
+ | string
11987
+ | false
11988
+ | ((arg0: PathData, arg1?: AssetInfo) => string);
11129
11989
  moduleFilenameTemplate: string | Function;
11130
11990
  fallbackModuleFilenameTemplate: string | Function;
11131
11991
  namespace: string;
@@ -11140,7 +12000,11 @@ declare interface SourceMapDevToolPluginOptions {
11140
12000
  /**
11141
12001
  * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
11142
12002
  */
11143
- append?: null | string | false;
12003
+ append?:
12004
+ | null
12005
+ | string
12006
+ | false
12007
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
11144
12008
 
11145
12009
  /**
11146
12010
  * Indicates whether column mappings should be used (defaults to true).
@@ -11230,7 +12094,7 @@ declare interface SourcePosition {
11230
12094
  column?: number;
11231
12095
  }
11232
12096
  declare interface SplitChunksOptions {
11233
- chunksFilter: (chunk: Chunk) => boolean;
12097
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
11234
12098
  defaultSizeTypes: string[];
11235
12099
  minSize: SplitChunksSizes;
11236
12100
  minSizeReduction: SplitChunksSizes;
@@ -11547,6 +12411,11 @@ declare interface StatsOptions {
11547
12411
  */
11548
12412
  errorsCount?: boolean;
11549
12413
 
12414
+ /**
12415
+ * Space to display errors (value is in number of lines).
12416
+ */
12417
+ errorsSpace?: number;
12418
+
11550
12419
  /**
11551
12420
  * Please use excludeModules instead.
11552
12421
  */
@@ -11807,6 +12676,11 @@ declare interface StatsOptions {
11807
12676
  | RegExp
11808
12677
  | WarningFilterItemTypes[]
11809
12678
  | ((warning: StatsError, value: string) => boolean);
12679
+
12680
+ /**
12681
+ * Space to display warnings (value is in number of lines).
12682
+ */
12683
+ warningsSpace?: number;
11810
12684
  }
11811
12685
  declare abstract class StatsPrinter {
11812
12686
  hooks: Readonly<{
@@ -11867,6 +12741,12 @@ declare interface SyntheticDependencyLocation {
11867
12741
  declare const TOMBSTONE: unique symbol;
11868
12742
  declare const TRANSITIVE: unique symbol;
11869
12743
  declare const TRANSITIVE_ONLY: unique symbol;
12744
+
12745
+ /**
12746
+ * Helper function for joining two ranges into a single range. This is useful
12747
+ * when working with AST nodes, as it allows you to combine the ranges of child nodes
12748
+ * to create the range of the _parent node_.
12749
+ */
11870
12750
  declare interface TagInfo {
11871
12751
  tag: any;
11872
12752
  data: any;
@@ -11890,7 +12770,7 @@ declare class Template {
11890
12770
  modules: Module[],
11891
12771
  renderModule: (arg0: Module) => Source,
11892
12772
  prefix?: string
11893
- ): Source;
12773
+ ): null | Source;
11894
12774
  static renderRuntimeModules(
11895
12775
  runtimeModules: RuntimeModule[],
11896
12776
  renderContext: RenderContext & {
@@ -11918,6 +12798,11 @@ declare class TopLevelSymbol {
11918
12798
  * Use a Trusted Types policy to create urls for chunks.
11919
12799
  */
11920
12800
  declare interface TrustedTypes {
12801
+ /**
12802
+ * If the call to `trustedTypes.createPolicy(...)` fails -- e.g., due to the policy name missing from the CSP `trusted-types` list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that `require-trusted-types-for 'script'` isn't enforced yet, versus fail immediately. Default behavior is 'stop'.
12803
+ */
12804
+ onPolicyCreationFailure?: "continue" | "stop";
12805
+
11921
12806
  /**
11922
12807
  * The name of the Trusted Types policy created by webpack to serve bundle chunks.
11923
12808
  */
@@ -12086,7 +12971,7 @@ declare interface UserResolveOptions {
12086
12971
  }
12087
12972
  declare abstract class VariableInfo {
12088
12973
  declaredScope: ScopeInfo;
12089
- freeName: string | true;
12974
+ freeName?: string | true;
12090
12975
  tagInfo?: TagInfo;
12091
12976
  }
12092
12977
  declare interface VariableInfoInterface {
@@ -12314,14 +13199,14 @@ declare class WebpackError extends Error {
12314
13199
  * Creates an instance of WebpackError.
12315
13200
  */
12316
13201
  constructor(message?: string);
12317
- details: any;
12318
- module: Module;
12319
- loc: DependencyLocation;
12320
- hideStack: boolean;
12321
- chunk: Chunk;
12322
- file: string;
12323
- serialize(__0: { write: any }): void;
12324
- deserialize(__0: { read: any }): void;
13202
+ details?: string;
13203
+ module?: null | Module;
13204
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
13205
+ hideStack?: boolean;
13206
+ chunk?: Chunk;
13207
+ file?: string;
13208
+ serialize(__0: ObjectSerializerContext): void;
13209
+ deserialize(__0: ObjectDeserializerContext): void;
12325
13210
 
12326
13211
  /**
12327
13212
  * Create .stack property on a target object
@@ -12367,7 +13252,7 @@ declare class WebpackOptionsApply extends OptionsApply {
12367
13252
  }
12368
13253
  declare class WebpackOptionsDefaulter {
12369
13254
  constructor();
12370
- process(options?: any): any;
13255
+ process(options: Configuration): WebpackOptionsNormalized;
12371
13256
  }
12372
13257
 
12373
13258
  /**
@@ -12491,7 +13376,7 @@ declare interface WebpackOptionsNormalized {
12491
13376
  /**
12492
13377
  * Include polyfills or mocks for various node stuff.
12493
13378
  */
12494
- node: NodeWebpackOptions;
13379
+ node: Node;
12495
13380
 
12496
13381
  /**
12497
13382
  * Enables/Disables integrated optimizations.
@@ -12517,6 +13402,11 @@ declare interface WebpackOptionsNormalized {
12517
13402
  * Add additional plugins to the compiler.
12518
13403
  */
12519
13404
  plugins: (
13405
+ | undefined
13406
+ | null
13407
+ | false
13408
+ | ""
13409
+ | 0
12520
13410
  | ((this: Compiler, compiler: Compiler) => void)
12521
13411
  | WebpackPluginInstance
12522
13412
  )[];
@@ -12595,7 +13485,7 @@ declare interface WithOptions {
12595
13485
  ) => ResolverWithOptions;
12596
13486
  }
12597
13487
  declare interface WriteOnlySet<T> {
12598
- add: (T?: any) => void;
13488
+ add: (item: T) => void;
12599
13489
  }
12600
13490
  type __TypeWebpackOptions = (data: object) =>
12601
13491
  | string
@@ -12614,7 +13504,45 @@ type __TypeWebpackOptions = (data: object) =>
12614
13504
  options?: string | { [index: string]: any };
12615
13505
  }
12616
13506
  | __TypeWebpackOptions
12617
- | RuleSetUseItem[];
13507
+ | __Type_2[];
13508
+ type __Type_2 =
13509
+ | undefined
13510
+ | null
13511
+ | string
13512
+ | false
13513
+ | 0
13514
+ | {
13515
+ /**
13516
+ * Unique loader options identifier.
13517
+ */
13518
+ ident?: string;
13519
+ /**
13520
+ * Loader name.
13521
+ */
13522
+ loader?: string;
13523
+ /**
13524
+ * Loader options.
13525
+ */
13526
+ options?: string | { [index: string]: any };
13527
+ }
13528
+ | ((data: object) =>
13529
+ | string
13530
+ | {
13531
+ /**
13532
+ * Unique loader options identifier.
13533
+ */
13534
+ ident?: string;
13535
+ /**
13536
+ * Loader name.
13537
+ */
13538
+ loader?: string;
13539
+ /**
13540
+ * Loader options.
13541
+ */
13542
+ options?: string | { [index: string]: any };
13543
+ }
13544
+ | __TypeWebpackOptions
13545
+ | __Type_2[]);
12618
13546
  declare function exports(
12619
13547
  options: Configuration,
12620
13548
  callback?: CallbackWebpack<Stats>
@@ -12694,13 +13622,17 @@ declare namespace exports {
12694
13622
  hashFunction: string | typeof Hash;
12695
13623
  }
12696
13624
  ) => string;
12697
- export let replaceDuplicates: (
12698
- array?: any,
12699
- fn?: any,
12700
- comparator?: any
12701
- ) => any;
12702
- export let matchPart: (str?: any, test?: any) => any;
12703
- export let matchObject: (obj?: any, str?: any) => boolean;
13625
+ export let replaceDuplicates: <T>(
13626
+ array: T[],
13627
+ fn: (
13628
+ duplicateItem: T,
13629
+ duplicateItemIndex: number,
13630
+ numberOfTimesReplaced: number
13631
+ ) => T,
13632
+ comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
13633
+ ) => T[];
13634
+ export let matchPart: (str: string, test: Matcher) => boolean;
13635
+ export let matchObject: (obj: MatchObject, str: string) => boolean;
12704
13636
  }
12705
13637
  export namespace RuntimeGlobals {
12706
13638
  export let require: "__webpack_require__";
@@ -12738,6 +13670,7 @@ declare namespace exports {
12738
13670
  export let createScript: "__webpack_require__.ts";
12739
13671
  export let createScriptUrl: "__webpack_require__.tu";
12740
13672
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
13673
+ export let hasFetchPriority: "has fetch priority";
12741
13674
  export let chunkName: "__webpack_require__.cn";
12742
13675
  export let runtimeId: "__webpack_require__.j";
12743
13676
  export let getChunkScriptFilename: "__webpack_require__.u";
@@ -12841,7 +13774,7 @@ declare namespace exports {
12841
13774
  ) => void;
12842
13775
  export let setTopLevelSymbol: (
12843
13776
  state: ParserState,
12844
- symbol: TopLevelSymbol
13777
+ symbol?: TopLevelSymbol
12845
13778
  ) => void;
12846
13779
  export let getTopLevelSymbol: (
12847
13780
  state: ParserState
@@ -12849,7 +13782,7 @@ declare namespace exports {
12849
13782
  export let tagTopLevelSymbol: (
12850
13783
  parser: JavascriptParser,
12851
13784
  name: string
12852
- ) => TopLevelSymbol;
13785
+ ) => undefined | TopLevelSymbol;
12853
13786
  export let isDependencyUsedByExports: (
12854
13787
  dependency: Dependency,
12855
13788
  usedByExports: boolean | Set<string>,
@@ -12858,7 +13791,7 @@ declare namespace exports {
12858
13791
  ) => boolean;
12859
13792
  export let getDependencyUsedByExportsCondition: (
12860
13793
  dependency: Dependency,
12861
- usedByExports: boolean | Set<string>,
13794
+ usedByExports: undefined | boolean | Set<string>,
12862
13795
  moduleGraph: ModuleGraph
12863
13796
  ) =>
12864
13797
  | null
@@ -12935,7 +13868,7 @@ declare namespace exports {
12935
13868
  export { ProfilingPlugin };
12936
13869
  }
12937
13870
  export namespace util {
12938
- export const createHash: (algorithm: string | typeof Hash) => Hash;
13871
+ export const createHash: (algorithm?: string | typeof Hash) => Hash;
12939
13872
  export namespace comparators {
12940
13873
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
12941
13874
  export let compareModulesByIdentifier: (
@@ -13048,7 +13981,7 @@ declare namespace exports {
13048
13981
  export const register: (
13049
13982
  Constructor: Constructor,
13050
13983
  request: string,
13051
- name: string,
13984
+ name: null | string,
13052
13985
  serializer: ObjectSerializer
13053
13986
  ) => void;
13054
13987
  export const registerLoader: (
@@ -13059,8 +13992,8 @@ declare namespace exports {
13059
13992
  export const NOT_SERIALIZABLE: object;
13060
13993
  export const buffersSerializer: Serializer;
13061
13994
  export let createFileSerializer: (
13062
- fs?: any,
13063
- hashFunction?: any
13995
+ fs: IntermediateFileSystem,
13996
+ hashFunction: string | typeof Hash
13064
13997
  ) => Serializer;
13065
13998
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
13066
13999
  }
@@ -13153,8 +14086,14 @@ declare namespace exports {
13153
14086
  Entry,
13154
14087
  EntryNormalized,
13155
14088
  EntryObject,
14089
+ ExternalItemFunctionData,
14090
+ ExternalItemObjectKnown,
14091
+ ExternalItemObjectUnknown,
14092
+ ExternalItemValue,
14093
+ Externals,
13156
14094
  FileCacheOptions,
13157
14095
  LibraryOptions,
14096
+ MemoryCacheOptions,
13158
14097
  ModuleOptions,
13159
14098
  ResolveOptionsWebpackOptions as ResolveOptions,
13160
14099
  RuleSetCondition,
@@ -13166,12 +14105,14 @@ declare namespace exports {
13166
14105
  Configuration,
13167
14106
  WebpackOptionsNormalized,
13168
14107
  WebpackPluginInstance,
14108
+ ChunkGroup,
13169
14109
  Asset,
13170
14110
  AssetInfo,
13171
14111
  EntryOptions,
13172
14112
  PathData,
13173
14113
  AssetEmittedInfo,
13174
14114
  MultiStats,
14115
+ ResolveData,
13175
14116
  ParserState,
13176
14117
  ResolvePluginInstance,
13177
14118
  Resolver,