webpack 5.76.1 → 5.88.2

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 (442) 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 +6 -1
  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 +18 -14
  25. package/lib/ConcatenationScope.js +2 -2
  26. package/lib/ConditionalInitFragment.js +11 -1
  27. package/lib/ConstPlugin.js +95 -47
  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/DependencyTemplates.js +1 -1
  38. package/lib/DllEntryPlugin.js +16 -1
  39. package/lib/DllModule.js +17 -2
  40. package/lib/DllModuleFactory.js +1 -1
  41. package/lib/DllReferencePlugin.js +13 -1
  42. package/lib/Entrypoint.js +1 -1
  43. package/lib/ErrorHelpers.js +62 -22
  44. package/lib/EvalSourceMapDevToolPlugin.js +9 -2
  45. package/lib/ExportsInfo.js +25 -4
  46. package/lib/ExportsInfoApiPlugin.js +30 -14
  47. package/lib/ExternalModule.js +30 -9
  48. package/lib/FileSystemInfo.js +61 -25
  49. package/lib/FlagAllModulesAsUsedPlugin.js +27 -27
  50. package/lib/FlagDependencyExportsPlugin.js +336 -348
  51. package/lib/FlagDependencyUsagePlugin.js +9 -9
  52. package/lib/FlagEntryExportAsUsedPlugin.js +26 -23
  53. package/lib/Generator.js +7 -0
  54. package/lib/HookWebpackError.js +1 -1
  55. package/lib/HotModuleReplacementPlugin.js +60 -46
  56. package/lib/IgnoreErrorModuleFactory.js +1 -1
  57. package/lib/InitFragment.js +28 -5
  58. package/lib/JavascriptMetaInfoPlugin.js +27 -15
  59. package/lib/LibManifestPlugin.js +22 -5
  60. package/lib/LoaderOptionsPlugin.js +12 -2
  61. package/lib/MainTemplate.js +2 -2
  62. package/lib/Module.js +44 -12
  63. package/lib/ModuleBuildError.js +9 -0
  64. package/lib/ModuleDependencyError.js +4 -2
  65. package/lib/ModuleDependencyWarning.js +4 -2
  66. package/lib/ModuleError.js +9 -0
  67. package/lib/ModuleFactory.js +1 -1
  68. package/lib/ModuleFilenameHelpers.js +114 -4
  69. package/lib/ModuleGraph.js +33 -23
  70. package/lib/ModuleGraphConnection.js +19 -6
  71. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  72. package/lib/ModuleNotFoundError.js +5 -2
  73. package/lib/ModuleParseError.js +9 -0
  74. package/lib/ModuleProfile.js +1 -0
  75. package/lib/ModuleRestoreError.js +2 -0
  76. package/lib/ModuleStoreError.js +2 -1
  77. package/lib/ModuleTypeConstants.js +169 -0
  78. package/lib/ModuleWarning.js +9 -0
  79. package/lib/MultiWatching.js +4 -0
  80. package/lib/NodeStuffPlugin.js +65 -35
  81. package/lib/NormalModule.js +12 -2
  82. package/lib/NormalModuleFactory.js +56 -8
  83. package/lib/NormalModuleReplacementPlugin.js +5 -3
  84. package/lib/NullFactory.js +1 -1
  85. package/lib/PrefetchPlugin.js +4 -0
  86. package/lib/ProgressPlugin.js +71 -15
  87. package/lib/ProvidePlugin.js +30 -14
  88. package/lib/RawModule.js +13 -2
  89. package/lib/RecordIdsPlugin.js +4 -4
  90. package/lib/RequireJsStuffPlugin.js +22 -15
  91. package/lib/RuntimeGlobals.js +5 -0
  92. package/lib/RuntimeModule.js +12 -11
  93. package/lib/RuntimePlugin.js +10 -3
  94. package/lib/RuntimeTemplate.js +29 -11
  95. package/lib/SelfModuleFactory.js +12 -0
  96. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
  97. package/lib/SourceMapDevToolPlugin.js +47 -11
  98. package/lib/Template.js +5 -3
  99. package/lib/UseStrictPlugin.js +29 -11
  100. package/lib/WarnCaseSensitiveModulesPlugin.js +12 -0
  101. package/lib/WarnDeprecatedOptionPlugin.js +7 -0
  102. package/lib/WatchIgnorePlugin.js +4 -0
  103. package/lib/Watching.js +62 -25
  104. package/lib/WebpackError.js +14 -5
  105. package/lib/WebpackIsIncludedPlugin.js +22 -13
  106. package/lib/WebpackOptionsApply.js +41 -44
  107. package/lib/WebpackOptionsDefaulter.js +10 -3
  108. package/lib/asset/AssetGenerator.js +24 -9
  109. package/lib/asset/AssetModulesPlugin.js +28 -12
  110. package/lib/asset/AssetParser.js +15 -7
  111. package/lib/asset/AssetSourceParser.js +8 -3
  112. package/lib/asset/RawDataUrlModule.js +15 -4
  113. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
  114. package/lib/async-modules/InferAsyncModulesPlugin.js +1 -1
  115. package/lib/buildChunkGraph.js +37 -21
  116. package/lib/cache/IdleFileCachePlugin.js +2 -1
  117. package/lib/cache/MemoryWithGcCachePlugin.js +2 -0
  118. package/lib/cache/PackFileCacheStrategy.js +59 -22
  119. package/lib/cache/ResolverCachePlugin.js +3 -0
  120. package/lib/config/browserslistTargetHandler.js +10 -10
  121. package/lib/config/defaults.js +306 -105
  122. package/lib/config/normalization.js +110 -71
  123. package/lib/config/target.js +37 -10
  124. package/lib/container/ContainerEntryModule.js +11 -1
  125. package/lib/container/ContainerEntryModuleFactory.js +1 -1
  126. package/lib/container/ContainerExposedDependency.js +9 -0
  127. package/lib/container/ContainerPlugin.js +3 -1
  128. package/lib/container/FallbackDependency.js +13 -0
  129. package/lib/container/FallbackItemDependency.js +3 -0
  130. package/lib/container/FallbackModule.js +12 -2
  131. package/lib/container/FallbackModuleFactory.js +1 -1
  132. package/lib/container/RemoteModule.js +11 -1
  133. package/lib/container/RemoteRuntimeModule.js +3 -2
  134. package/lib/container/RemoteToExternalDependency.js +3 -0
  135. package/lib/css/CssExportsGenerator.js +9 -0
  136. package/lib/css/CssGenerator.js +5 -1
  137. package/lib/css/CssLoadingRuntimeModule.js +53 -22
  138. package/lib/css/CssModulesPlugin.js +253 -74
  139. package/lib/css/CssParser.js +697 -282
  140. package/lib/css/walkCssTokens.js +269 -138
  141. package/lib/debug/ProfilingPlugin.js +33 -12
  142. package/lib/dependencies/AMDDefineDependency.js +54 -10
  143. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +13 -2
  144. package/lib/dependencies/AMDPlugin.js +33 -20
  145. package/lib/dependencies/AMDRequireArrayDependency.js +13 -0
  146. package/lib/dependencies/AMDRequireContextDependency.js +15 -0
  147. package/lib/dependencies/AMDRequireDependenciesBlock.js +6 -0
  148. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +8 -2
  149. package/lib/dependencies/AMDRequireDependency.js +16 -1
  150. package/lib/dependencies/AMDRequireItemDependency.js +6 -0
  151. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  152. package/lib/dependencies/CachedConstDependency.js +14 -0
  153. package/lib/dependencies/CommonJsDependencyHelpers.js +9 -0
  154. package/lib/dependencies/CommonJsExportRequireDependency.js +19 -0
  155. package/lib/dependencies/CommonJsExportsDependency.js +16 -0
  156. package/lib/dependencies/CommonJsExportsParserPlugin.js +77 -5
  157. package/lib/dependencies/CommonJsFullRequireDependency.js +10 -1
  158. package/lib/dependencies/CommonJsImportsParserPlugin.js +174 -63
  159. package/lib/dependencies/CommonJsPlugin.js +51 -26
  160. package/lib/dependencies/CommonJsRequireContextDependency.js +17 -0
  161. package/lib/dependencies/CommonJsRequireDependency.js +7 -0
  162. package/lib/dependencies/CommonJsSelfReferenceDependency.js +16 -0
  163. package/lib/dependencies/ConstDependency.js +11 -2
  164. package/lib/dependencies/ContextDependency.js +15 -2
  165. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  166. package/lib/dependencies/ContextElementDependency.js +8 -0
  167. package/lib/dependencies/CreateScriptUrlDependency.js +10 -1
  168. package/lib/dependencies/CriticalDependencyWarning.js +3 -0
  169. package/lib/dependencies/CssExportDependency.js +8 -0
  170. package/lib/dependencies/CssImportDependency.js +55 -3
  171. package/lib/dependencies/CssLocalIdentifierDependency.js +18 -1
  172. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +10 -1
  173. package/lib/dependencies/CssUrlDependency.js +46 -16
  174. package/lib/dependencies/DelegatedSourceDependency.js +3 -0
  175. package/lib/dependencies/DllEntryDependency.js +14 -0
  176. package/lib/dependencies/DynamicExports.js +10 -6
  177. package/lib/dependencies/ExportsInfoDependency.js +25 -4
  178. package/lib/dependencies/HarmonyAcceptDependency.js +10 -1
  179. package/lib/dependencies/HarmonyAcceptImportDependency.js +3 -0
  180. package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
  181. package/lib/dependencies/HarmonyDetectionParserPlugin.js +22 -2
  182. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +32 -6
  183. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +5 -0
  184. package/lib/dependencies/HarmonyExportExpressionDependency.js +20 -3
  185. package/lib/dependencies/HarmonyExportHeaderDependency.js +13 -0
  186. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +22 -6
  187. package/lib/dependencies/HarmonyExportInitFragment.js +2 -1
  188. package/lib/dependencies/HarmonyExportSpecifierDependency.js +12 -0
  189. package/lib/dependencies/HarmonyExports.js +11 -5
  190. package/lib/dependencies/HarmonyImportDependency.js +10 -1
  191. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +53 -22
  192. package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -2
  193. package/lib/dependencies/HarmonyImportSpecifierDependency.js +139 -16
  194. package/lib/dependencies/HarmonyModulesPlugin.js +23 -5
  195. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
  196. package/lib/dependencies/ImportContextDependency.js +15 -0
  197. package/lib/dependencies/ImportDependency.js +15 -4
  198. package/lib/dependencies/ImportEagerDependency.js +7 -4
  199. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +51 -13
  200. package/lib/dependencies/ImportMetaContextPlugin.js +18 -5
  201. package/lib/dependencies/ImportMetaHotAcceptDependency.js +6 -0
  202. package/lib/dependencies/ImportMetaHotDeclineDependency.js +6 -0
  203. package/lib/dependencies/ImportMetaPlugin.js +103 -51
  204. package/lib/dependencies/ImportParserPlugin.js +83 -25
  205. package/lib/dependencies/ImportPlugin.js +21 -7
  206. package/lib/dependencies/ImportWeakDependency.js +7 -4
  207. package/lib/dependencies/JsonExportsDependency.js +9 -1
  208. package/lib/dependencies/LocalModule.js +16 -0
  209. package/lib/dependencies/LocalModuleDependency.js +15 -0
  210. package/lib/dependencies/LocalModulesHelpers.js +18 -0
  211. package/lib/dependencies/ModuleDecoratorDependency.js +8 -0
  212. package/lib/dependencies/ModuleDependency.js +9 -1
  213. package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
  214. package/lib/dependencies/ModuleHotAcceptDependency.js +6 -0
  215. package/lib/dependencies/ModuleHotDeclineDependency.js +6 -0
  216. package/lib/dependencies/PrefetchDependency.js +3 -0
  217. package/lib/dependencies/ProvidedDependency.js +14 -2
  218. package/lib/dependencies/PureExpressionDependency.js +10 -1
  219. package/lib/dependencies/RequireContextDependency.js +6 -0
  220. package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
  221. package/lib/dependencies/RequireContextPlugin.js +19 -6
  222. package/lib/dependencies/RequireEnsureDependenciesBlock.js +7 -0
  223. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
  224. package/lib/dependencies/RequireEnsureDependency.js +16 -2
  225. package/lib/dependencies/RequireEnsureItemDependency.js +3 -0
  226. package/lib/dependencies/RequireEnsurePlugin.js +27 -7
  227. package/lib/dependencies/RequireHeaderDependency.js +14 -1
  228. package/lib/dependencies/RequireIncludeDependency.js +5 -0
  229. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +29 -5
  230. package/lib/dependencies/RequireIncludePlugin.js +25 -5
  231. package/lib/dependencies/RequireResolveContextDependency.js +17 -0
  232. package/lib/dependencies/RequireResolveDependency.js +6 -0
  233. package/lib/dependencies/RequireResolveHeaderDependency.js +18 -0
  234. package/lib/dependencies/RuntimeRequirementsDependency.js +8 -0
  235. package/lib/dependencies/StaticExportsDependency.js +8 -0
  236. package/lib/dependencies/SystemPlugin.js +48 -21
  237. package/lib/dependencies/SystemRuntimeModule.js +1 -1
  238. package/lib/dependencies/URLDependency.js +13 -4
  239. package/lib/dependencies/URLPlugin.js +31 -18
  240. package/lib/dependencies/UnsupportedDependency.js +13 -0
  241. package/lib/dependencies/WebAssemblyExportImportedDependency.js +14 -0
  242. package/lib/dependencies/WebAssemblyImportDependency.js +9 -1
  243. package/lib/dependencies/WebpackIsIncludedDependency.js +5 -0
  244. package/lib/dependencies/WorkerDependency.js +47 -3
  245. package/lib/dependencies/WorkerPlugin.js +105 -32
  246. package/lib/dependencies/getFunctionExpression.js +7 -0
  247. package/lib/esm/ExportWebpackRequireRuntimeModule.js +3 -2
  248. package/lib/esm/ModuleChunkFormatPlugin.js +21 -8
  249. package/lib/esm/ModuleChunkLoadingPlugin.js +9 -0
  250. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +19 -12
  251. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
  252. package/lib/hmr/LazyCompilationPlugin.js +14 -5
  253. package/lib/ids/ChunkModuleIdRangePlugin.js +11 -0
  254. package/lib/ids/DeterministicChunkIdsPlugin.js +11 -2
  255. package/lib/ids/DeterministicModuleIdsPlugin.js +11 -7
  256. package/lib/ids/HashedModuleIdsPlugin.js +9 -2
  257. package/lib/ids/IdHelpers.js +6 -0
  258. package/lib/ids/NamedChunkIdsPlugin.js +13 -1
  259. package/lib/ids/NamedModuleIdsPlugin.js +14 -3
  260. package/lib/ids/OccurrenceChunkIdsPlugin.js +6 -2
  261. package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
  262. package/lib/ids/SyncModuleIdsPlugin.js +3 -2
  263. package/lib/index.js +8 -0
  264. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +3 -3
  265. package/lib/javascript/BasicEvaluatedExpression.js +137 -11
  266. package/lib/javascript/ChunkHelpers.js +2 -2
  267. package/lib/javascript/CommonJsChunkFormatPlugin.js +7 -3
  268. package/lib/javascript/EnableChunkLoadingPlugin.js +4 -0
  269. package/lib/javascript/JavascriptModulesPlugin.js +217 -198
  270. package/lib/javascript/JavascriptParser.js +941 -256
  271. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  272. package/lib/javascript/StartupHelpers.js +2 -2
  273. package/lib/json/JsonData.js +26 -1
  274. package/lib/json/JsonGenerator.js +21 -7
  275. package/lib/json/JsonModulesPlugin.js +14 -5
  276. package/lib/json/JsonParser.js +27 -13
  277. package/lib/library/AbstractLibraryPlugin.js +4 -0
  278. package/lib/library/AmdLibraryPlugin.js +22 -6
  279. package/lib/library/AssignLibraryPlugin.js +19 -5
  280. package/lib/library/EnableLibraryPlugin.js +4 -0
  281. package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
  282. package/lib/library/ModuleLibraryPlugin.js +8 -4
  283. package/lib/library/SystemLibraryPlugin.js +2 -1
  284. package/lib/library/UmdLibraryPlugin.js +24 -2
  285. package/lib/logging/runtime.js +1 -1
  286. package/lib/logging/truncateArgs.js +4 -0
  287. package/lib/node/CommonJsChunkLoadingPlugin.js +17 -2
  288. package/lib/node/NodeTargetPlugin.js +3 -0
  289. package/lib/node/NodeTemplatePlugin.js +10 -2
  290. package/lib/node/NodeWatchFileSystem.js +1 -1
  291. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +18 -9
  292. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +12 -2
  293. package/lib/node/ReadFileCompileWasmPlugin.js +21 -3
  294. package/lib/node/RequireChunkLoadingRuntimeModule.js +15 -8
  295. package/lib/node/nodeConsole.js +2 -4
  296. package/lib/optimize/AggressiveMergingPlugin.js +8 -0
  297. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  298. package/lib/optimize/ConcatenatedModule.js +8 -6
  299. package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
  300. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
  301. package/lib/optimize/InnerGraph.js +5 -5
  302. package/lib/optimize/InnerGraphPlugin.js +57 -48
  303. package/lib/optimize/LimitChunkCountPlugin.js +29 -4
  304. package/lib/optimize/MangleExportsPlugin.js +1 -1
  305. package/lib/optimize/MinMaxSizeWarning.js +5 -0
  306. package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
  307. package/lib/optimize/RealContentHashPlugin.js +86 -30
  308. package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
  309. package/lib/optimize/RuntimeChunkPlugin.js +9 -1
  310. package/lib/optimize/SideEffectsFlagPlugin.js +53 -44
  311. package/lib/optimize/SplitChunksPlugin.js +71 -31
  312. package/lib/performance/SizeLimitsPlugin.js +7 -4
  313. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
  314. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  315. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
  316. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
  317. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
  318. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  319. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  320. package/lib/rules/RuleSetCompiler.js +3 -3
  321. package/lib/rules/UseEffectRulePlugin.js +6 -4
  322. package/lib/runtime/AsyncModuleRuntimeModule.js +9 -6
  323. package/lib/runtime/AutoPublicPathRuntimeModule.js +16 -5
  324. package/lib/runtime/BaseUriRuntimeModule.js +8 -4
  325. package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
  326. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
  327. package/lib/runtime/CompatRuntimeModule.js +7 -2
  328. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
  329. package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
  330. package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
  331. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
  332. package/lib/runtime/EnsureChunkRuntimeModule.js +18 -4
  333. package/lib/runtime/GetChunkFilenameRuntimeModule.js +45 -26
  334. package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
  335. package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
  336. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +27 -6
  337. package/lib/runtime/GlobalRuntimeModule.js +1 -1
  338. package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
  339. package/lib/runtime/LoadScriptRuntimeModule.js +65 -50
  340. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
  341. package/lib/runtime/NonceRuntimeModule.js +1 -1
  342. package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
  343. package/lib/runtime/PublicPathRuntimeModule.js +9 -2
  344. package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
  345. package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
  346. package/lib/runtime/StartupChunkDependenciesPlugin.js +15 -0
  347. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +13 -4
  348. package/lib/runtime/StartupEntrypointRuntimeModule.js +11 -7
  349. package/lib/runtime/SystemContextRuntimeModule.js +1 -1
  350. package/lib/schemes/DataUriPlugin.js +16 -3
  351. package/lib/schemes/HttpUriPlugin.js +38 -0
  352. package/lib/serialization/ArraySerializer.js +22 -6
  353. package/lib/serialization/BinaryMiddleware.js +164 -1
  354. package/lib/serialization/DateObjectSerializer.js +15 -4
  355. package/lib/serialization/ErrorObjectSerializer.js +23 -8
  356. package/lib/serialization/FileMiddleware.js +17 -0
  357. package/lib/serialization/MapObjectSerializer.js +24 -8
  358. package/lib/serialization/NullPrototypeObjectSerializer.js +25 -8
  359. package/lib/serialization/ObjectMiddleware.js +33 -2
  360. package/lib/serialization/PlainObjectSerializer.js +23 -12
  361. package/lib/serialization/RegExpObjectSerializer.js +16 -5
  362. package/lib/serialization/SetObjectSerializer.js +21 -6
  363. package/lib/serialization/types.js +1 -1
  364. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  365. package/lib/sharing/ConsumeSharedModule.js +13 -2
  366. package/lib/sharing/ConsumeSharedPlugin.js +4 -0
  367. package/lib/sharing/ConsumeSharedRuntimeModule.js +22 -7
  368. package/lib/sharing/ProvideSharedDependency.js +17 -0
  369. package/lib/sharing/ProvideSharedModule.js +11 -1
  370. package/lib/sharing/ProvideSharedModuleFactory.js +1 -1
  371. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  372. package/lib/sharing/ShareRuntimeModule.js +19 -9
  373. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  374. package/lib/sharing/utils.js +320 -7
  375. package/lib/stats/DefaultStatsFactoryPlugin.js +105 -29
  376. package/lib/stats/DefaultStatsPresetPlugin.js +9 -0
  377. package/lib/stats/DefaultStatsPrinterPlugin.js +43 -0
  378. package/lib/util/AsyncQueue.js +4 -2
  379. package/lib/util/LazySet.js +10 -2
  380. package/lib/util/MapHelpers.js +19 -5
  381. package/lib/util/ParallelismFactorCalculator.js +10 -0
  382. package/lib/util/Semaphore.js +1 -1
  383. package/lib/util/StackedCacheMap.js +7 -1
  384. package/lib/util/StringXor.js +51 -0
  385. package/lib/util/URLAbsoluteSpecifier.js +1 -1
  386. package/lib/util/binarySearchBounds.js +49 -0
  387. package/lib/util/compileBooleanMatcher.js +31 -0
  388. package/lib/util/createHash.js +35 -13
  389. package/lib/util/deprecation.js +18 -3
  390. package/lib/util/deterministicGrouping.js +50 -11
  391. package/lib/util/findGraphRoots.js +4 -2
  392. package/lib/util/hash/md4.js +2 -2
  393. package/lib/util/hash/xxhash64.js +1 -1
  394. package/lib/util/identifier.js +4 -0
  395. package/lib/util/internalSerializables.js +1 -0
  396. package/lib/util/makeSerializable.js +7 -0
  397. package/lib/util/memoize.js +3 -3
  398. package/lib/util/numberHash.js +75 -21
  399. package/lib/util/processAsyncTree.js +7 -1
  400. package/lib/util/propertyAccess.js +9 -54
  401. package/lib/util/propertyName.js +79 -0
  402. package/lib/util/registerExternalSerializer.js +1 -1
  403. package/lib/util/runtime.js +84 -21
  404. package/lib/util/semver.js +2 -1
  405. package/lib/util/serialization.js +10 -0
  406. package/lib/util/smartGrouping.js +1 -1
  407. package/lib/validateSchema.js +6 -2
  408. package/lib/wasm/EnableWasmLoadingPlugin.js +4 -0
  409. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +15 -2
  410. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +9 -1
  411. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +14 -3
  412. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +28 -8
  413. package/lib/wasm-async/AsyncWebAssemblyParser.js +11 -4
  414. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +39 -8
  415. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +17 -6
  416. package/lib/wasm-sync/WebAssemblyGenerator.js +19 -5
  417. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
  418. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +53 -43
  419. package/lib/wasm-sync/WebAssemblyParser.js +15 -4
  420. package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
  421. package/lib/web/FetchCompileAsyncWasmPlugin.js +11 -1
  422. package/lib/web/FetchCompileWasmPlugin.js +59 -42
  423. package/lib/web/JsonpChunkLoadingPlugin.js +9 -0
  424. package/lib/web/JsonpChunkLoadingRuntimeModule.js +26 -9
  425. package/lib/webpack.js +12 -3
  426. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +9 -0
  427. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +20 -17
  428. package/module.d.ts +55 -37
  429. package/package.json +59 -56
  430. package/schemas/WebpackOptions.check.js +1 -1
  431. package/schemas/WebpackOptions.json +133 -6
  432. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  433. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  434. package/schemas/plugins/SourceMapDevToolPlugin.json +4 -0
  435. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  436. package/schemas/plugins/container/ContainerPlugin.json +8 -0
  437. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  438. package/schemas/plugins/container/ModuleFederationPlugin.json +8 -0
  439. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  440. package/schemas/plugins/css/CssParserOptions.json +1 -1
  441. package/schemas/plugins/sharing/SharePlugin.check.js +1 -1
  442. package/types.d.ts +1629 -683
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,47 +628,200 @@ 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 {
564
- map: any;
824
+ map: Record<string, Generator>;
565
825
  }
566
826
  declare const CIRCULAR_CONNECTION: unique symbol;
567
827
  declare class Cache {
@@ -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<[]>;
@@ -1951,7 +2233,7 @@ declare class Compiler {
1951
2233
  parentCompilation?: Compilation;
1952
2234
  root: Compiler;
1953
2235
  outputPath: string;
1954
- watching: Watching;
2236
+ watching?: Watching;
1955
2237
  outputFileSystem: OutputFileSystem;
1956
2238
  intermediateFileSystem: IntermediateFileSystem;
1957
2239
  inputFileSystem: InputFileSystem;
@@ -1961,11 +2243,14 @@ declare class Compiler {
1961
2243
  records: object;
1962
2244
  managedPaths: Set<string | RegExp>;
1963
2245
  immutablePaths: Set<string | RegExp>;
1964
- modifiedFiles: ReadonlySet<string>;
1965
- removedFiles: ReadonlySet<string>;
1966
- fileTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
1967
- contextTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
1968
- fsStartTime: number;
2246
+ modifiedFiles?: ReadonlySet<string>;
2247
+ removedFiles?: ReadonlySet<string>;
2248
+ fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
2249
+ contextTimestamps?: ReadonlyMap<
2250
+ string,
2251
+ null | FileSystemInfoEntry | "ignore"
2252
+ >;
2253
+ fsStartTime?: number;
1969
2254
  resolverFactory: ResolverFactory;
1970
2255
  infrastructureLogger: any;
1971
2256
  options: WebpackOptionsNormalized;
@@ -2066,7 +2351,7 @@ declare class ConcatenationScope {
2066
2351
  static isModuleReference(name: string): boolean;
2067
2352
  static matchModuleReference(
2068
2353
  name: string
2069
- ): ModuleReferenceOptions & { index: number };
2354
+ ): null | (ModuleReferenceOptions & { index: number });
2070
2355
  static DEFAULT_EXPORT: string;
2071
2356
  static NAMESPACE_OBJECT_EXPORT: string;
2072
2357
  }
@@ -2119,6 +2404,11 @@ declare interface Configuration {
2119
2404
  */
2120
2405
  experiments?: Experiments;
2121
2406
 
2407
+ /**
2408
+ * Extend configuration from another configuration (only works when using webpack-cli).
2409
+ */
2410
+ extends?: string | string[];
2411
+
2122
2412
  /**
2123
2413
  * 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
2414
  */
@@ -2130,7 +2420,7 @@ declare interface Configuration {
2130
2420
  | ((
2131
2421
  data: ExternalItemFunctionData,
2132
2422
  callback: (
2133
- err?: Error,
2423
+ err?: null | Error,
2134
2424
  result?: string | boolean | string[] | { [index: string]: any }
2135
2425
  ) => void
2136
2426
  ) => void)
@@ -2243,6 +2533,11 @@ declare interface Configuration {
2243
2533
  * Add additional plugins to the compiler.
2244
2534
  */
2245
2535
  plugins?: (
2536
+ | undefined
2537
+ | null
2538
+ | false
2539
+ | ""
2540
+ | 0
2246
2541
  | ((this: Compiler, compiler: Compiler) => void)
2247
2542
  | WebpackPluginInstance
2248
2543
  )[];
@@ -2280,7 +2575,7 @@ declare interface Configuration {
2280
2575
  /**
2281
2576
  * Options affecting how file system snapshots are created and validated.
2282
2577
  */
2283
- snapshot?: SnapshotOptions;
2578
+ snapshot?: SnapshotOptionsWebpackOptions;
2284
2579
 
2285
2580
  /**
2286
2581
  * Stats options object or preset name.
@@ -2320,7 +2615,7 @@ declare class ConstDependency extends NullDependency {
2320
2615
  constructor(
2321
2616
  expression: string,
2322
2617
  range: number | [number, number],
2323
- runtimeRequirements?: string[]
2618
+ runtimeRequirements?: null | string[]
2324
2619
  );
2325
2620
  expression: string;
2326
2621
  range: number | [number, number];
@@ -2550,7 +2845,8 @@ declare interface ContextModuleOptions {
2550
2845
  /**
2551
2846
  * exports referenced from modules (won't be mangled)
2552
2847
  */
2553
- referencedExports?: string[][];
2848
+ referencedExports?: null | string[][];
2849
+ layer?: string;
2554
2850
  resource: string | false | string[];
2555
2851
  resourceQuery?: string;
2556
2852
  resourceFragment?: string;
@@ -2558,18 +2854,22 @@ declare interface ContextModuleOptions {
2558
2854
  }
2559
2855
  declare class ContextReplacementPlugin {
2560
2856
  constructor(
2561
- resourceRegExp?: any,
2857
+ resourceRegExp: RegExp,
2562
2858
  newContentResource?: any,
2563
2859
  newContentRecursive?: any,
2564
2860
  newContentRegExp?: any
2565
2861
  );
2566
- resourceRegExp: any;
2862
+ resourceRegExp: RegExp;
2567
2863
  newContentCallback: any;
2568
2864
  newContentResource: any;
2569
2865
  newContentCreateContextMap: any;
2570
2866
  newContentRecursive: any;
2571
2867
  newContentRegExp: any;
2572
- apply(compiler?: any): void;
2868
+
2869
+ /**
2870
+ * Apply the plugin
2871
+ */
2872
+ apply(compiler: Compiler): void;
2573
2873
  }
2574
2874
  declare interface ContextTimestampAndHash {
2575
2875
  safeTime: number;
@@ -2626,7 +2926,7 @@ declare interface DepConstructor {
2626
2926
  declare abstract class DependenciesBlock {
2627
2927
  dependencies: Dependency[];
2628
2928
  blocks: AsyncDependenciesBlock[];
2629
- parent: DependenciesBlock;
2929
+ parent?: DependenciesBlock;
2630
2930
  getRootBlock(): DependenciesBlock;
2631
2931
 
2632
2932
  /**
@@ -2642,8 +2942,8 @@ declare abstract class DependenciesBlock {
2642
2942
  */
2643
2943
  clearDependenciesAndBlocks(): void;
2644
2944
  updateHash(hash: Hash, context: UpdateHashContextDependency): void;
2645
- serialize(__0: { write: any }): void;
2646
- deserialize(__0: { read: any }): void;
2945
+ serialize(__0: ObjectSerializerContext): void;
2946
+ deserialize(__0: ObjectDeserializerContext): void;
2647
2947
  }
2648
2948
  declare interface DependenciesBlockLike {
2649
2949
  dependencies: Dependency[];
@@ -2657,10 +2957,10 @@ declare class Dependency {
2657
2957
  get category(): string;
2658
2958
  loc: DependencyLocation;
2659
2959
  setLoc(
2660
- startLine?: any,
2661
- startColumn?: any,
2662
- endLine?: any,
2663
- endColumn?: any
2960
+ startLine: number,
2961
+ startColumn: number,
2962
+ endLine: number,
2963
+ endColumn: number
2664
2964
  ): void;
2665
2965
  getContext(): undefined | string;
2666
2966
  getResourceIdentifier(): null | string;
@@ -2693,12 +2993,12 @@ declare class Dependency {
2693
2993
  /**
2694
2994
  * Returns warnings
2695
2995
  */
2696
- getWarnings(moduleGraph: ModuleGraph): WebpackError[];
2996
+ getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2697
2997
 
2698
2998
  /**
2699
2999
  * Returns errors
2700
3000
  */
2701
- getErrors(moduleGraph: ModuleGraph): WebpackError[];
3001
+ getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2702
3002
 
2703
3003
  /**
2704
3004
  * Update the hash
@@ -2712,9 +3012,9 @@ declare class Dependency {
2712
3012
  getModuleEvaluationSideEffectsState(
2713
3013
  moduleGraph: ModuleGraph
2714
3014
  ): ConnectionState;
2715
- createIgnoredModule(context: string): Module;
2716
- serialize(__0: { write: any }): void;
2717
- deserialize(__0: { read: any }): void;
3015
+ createIgnoredModule(context: string): null | Module;
3016
+ serialize(__0: ObjectSerializerContext): void;
3017
+ deserialize(__0: ObjectDeserializerContext): void;
2718
3018
  module: any;
2719
3019
  get disconnect(): any;
2720
3020
  static NO_EXPORTS_REFERENCED: string[][];
@@ -2785,7 +3085,7 @@ declare interface DependencyTemplateContext {
2785
3085
  codeGenerationResults: CodeGenerationResults;
2786
3086
  }
2787
3087
  declare abstract class DependencyTemplates {
2788
- get(dependency: DependencyConstructor): DependencyTemplate;
3088
+ get(dependency: DependencyConstructor): undefined | DependencyTemplate;
2789
3089
  set(
2790
3090
  dependency: DependencyConstructor,
2791
3091
  dependencyTemplate: DependencyTemplate
@@ -2795,82 +3095,74 @@ declare abstract class DependencyTemplates {
2795
3095
  clone(): DependencyTemplates;
2796
3096
  }
2797
3097
  declare class DeterministicChunkIdsPlugin {
2798
- constructor(options?: any);
2799
- options: any;
3098
+ constructor(options?: DeterministicChunkIdsPluginOptions);
3099
+ options: DeterministicChunkIdsPluginOptions;
2800
3100
 
2801
3101
  /**
2802
3102
  * Apply the plugin
2803
3103
  */
2804
3104
  apply(compiler: Compiler): void;
2805
3105
  }
3106
+ declare interface DeterministicChunkIdsPluginOptions {
3107
+ /**
3108
+ * context for ids
3109
+ */
3110
+ context?: string;
3111
+
3112
+ /**
3113
+ * maximum length of ids
3114
+ */
3115
+ maxLength?: number;
3116
+ }
2806
3117
  declare class DeterministicModuleIdsPlugin {
2807
- constructor(options?: {
2808
- /**
2809
- * context relative to which module identifiers are computed
2810
- */
2811
- context?: string;
2812
- /**
2813
- * selector function for modules
2814
- */
2815
- test?: (arg0: Module) => boolean;
2816
- /**
2817
- * maximum id length in digits (used as starting point)
2818
- */
2819
- maxLength?: number;
2820
- /**
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
- };
3118
+ constructor(options?: DeterministicModuleIdsPluginOptions);
3119
+ options: DeterministicModuleIdsPluginOptions;
2859
3120
 
2860
3121
  /**
2861
3122
  * Apply the plugin
2862
3123
  */
2863
3124
  apply(compiler: Compiler): void;
2864
3125
  }
3126
+ declare interface DeterministicModuleIdsPluginOptions {
3127
+ /**
3128
+ * context relative to which module identifiers are computed
3129
+ */
3130
+ context?: string;
2865
3131
 
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);
3132
+ /**
3133
+ * selector function for modules
3134
+ */
3135
+ test?: (arg0: Module) => boolean;
3136
+
3137
+ /**
3138
+ * maximum id length in digits (used as starting point)
3139
+ */
3140
+ maxLength?: number;
3141
+
3142
+ /**
3143
+ * hash salt for ids
3144
+ */
3145
+ salt?: number;
3146
+
3147
+ /**
3148
+ * do not increase the maxLength to find an optimal id space size
3149
+ */
3150
+ fixedLength?: boolean;
3151
+
3152
+ /**
3153
+ * throw an error when id conflicts occur (instead of rehashing)
3154
+ */
3155
+ failOnConflict?: boolean;
3156
+ }
3157
+
3158
+ /**
3159
+ * Options for the webpack-dev-server.
3160
+ */
3161
+ declare interface DevServer {
3162
+ [index: string]: any;
3163
+ }
3164
+ declare class DllPlugin {
3165
+ constructor(options: DllPluginOptions);
2874
3166
  options: {
2875
3167
  entryOnly: boolean;
2876
3168
  /**
@@ -2934,7 +3226,11 @@ declare interface DllPluginOptions {
2934
3226
  declare class DllReferencePlugin {
2935
3227
  constructor(options: DllReferencePluginOptions);
2936
3228
  options: DllReferencePluginOptions;
2937
- apply(compiler?: any): void;
3229
+
3230
+ /**
3231
+ * Apply the plugin
3232
+ */
3233
+ apply(compiler: Compiler): void;
2938
3234
  }
2939
3235
  type DllReferencePluginOptions =
2940
3236
  | {
@@ -3394,11 +3690,21 @@ declare interface Environment {
3394
3690
  */
3395
3691
  dynamicImport?: boolean;
3396
3692
 
3693
+ /**
3694
+ * The environment supports an async import() is available when creating a worker.
3695
+ */
3696
+ dynamicImportInWorker?: boolean;
3697
+
3397
3698
  /**
3398
3699
  * The environment supports 'for of' iteration ('for (const x of array) { ... }').
3399
3700
  */
3400
3701
  forOf?: boolean;
3401
3702
 
3703
+ /**
3704
+ * The environment supports 'globalThis'.
3705
+ */
3706
+ globalThis?: boolean;
3707
+
3402
3708
  /**
3403
3709
  * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
3404
3710
  */
@@ -3424,6 +3730,7 @@ declare class EnvironmentPlugin {
3424
3730
  */
3425
3731
  apply(compiler: Compiler): void;
3426
3732
  }
3733
+ type ErrorWithDetail = Error & { details?: string };
3427
3734
  declare interface Etag {
3428
3735
  toString: () => string;
3429
3736
  }
@@ -3825,38 +4132,39 @@ declare interface ExposesObject {
3825
4132
  }
3826
4133
  type Expression =
3827
4134
  | UnaryExpression
3828
- | ThisExpression
3829
4135
  | ArrayExpression
3830
- | ObjectExpression
3831
- | FunctionExpression
3832
4136
  | ArrowFunctionExpression
3833
- | YieldExpression
4137
+ | AssignmentExpression
4138
+ | AwaitExpression
4139
+ | BinaryExpression
4140
+ | SimpleCallExpression
4141
+ | NewExpression
4142
+ | ChainExpression
4143
+ | ClassExpression
4144
+ | ConditionalExpression
4145
+ | FunctionExpression
4146
+ | Identifier
4147
+ | ImportExpression
3834
4148
  | SimpleLiteral
3835
4149
  | RegExpLiteral
3836
4150
  | BigIntLiteral
3837
- | UpdateExpression
3838
- | BinaryExpression
3839
- | AssignmentExpression
3840
4151
  | LogicalExpression
3841
4152
  | MemberExpression
3842
- | ConditionalExpression
3843
- | SimpleCallExpression
3844
- | NewExpression
4153
+ | MetaProperty
4154
+ | ObjectExpression
3845
4155
  | SequenceExpression
3846
- | TemplateLiteral
3847
4156
  | TaggedTemplateExpression
3848
- | ClassExpression
3849
- | MetaProperty
3850
- | Identifier
3851
- | AwaitExpression
3852
- | ImportExpression
3853
- | ChainExpression;
4157
+ | TemplateLiteral
4158
+ | ThisExpression
4159
+ | UpdateExpression
4160
+ | YieldExpression;
3854
4161
  declare interface ExpressionExpressionInfo {
3855
4162
  type: "expression";
3856
4163
  rootInfo: string | VariableInfo;
3857
4164
  name: string;
3858
4165
  getMembers: () => string[];
3859
4166
  getMembersOptionals: () => boolean[];
4167
+ getMemberRanges: () => [number, number][];
3860
4168
  }
3861
4169
  declare interface ExtensionAliasOption {
3862
4170
  alias: string | string[];
@@ -3872,7 +4180,7 @@ type ExternalItem =
3872
4180
  | ((
3873
4181
  data: ExternalItemFunctionData,
3874
4182
  callback: (
3875
- err?: Error,
4183
+ err?: null | Error,
3876
4184
  result?: string | boolean | string[] | { [index: string]: any }
3877
4185
  ) => void
3878
4186
  ) => void)
@@ -3936,7 +4244,11 @@ declare interface ExternalItemObjectUnknown {
3936
4244
  }
3937
4245
  type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
3938
4246
  declare class ExternalModule extends Module {
3939
- constructor(request?: any, type?: any, userRequest?: any);
4247
+ constructor(
4248
+ request: string | string[] | Record<string, string | string[]>,
4249
+ type: any,
4250
+ userRequest: string
4251
+ );
3940
4252
  request: string | string[] | Record<string, string | string[]>;
3941
4253
  externalType: string;
3942
4254
  userRequest: string;
@@ -3957,7 +4269,7 @@ type Externals =
3957
4269
  | ((
3958
4270
  data: ExternalItemFunctionData,
3959
4271
  callback: (
3960
- err?: Error,
4272
+ err?: null | Error,
3961
4273
  result?: string | boolean | string[] | { [index: string]: any }
3962
4274
  ) => void
3963
4275
  ) => void)
@@ -4052,10 +4364,13 @@ declare interface FactorizeModuleOptions {
4052
4364
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
4053
4365
  context?: string;
4054
4366
  }
4367
+ declare interface FactoryMeta {
4368
+ sideEffectFree?: boolean;
4369
+ }
4055
4370
  type FakeHook<T> = T & FakeHookMarker;
4056
4371
  declare interface FakeHookMarker {}
4057
4372
  declare interface FallbackCacheGroup {
4058
- chunksFilter: (chunk: Chunk) => boolean;
4373
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
4059
4374
  minSize: SplitChunksSizes;
4060
4375
  maxAsyncSize: SplitChunksSizes;
4061
4376
  maxInitialSize: SplitChunksSizes;
@@ -4070,14 +4385,20 @@ declare class FetchCompileAsyncWasmPlugin {
4070
4385
  apply(compiler: Compiler): void;
4071
4386
  }
4072
4387
  declare class FetchCompileWasmPlugin {
4073
- constructor(options?: any);
4074
- options: any;
4388
+ constructor(options?: FetchCompileWasmPluginOptions);
4389
+ options: FetchCompileWasmPluginOptions;
4075
4390
 
4076
4391
  /**
4077
4392
  * Apply the plugin
4078
4393
  */
4079
4394
  apply(compiler: Compiler): void;
4080
4395
  }
4396
+ declare interface FetchCompileWasmPluginOptions {
4397
+ /**
4398
+ * mangle imports
4399
+ */
4400
+ mangleImports?: boolean;
4401
+ }
4081
4402
 
4082
4403
  /**
4083
4404
  * Options object for persistent file-based caching.
@@ -4163,6 +4484,11 @@ declare interface FileCacheOptions {
4163
4484
  */
4164
4485
  profile?: boolean;
4165
4486
 
4487
+ /**
4488
+ * Enable/disable readonly mode.
4489
+ */
4490
+ readonly?: boolean;
4491
+
4166
4492
  /**
4167
4493
  * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
4168
4494
  */
@@ -4187,17 +4513,32 @@ declare interface FileSystem {
4187
4513
  arg2: FileSystemCallback<string | Buffer>
4188
4514
  ): void;
4189
4515
  };
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
- };
4516
+ readdir: (
4517
+ arg0: string,
4518
+ arg1?:
4519
+ | null
4520
+ | "ascii"
4521
+ | "utf8"
4522
+ | "utf16le"
4523
+ | "ucs2"
4524
+ | "latin1"
4525
+ | "binary"
4526
+ | ((
4527
+ arg0?: null | NodeJS.ErrnoException,
4528
+ arg1?: (string | Buffer)[] | (typeof Dirent)[]
4529
+ ) => void)
4530
+ | ReaddirOptions
4531
+ | "utf-8"
4532
+ | "ucs-2"
4533
+ | "base64"
4534
+ | "base64url"
4535
+ | "hex"
4536
+ | "buffer",
4537
+ arg2?: (
4538
+ arg0?: null | NodeJS.ErrnoException,
4539
+ arg1?: (string | Buffer)[] | (typeof Dirent)[]
4540
+ ) => void
4541
+ ) => void;
4201
4542
  readJson?: {
4202
4543
  (arg0: string, arg1: FileSystemCallback<object>): void;
4203
4544
  (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
@@ -4230,11 +4571,6 @@ declare interface FileSystem {
4230
4571
  declare interface FileSystemCallback<T> {
4231
4572
  (err?: null | (PossibleFileSystemError & Error), result?: T): any;
4232
4573
  }
4233
- declare interface FileSystemDirent {
4234
- name: string | Buffer;
4235
- isDirectory: () => boolean;
4236
- isFile: () => boolean;
4237
- }
4238
4574
  declare abstract class FileSystemInfo {
4239
4575
  fs: InputFileSystem;
4240
4576
  logger?: WebpackLogger;
@@ -4281,7 +4617,7 @@ declare abstract class FileSystemInfo {
4281
4617
  ): void;
4282
4618
  getFileHash(
4283
4619
  path: string,
4284
- callback: (arg0?: null | WebpackError, arg1?: string) => void
4620
+ callback: (arg0?: null | WebpackError, arg1?: null | string) => void
4285
4621
  ): void;
4286
4622
  getContextHash(
4287
4623
  path: string,
@@ -4307,20 +4643,11 @@ declare abstract class FileSystemInfo {
4307
4643
  callback: (arg0?: null | Error, arg1?: boolean) => void
4308
4644
  ): void;
4309
4645
  createSnapshot(
4310
- startTime: number,
4646
+ startTime: undefined | null | number,
4311
4647
  files: Iterable<string>,
4312
4648
  directories: Iterable<string>,
4313
4649
  missing: Iterable<string>,
4314
- options: {
4315
- /**
4316
- * Use hashes of the content of the files/directories to determine invalidation.
4317
- */
4318
- hash?: boolean;
4319
- /**
4320
- * Use timestamps of the files/directories to determine invalidation.
4321
- */
4322
- timestamp?: boolean;
4323
- },
4650
+ options: undefined | null | SnapshotOptionsFileSystemInfo,
4324
4651
  callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
4325
4652
  ): void;
4326
4653
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
@@ -4401,7 +4728,7 @@ declare class Generator {
4401
4728
  context: ConcatenationBailoutReasonContext
4402
4729
  ): undefined | string;
4403
4730
  updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
4404
- static byType(map?: any): ByTypeGenerator;
4731
+ static byType(map: Record<string, Generator>): ByTypeGenerator;
4405
4732
  }
4406
4733
  type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
4407
4734
  GeneratorOptionsByModuleTypeUnknown;
@@ -4521,11 +4848,7 @@ declare interface HandleModuleCreationOptions {
4521
4848
  connectOrigin?: boolean;
4522
4849
  }
4523
4850
  declare class HarmonyImportDependency extends ModuleDependency {
4524
- constructor(
4525
- request: string,
4526
- sourceOrder: number,
4527
- assertions?: Record<string, any>
4528
- );
4851
+ constructor(request: string, sourceOrder: number, assertions?: Assertions);
4529
4852
  sourceOrder: number;
4530
4853
  getImportVar(moduleGraph: ModuleGraph): string;
4531
4854
  getImportStatement(
@@ -4575,7 +4898,11 @@ declare interface HashableObject {
4575
4898
  declare class HashedModuleIdsPlugin {
4576
4899
  constructor(options?: HashedModuleIdsPluginOptions);
4577
4900
  options: HashedModuleIdsPluginOptions;
4578
- apply(compiler?: any): void;
4901
+
4902
+ /**
4903
+ * Apply the plugin
4904
+ */
4905
+ apply(compiler: Compiler): void;
4579
4906
  }
4580
4907
  declare interface HashedModuleIdsPluginOptions {
4581
4908
  /**
@@ -4586,7 +4913,7 @@ declare interface HashedModuleIdsPluginOptions {
4586
4913
  /**
4587
4914
  * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
4588
4915
  */
4589
- hashDigest?: "latin1" | "hex" | "base64";
4916
+ hashDigest?: "latin1" | "base64" | "hex";
4590
4917
 
4591
4918
  /**
4592
4919
  * The prefix length of the hash digest to use, defaults to 4.
@@ -4802,8 +5129,8 @@ declare abstract class InitFragment<Context> {
4802
5129
  endContent?: string | Source;
4803
5130
  getContent(context: Context): string | Source;
4804
5131
  getEndContent(context: Context): undefined | string | Source;
4805
- serialize(context?: any): void;
4806
- deserialize(context?: any): void;
5132
+ serialize(context: ObjectSerializerContext): void;
5133
+ deserialize(context: ObjectDeserializerContext): void;
4807
5134
  merge: any;
4808
5135
  }
4809
5136
  declare interface InputFileSystem {
@@ -4946,13 +5273,13 @@ declare class JavascriptParser extends Parser {
4946
5273
  >;
4947
5274
  evaluateIdentifier: HookMap<
4948
5275
  SyncBailHook<
4949
- [ThisExpression | MemberExpression | MetaProperty | Identifier],
5276
+ [Identifier | MemberExpression | MetaProperty | ThisExpression],
4950
5277
  undefined | null | BasicEvaluatedExpression
4951
5278
  >
4952
5279
  >;
4953
5280
  evaluateDefinedIdentifier: HookMap<
4954
5281
  SyncBailHook<
4955
- [ThisExpression | MemberExpression | Identifier],
5282
+ [Identifier | MemberExpression | ThisExpression],
4956
5283
  undefined | null | BasicEvaluatedExpression
4957
5284
  >
4958
5285
  >;
@@ -4976,32 +5303,32 @@ declare class JavascriptParser extends Parser {
4976
5303
  [
4977
5304
  (
4978
5305
  | UnaryExpression
4979
- | ThisExpression
4980
5306
  | ArrayExpression
4981
- | ObjectExpression
4982
- | FunctionExpression
4983
5307
  | ArrowFunctionExpression
4984
- | YieldExpression
5308
+ | AssignmentExpression
5309
+ | AwaitExpression
5310
+ | BinaryExpression
5311
+ | SimpleCallExpression
5312
+ | NewExpression
5313
+ | ChainExpression
5314
+ | ClassExpression
5315
+ | ConditionalExpression
5316
+ | FunctionExpression
5317
+ | Identifier
5318
+ | ImportExpression
4985
5319
  | SimpleLiteral
4986
5320
  | RegExpLiteral
4987
5321
  | BigIntLiteral
4988
- | UpdateExpression
4989
- | BinaryExpression
4990
- | AssignmentExpression
4991
5322
  | LogicalExpression
4992
5323
  | MemberExpression
4993
- | ConditionalExpression
4994
- | SimpleCallExpression
4995
- | NewExpression
5324
+ | MetaProperty
5325
+ | ObjectExpression
4996
5326
  | SequenceExpression
4997
- | TemplateLiteral
4998
5327
  | TaggedTemplateExpression
4999
- | ClassExpression
5000
- | MetaProperty
5001
- | Identifier
5002
- | AwaitExpression
5003
- | ImportExpression
5004
- | ChainExpression
5328
+ | TemplateLiteral
5329
+ | ThisExpression
5330
+ | UpdateExpression
5331
+ | YieldExpression
5005
5332
  | FunctionDeclaration
5006
5333
  | VariableDeclaration
5007
5334
  | ClassDeclaration
@@ -5112,7 +5439,7 @@ declare class JavascriptParser extends Parser {
5112
5439
  >;
5113
5440
  classBodyElement: SyncBailHook<
5114
5441
  [
5115
- MethodDefinition | PropertyDefinition,
5442
+ StaticBlock | MethodDefinition | PropertyDefinition,
5116
5443
  ClassExpression | ClassDeclaration
5117
5444
  ],
5118
5445
  boolean | void
@@ -5183,11 +5510,14 @@ declare class JavascriptParser extends Parser {
5183
5510
  SyncBailHook<[AssignmentExpression, string[]], boolean | void>
5184
5511
  >;
5185
5512
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
5186
- importCall: SyncBailHook<[Expression], boolean | void>;
5513
+ importCall: SyncBailHook<[ImportExpression], boolean | void>;
5187
5514
  topLevelAwait: SyncBailHook<[Expression], boolean | void>;
5188
- call: HookMap<SyncBailHook<[Expression], boolean | void>>;
5515
+ call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
5189
5516
  callMemberChain: HookMap<
5190
- SyncBailHook<[CallExpression, string[], boolean[]], boolean | void>
5517
+ SyncBailHook<
5518
+ [CallExpression, string[], boolean[], [number, number][]],
5519
+ boolean | void
5520
+ >
5191
5521
  >;
5192
5522
  memberChainOfCallMemberChain: HookMap<
5193
5523
  SyncBailHook<
@@ -5197,7 +5527,7 @@ declare class JavascriptParser extends Parser {
5197
5527
  >;
5198
5528
  callMemberChainOfCallMemberChain: HookMap<
5199
5529
  SyncBailHook<
5200
- [Expression, string[], CallExpression, string[]],
5530
+ [CallExpression, string[], CallExpression, string[]],
5201
5531
  boolean | void
5202
5532
  >
5203
5533
  >;
@@ -5206,13 +5536,22 @@ declare class JavascriptParser extends Parser {
5206
5536
  binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
5207
5537
  expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
5208
5538
  expressionMemberChain: HookMap<
5209
- SyncBailHook<[Expression, string[], boolean[]], boolean | void>
5539
+ SyncBailHook<
5540
+ [MemberExpression, string[], boolean[], [number, number][]],
5541
+ boolean | void
5542
+ >
5210
5543
  >;
5211
5544
  unhandledExpressionMemberChain: HookMap<
5212
- SyncBailHook<[Expression, string[]], boolean | void>
5545
+ SyncBailHook<[MemberExpression, string[]], boolean | void>
5546
+ >;
5547
+ expressionConditionalOperator: SyncBailHook<
5548
+ [ConditionalExpression],
5549
+ boolean | void
5550
+ >;
5551
+ expressionLogicalOperator: SyncBailHook<
5552
+ [LogicalExpression],
5553
+ boolean | void
5213
5554
  >;
5214
- expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
5215
- expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
5216
5555
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
5217
5556
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
5218
5557
  }>;
@@ -5223,32 +5562,87 @@ declare class JavascriptParser extends Parser {
5223
5562
  semicolons: any;
5224
5563
  statementPath: (
5225
5564
  | UnaryExpression
5226
- | ThisExpression
5227
5565
  | ArrayExpression
5228
- | ObjectExpression
5229
- | FunctionExpression
5230
5566
  | ArrowFunctionExpression
5231
- | YieldExpression
5567
+ | AssignmentExpression
5568
+ | AwaitExpression
5569
+ | BinaryExpression
5570
+ | SimpleCallExpression
5571
+ | NewExpression
5572
+ | ChainExpression
5573
+ | ClassExpression
5574
+ | ConditionalExpression
5575
+ | FunctionExpression
5576
+ | Identifier
5577
+ | ImportExpression
5232
5578
  | SimpleLiteral
5233
5579
  | RegExpLiteral
5234
5580
  | BigIntLiteral
5235
- | UpdateExpression
5236
- | BinaryExpression
5237
- | AssignmentExpression
5238
5581
  | LogicalExpression
5239
5582
  | MemberExpression
5240
- | ConditionalExpression
5241
- | SimpleCallExpression
5242
- | NewExpression
5583
+ | MetaProperty
5584
+ | ObjectExpression
5243
5585
  | SequenceExpression
5244
- | TemplateLiteral
5245
5586
  | TaggedTemplateExpression
5587
+ | TemplateLiteral
5588
+ | ThisExpression
5589
+ | UpdateExpression
5590
+ | YieldExpression
5591
+ | FunctionDeclaration
5592
+ | VariableDeclaration
5593
+ | ClassDeclaration
5594
+ | ExpressionStatement
5595
+ | BlockStatement
5596
+ | StaticBlock
5597
+ | EmptyStatement
5598
+ | DebuggerStatement
5599
+ | WithStatement
5600
+ | ReturnStatement
5601
+ | LabeledStatement
5602
+ | BreakStatement
5603
+ | ContinueStatement
5604
+ | IfStatement
5605
+ | SwitchStatement
5606
+ | ThrowStatement
5607
+ | TryStatement
5608
+ | WhileStatement
5609
+ | DoWhileStatement
5610
+ | ForStatement
5611
+ | ForInStatement
5612
+ | ForOfStatement
5613
+ | ImportDeclaration
5614
+ | ExportNamedDeclaration
5615
+ | ExportDefaultDeclaration
5616
+ | ExportAllDeclaration
5617
+ )[];
5618
+ prevStatement?:
5619
+ | UnaryExpression
5620
+ | ArrayExpression
5621
+ | ArrowFunctionExpression
5622
+ | AssignmentExpression
5623
+ | AwaitExpression
5624
+ | BinaryExpression
5625
+ | SimpleCallExpression
5626
+ | NewExpression
5627
+ | ChainExpression
5246
5628
  | ClassExpression
5247
- | MetaProperty
5629
+ | ConditionalExpression
5630
+ | FunctionExpression
5248
5631
  | Identifier
5249
- | AwaitExpression
5250
5632
  | ImportExpression
5251
- | ChainExpression
5633
+ | SimpleLiteral
5634
+ | RegExpLiteral
5635
+ | BigIntLiteral
5636
+ | LogicalExpression
5637
+ | MemberExpression
5638
+ | MetaProperty
5639
+ | ObjectExpression
5640
+ | SequenceExpression
5641
+ | TaggedTemplateExpression
5642
+ | TemplateLiteral
5643
+ | ThisExpression
5644
+ | UpdateExpression
5645
+ | YieldExpression
5252
5646
  | FunctionDeclaration
5253
5647
  | VariableDeclaration
5254
5648
  | ClassDeclaration
@@ -5271,17 +5665,212 @@ declare class JavascriptParser extends Parser {
5271
5665
  | ForStatement
5272
5666
  | ForInStatement
5273
5667
  | ForOfStatement
5274
- )[];
5275
- prevStatement: any;
5668
+ | ImportDeclaration
5669
+ | ExportNamedDeclaration
5670
+ | ExportDefaultDeclaration
5671
+ | ExportAllDeclaration;
5672
+ destructuringAssignmentProperties: WeakMap<Expression, Set<string>>;
5276
5673
  currentTagData: any;
5277
- getRenameIdentifier(expr?: any): undefined | string | VariableInfoInterface;
5674
+ destructuringAssignmentPropertiesFor(
5675
+ node: Expression
5676
+ ): undefined | Set<string>;
5677
+ getRenameIdentifier(
5678
+ expr: Expression
5679
+ ): undefined | string | VariableInfoInterface;
5278
5680
  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;
5681
+
5682
+ /**
5683
+ * Pre walking iterates the scope for variable declarations
5684
+ */
5685
+ preWalkStatements(
5686
+ statements: (
5687
+ | FunctionDeclaration
5688
+ | VariableDeclaration
5689
+ | ClassDeclaration
5690
+ | ExpressionStatement
5691
+ | BlockStatement
5692
+ | StaticBlock
5693
+ | EmptyStatement
5694
+ | DebuggerStatement
5695
+ | WithStatement
5696
+ | ReturnStatement
5697
+ | LabeledStatement
5698
+ | BreakStatement
5699
+ | ContinueStatement
5700
+ | IfStatement
5701
+ | SwitchStatement
5702
+ | ThrowStatement
5703
+ | TryStatement
5704
+ | WhileStatement
5705
+ | DoWhileStatement
5706
+ | ForStatement
5707
+ | ForInStatement
5708
+ | ForOfStatement
5709
+ | ImportDeclaration
5710
+ | ExportNamedDeclaration
5711
+ | ExportDefaultDeclaration
5712
+ | ExportAllDeclaration
5713
+ )[]
5714
+ ): void;
5715
+
5716
+ /**
5717
+ * Block pre walking iterates the scope for block variable declarations
5718
+ */
5719
+ blockPreWalkStatements(
5720
+ statements: (
5721
+ | FunctionDeclaration
5722
+ | VariableDeclaration
5723
+ | ClassDeclaration
5724
+ | ExpressionStatement
5725
+ | BlockStatement
5726
+ | StaticBlock
5727
+ | EmptyStatement
5728
+ | DebuggerStatement
5729
+ | WithStatement
5730
+ | ReturnStatement
5731
+ | LabeledStatement
5732
+ | BreakStatement
5733
+ | ContinueStatement
5734
+ | IfStatement
5735
+ | SwitchStatement
5736
+ | ThrowStatement
5737
+ | TryStatement
5738
+ | WhileStatement
5739
+ | DoWhileStatement
5740
+ | ForStatement
5741
+ | ForInStatement
5742
+ | ForOfStatement
5743
+ | ImportDeclaration
5744
+ | ExportNamedDeclaration
5745
+ | ExportDefaultDeclaration
5746
+ | ExportAllDeclaration
5747
+ )[]
5748
+ ): void;
5749
+
5750
+ /**
5751
+ * Walking iterates the statements and expressions and processes them
5752
+ */
5753
+ walkStatements(
5754
+ statements: (
5755
+ | FunctionDeclaration
5756
+ | VariableDeclaration
5757
+ | ClassDeclaration
5758
+ | ExpressionStatement
5759
+ | BlockStatement
5760
+ | StaticBlock
5761
+ | EmptyStatement
5762
+ | DebuggerStatement
5763
+ | WithStatement
5764
+ | ReturnStatement
5765
+ | LabeledStatement
5766
+ | BreakStatement
5767
+ | ContinueStatement
5768
+ | IfStatement
5769
+ | SwitchStatement
5770
+ | ThrowStatement
5771
+ | TryStatement
5772
+ | WhileStatement
5773
+ | DoWhileStatement
5774
+ | ForStatement
5775
+ | ForInStatement
5776
+ | ForOfStatement
5777
+ | ImportDeclaration
5778
+ | ExportNamedDeclaration
5779
+ | ExportDefaultDeclaration
5780
+ | ExportAllDeclaration
5781
+ )[]
5782
+ ): void;
5783
+
5784
+ /**
5785
+ * Walking iterates the statements and expressions and processes them
5786
+ */
5787
+ preWalkStatement(
5788
+ statement:
5789
+ | FunctionDeclaration
5790
+ | VariableDeclaration
5791
+ | ClassDeclaration
5792
+ | ExpressionStatement
5793
+ | BlockStatement
5794
+ | StaticBlock
5795
+ | EmptyStatement
5796
+ | DebuggerStatement
5797
+ | WithStatement
5798
+ | ReturnStatement
5799
+ | LabeledStatement
5800
+ | BreakStatement
5801
+ | ContinueStatement
5802
+ | IfStatement
5803
+ | SwitchStatement
5804
+ | ThrowStatement
5805
+ | TryStatement
5806
+ | WhileStatement
5807
+ | DoWhileStatement
5808
+ | ForStatement
5809
+ | ForInStatement
5810
+ | ForOfStatement
5811
+ | ImportDeclaration
5812
+ | ExportNamedDeclaration
5813
+ | ExportDefaultDeclaration
5814
+ | ExportAllDeclaration
5815
+ ): void;
5816
+ blockPreWalkStatement(
5817
+ statement:
5818
+ | FunctionDeclaration
5819
+ | VariableDeclaration
5820
+ | ClassDeclaration
5821
+ | ExpressionStatement
5822
+ | BlockStatement
5823
+ | StaticBlock
5824
+ | EmptyStatement
5825
+ | DebuggerStatement
5826
+ | WithStatement
5827
+ | ReturnStatement
5828
+ | LabeledStatement
5829
+ | BreakStatement
5830
+ | ContinueStatement
5831
+ | IfStatement
5832
+ | SwitchStatement
5833
+ | ThrowStatement
5834
+ | TryStatement
5835
+ | WhileStatement
5836
+ | DoWhileStatement
5837
+ | ForStatement
5838
+ | ForInStatement
5839
+ | ForOfStatement
5840
+ | ImportDeclaration
5841
+ | ExportNamedDeclaration
5842
+ | ExportDefaultDeclaration
5843
+ | ExportAllDeclaration
5844
+ ): void;
5845
+ walkStatement(
5846
+ statement:
5847
+ | FunctionDeclaration
5848
+ | VariableDeclaration
5849
+ | ClassDeclaration
5850
+ | ExpressionStatement
5851
+ | BlockStatement
5852
+ | StaticBlock
5853
+ | EmptyStatement
5854
+ | DebuggerStatement
5855
+ | WithStatement
5856
+ | ReturnStatement
5857
+ | LabeledStatement
5858
+ | BreakStatement
5859
+ | ContinueStatement
5860
+ | IfStatement
5861
+ | SwitchStatement
5862
+ | ThrowStatement
5863
+ | TryStatement
5864
+ | WhileStatement
5865
+ | DoWhileStatement
5866
+ | ForStatement
5867
+ | ForInStatement
5868
+ | ForOfStatement
5869
+ | ImportDeclaration
5870
+ | ExportNamedDeclaration
5871
+ | ExportDefaultDeclaration
5872
+ | ExportAllDeclaration
5873
+ ): void;
5285
5874
 
5286
5875
  /**
5287
5876
  * Walks a statements that is nested within a parent statement
@@ -5289,81 +5878,118 @@ declare class JavascriptParser extends Parser {
5289
5878
  * This enforces the nested statement to never be in ASI position.
5290
5879
  */
5291
5880
  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;
5881
+ preWalkBlockStatement(statement: BlockStatement): void;
5882
+ walkBlockStatement(statement: BlockStatement): void;
5883
+ walkExpressionStatement(statement: ExpressionStatement): void;
5884
+ preWalkIfStatement(statement: IfStatement): void;
5885
+ walkIfStatement(statement: IfStatement): void;
5886
+ preWalkLabeledStatement(statement: LabeledStatement): void;
5887
+ walkLabeledStatement(statement: LabeledStatement): void;
5888
+ preWalkWithStatement(statement: WithStatement): void;
5889
+ walkWithStatement(statement: WithStatement): void;
5890
+ preWalkSwitchStatement(statement: SwitchStatement): void;
5891
+ walkSwitchStatement(statement: SwitchStatement): void;
5892
+ walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
5893
+ walkReturnStatement(statement: ReturnStatement): void;
5894
+ walkThrowStatement(statement: ThrowStatement): void;
5895
+ preWalkTryStatement(statement: TryStatement): void;
5896
+ walkTryStatement(statement: TryStatement): void;
5897
+ preWalkWhileStatement(statement: WhileStatement): void;
5898
+ walkWhileStatement(statement: WhileStatement): void;
5899
+ preWalkDoWhileStatement(statement: DoWhileStatement): void;
5900
+ walkDoWhileStatement(statement: DoWhileStatement): void;
5901
+ preWalkForStatement(statement: ForStatement): void;
5902
+ walkForStatement(statement: ForStatement): void;
5903
+ preWalkForInStatement(statement: ForInStatement): void;
5904
+ walkForInStatement(statement: ForInStatement): void;
5316
5905
  preWalkForOfStatement(statement?: any): void;
5317
- walkForOfStatement(statement?: any): void;
5318
- preWalkFunctionDeclaration(statement?: any): void;
5319
- walkFunctionDeclaration(statement?: any): void;
5906
+ walkForOfStatement(statement: ForOfStatement): void;
5907
+ preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
5908
+ walkFunctionDeclaration(statement: FunctionDeclaration): void;
5909
+ blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
5910
+ preWalkAssignmentExpression(expression: AssignmentExpression): void;
5320
5911
  blockPreWalkImportDeclaration(statement?: any): void;
5321
5912
  enterDeclaration(declaration?: any, onIdent?: any): void;
5322
5913
  blockPreWalkExportNamedDeclaration(statement?: any): void;
5323
- walkExportNamedDeclaration(statement?: any): void;
5914
+ walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
5324
5915
  blockPreWalkExportDefaultDeclaration(statement?: any): void;
5325
5916
  walkExportDefaultDeclaration(statement?: any): void;
5326
5917
  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;
5918
+ preWalkVariableDeclaration(statement: VariableDeclaration): void;
5919
+ blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
5920
+ preWalkVariableDeclarator(declarator: VariableDeclarator): void;
5921
+ walkVariableDeclaration(statement: VariableDeclaration): void;
5922
+ blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
5923
+ walkClassDeclaration(statement: ClassDeclaration): void;
5924
+ preWalkSwitchCases(switchCases: SwitchCase[]): void;
5925
+ walkSwitchCases(switchCases: SwitchCase[]): void;
5926
+ preWalkCatchClause(catchClause: CatchClause): void;
5927
+ walkCatchClause(catchClause: CatchClause): void;
5928
+ walkPattern(pattern: Pattern): void;
5929
+ walkAssignmentPattern(pattern: AssignmentPattern): void;
5338
5930
  walkObjectPattern(pattern?: any): void;
5339
- walkArrayPattern(pattern?: any): void;
5340
- walkRestElement(pattern?: any): void;
5341
- walkExpressions(expressions?: any): void;
5931
+ walkArrayPattern(pattern: ArrayPattern): void;
5932
+ walkRestElement(pattern: RestElement): void;
5933
+ walkExpressions(
5934
+ expressions: (
5935
+ | null
5936
+ | UnaryExpression
5937
+ | ArrayExpression
5938
+ | ArrowFunctionExpression
5939
+ | AssignmentExpression
5940
+ | AwaitExpression
5941
+ | BinaryExpression
5942
+ | SimpleCallExpression
5943
+ | NewExpression
5944
+ | ChainExpression
5945
+ | ClassExpression
5946
+ | ConditionalExpression
5947
+ | FunctionExpression
5948
+ | Identifier
5949
+ | ImportExpression
5950
+ | SimpleLiteral
5951
+ | RegExpLiteral
5952
+ | BigIntLiteral
5953
+ | LogicalExpression
5954
+ | MemberExpression
5955
+ | MetaProperty
5956
+ | ObjectExpression
5957
+ | SequenceExpression
5958
+ | TaggedTemplateExpression
5959
+ | TemplateLiteral
5960
+ | ThisExpression
5961
+ | UpdateExpression
5962
+ | YieldExpression
5963
+ | SpreadElement
5964
+ )[]
5965
+ ): void;
5342
5966
  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;
5967
+ walkAwaitExpression(expression: AwaitExpression): void;
5968
+ walkArrayExpression(expression: ArrayExpression): void;
5969
+ walkSpreadElement(expression: SpreadElement): void;
5970
+ walkObjectExpression(expression: ObjectExpression): void;
5971
+ walkProperty(prop: SpreadElement | Property): void;
5972
+ walkFunctionExpression(expression: FunctionExpression): void;
5973
+ walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
5350
5974
  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;
5975
+ walkUpdateExpression(expression: UpdateExpression): void;
5976
+ walkUnaryExpression(expression: UnaryExpression): void;
5977
+ walkLeftRightExpression(
5978
+ expression: BinaryExpression | LogicalExpression
5979
+ ): void;
5980
+ walkBinaryExpression(expression: BinaryExpression): void;
5981
+ walkLogicalExpression(expression: LogicalExpression): void;
5982
+ walkAssignmentExpression(expression: AssignmentExpression): void;
5983
+ walkConditionalExpression(expression: ConditionalExpression): void;
5984
+ walkNewExpression(expression: NewExpression): void;
5985
+ walkYieldExpression(expression: YieldExpression): void;
5986
+ walkTemplateLiteral(expression: TemplateLiteral): void;
5987
+ walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
5988
+ walkClassExpression(expression: ClassExpression): void;
5363
5989
  walkChainExpression(expression: ChainExpression): void;
5364
- walkImportExpression(expression?: any): void;
5990
+ walkImportExpression(expression: ImportExpression): void;
5365
5991
  walkCallExpression(expression?: any): void;
5366
- walkMemberExpression(expression?: any): void;
5992
+ walkMemberExpression(expression: MemberExpression): void;
5367
5993
  walkMemberExpressionWithExpressionName(
5368
5994
  expression?: any,
5369
5995
  name?: any,
@@ -5371,58 +5997,91 @@ declare class JavascriptParser extends Parser {
5371
5997
  members?: any,
5372
5998
  onUnhandled?: any
5373
5999
  ): void;
5374
- walkThisExpression(expression?: any): void;
5375
- walkIdentifier(expression?: any): void;
6000
+ walkThisExpression(expression: ThisExpression): void;
6001
+ walkIdentifier(expression: Identifier): void;
5376
6002
  walkMetaProperty(metaProperty: MetaProperty): void;
5377
6003
  callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
5378
6004
  callHooksForExpressionWithFallback<T, R>(
5379
6005
  hookMap: HookMap<SyncBailHook<T, R>>,
5380
6006
  expr: MemberExpression,
5381
- fallback: (
5382
- arg0: string,
5383
- arg1: string | ScopeInfo | VariableInfo,
5384
- arg2: () => string[]
5385
- ) => any,
5386
- defined: (arg0: string) => any,
6007
+ fallback:
6008
+ | undefined
6009
+ | ((
6010
+ arg0: string,
6011
+ arg1: string | ScopeInfo | VariableInfo,
6012
+ arg2: () => string[]
6013
+ ) => any),
6014
+ defined: undefined | ((arg0: string) => any),
5387
6015
  ...args: AsArray<T>
5388
- ): R;
6016
+ ): undefined | R;
5389
6017
  callHooksForName<T, R>(
5390
6018
  hookMap: HookMap<SyncBailHook<T, R>>,
5391
6019
  name: string,
5392
6020
  ...args: AsArray<T>
5393
- ): R;
6021
+ ): undefined | R;
5394
6022
  callHooksForInfo<T, R>(
5395
6023
  hookMap: HookMap<SyncBailHook<T, R>>,
5396
6024
  info: ExportedVariableInfo,
5397
6025
  ...args: AsArray<T>
5398
- ): R;
6026
+ ): undefined | R;
5399
6027
  callHooksForInfoWithFallback<T, R>(
5400
6028
  hookMap: HookMap<SyncBailHook<T, R>>,
5401
6029
  info: ExportedVariableInfo,
5402
- fallback: (arg0: string) => any,
5403
- defined: () => any,
6030
+ fallback: undefined | ((arg0: string) => any),
6031
+ defined: undefined | (() => any),
5404
6032
  ...args: AsArray<T>
5405
- ): R;
6033
+ ): undefined | R;
5406
6034
  callHooksForNameWithFallback<T, R>(
5407
6035
  hookMap: HookMap<SyncBailHook<T, R>>,
5408
6036
  name: string,
5409
- fallback: (arg0: string) => any,
5410
- defined: () => any,
6037
+ fallback: undefined | ((arg0: string) => any),
6038
+ defined: undefined | (() => any),
5411
6039
  ...args: AsArray<T>
5412
- ): R;
6040
+ ): undefined | R;
5413
6041
  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;
6042
+ inClassScope(hasThis: boolean, params: any, fn: () => void): void;
6043
+ inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
6044
+ inBlockScope(fn: () => void): void;
6045
+ detectMode(
6046
+ statements: (
6047
+ | FunctionDeclaration
6048
+ | VariableDeclaration
6049
+ | ClassDeclaration
6050
+ | ExpressionStatement
6051
+ | BlockStatement
6052
+ | StaticBlock
6053
+ | EmptyStatement
6054
+ | DebuggerStatement
6055
+ | WithStatement
6056
+ | ReturnStatement
6057
+ | LabeledStatement
6058
+ | BreakStatement
6059
+ | ContinueStatement
6060
+ | IfStatement
6061
+ | SwitchStatement
6062
+ | ThrowStatement
6063
+ | TryStatement
6064
+ | WhileStatement
6065
+ | DoWhileStatement
6066
+ | ForStatement
6067
+ | ForInStatement
6068
+ | ForOfStatement
6069
+ | ImportDeclaration
6070
+ | ExportNamedDeclaration
6071
+ | ExportDefaultDeclaration
6072
+ | ExportAllDeclaration
6073
+ | Directive
6074
+ )[]
6075
+ ): void;
5417
6076
  enterPatterns(patterns?: any, onIdent?: any): void;
5418
6077
  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;
6078
+ enterIdentifier(pattern: Identifier, onIdent?: any): void;
6079
+ enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
6080
+ enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
6081
+ enterRestElement(pattern: RestElement, onIdent?: any): void;
6082
+ enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
6083
+ evaluateExpression(expression?: any): BasicEvaluatedExpression;
6084
+ parseString(expression: Expression): string;
5426
6085
  parseCalculatedString(expression?: any): any;
5427
6086
  evaluate(source: string): BasicEvaluatedExpression;
5428
6087
  isPure(
@@ -5430,99 +6089,101 @@ declare class JavascriptParser extends Parser {
5430
6089
  | undefined
5431
6090
  | null
5432
6091
  | UnaryExpression
5433
- | ThisExpression
5434
6092
  | ArrayExpression
5435
- | ObjectExpression
5436
- | FunctionExpression
5437
6093
  | ArrowFunctionExpression
5438
- | YieldExpression
6094
+ | AssignmentExpression
6095
+ | AwaitExpression
6096
+ | BinaryExpression
6097
+ | SimpleCallExpression
6098
+ | NewExpression
6099
+ | ChainExpression
6100
+ | ClassExpression
6101
+ | ConditionalExpression
6102
+ | FunctionExpression
6103
+ | Identifier
6104
+ | ImportExpression
5439
6105
  | SimpleLiteral
5440
6106
  | RegExpLiteral
5441
6107
  | BigIntLiteral
5442
- | UpdateExpression
5443
- | BinaryExpression
5444
- | AssignmentExpression
5445
6108
  | LogicalExpression
5446
6109
  | MemberExpression
5447
- | ConditionalExpression
5448
- | SimpleCallExpression
5449
- | NewExpression
6110
+ | MetaProperty
6111
+ | ObjectExpression
5450
6112
  | SequenceExpression
5451
- | TemplateLiteral
5452
6113
  | TaggedTemplateExpression
5453
- | ClassExpression
5454
- | MetaProperty
5455
- | Identifier
5456
- | AwaitExpression
5457
- | ImportExpression
5458
- | ChainExpression
6114
+ | TemplateLiteral
6115
+ | ThisExpression
6116
+ | UpdateExpression
6117
+ | YieldExpression
5459
6118
  | FunctionDeclaration
5460
6119
  | VariableDeclaration
5461
6120
  | ClassDeclaration
5462
6121
  | PrivateIdentifier,
5463
6122
  commentsStartPos: number
5464
6123
  ): boolean;
5465
- getComments(range?: any): any[];
6124
+ getComments(range: [number, number]): any[];
5466
6125
  isAsiPosition(pos: number): boolean;
5467
6126
  unsetAsiPosition(pos: number): void;
5468
- isStatementLevelExpression(expr?: any): boolean;
6127
+ isStatementLevelExpression(expr: Expression): boolean;
5469
6128
  getTagData(name?: any, tag?: any): any;
5470
6129
  tagVariable(name?: any, tag?: any, data?: any): void;
5471
- defineVariable(name?: any): void;
5472
- undefineVariable(name?: any): void;
5473
- isVariableDefined(name?: any): boolean;
6130
+ defineVariable(name: string): void;
6131
+ undefineVariable(name: string): void;
6132
+ isVariableDefined(name: string): boolean;
5474
6133
  getVariableInfo(name: string): ExportedVariableInfo;
5475
6134
  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[] };
6135
+ evaluatedVariable(tagInfo: TagInfo): VariableInfo;
6136
+ parseCommentOptions(range: [number, number]): any;
5480
6137
  extractMemberExpressionChain(expression: MemberExpression): {
5481
6138
  members: string[];
5482
6139
  object:
5483
6140
  | UnaryExpression
5484
- | ThisExpression
5485
6141
  | ArrayExpression
5486
- | ObjectExpression
5487
- | FunctionExpression
5488
6142
  | ArrowFunctionExpression
5489
- | YieldExpression
6143
+ | AssignmentExpression
6144
+ | AwaitExpression
6145
+ | BinaryExpression
6146
+ | SimpleCallExpression
6147
+ | NewExpression
6148
+ | ChainExpression
6149
+ | ClassExpression
6150
+ | ConditionalExpression
6151
+ | FunctionExpression
6152
+ | Identifier
6153
+ | ImportExpression
5490
6154
  | SimpleLiteral
5491
6155
  | RegExpLiteral
5492
6156
  | BigIntLiteral
5493
- | UpdateExpression
5494
- | BinaryExpression
5495
- | AssignmentExpression
5496
6157
  | LogicalExpression
5497
6158
  | MemberExpression
5498
- | ConditionalExpression
5499
- | SimpleCallExpression
5500
- | NewExpression
6159
+ | MetaProperty
6160
+ | ObjectExpression
5501
6161
  | SequenceExpression
5502
- | TemplateLiteral
5503
6162
  | TaggedTemplateExpression
5504
- | ClassExpression
5505
- | MetaProperty
5506
- | Identifier
5507
- | AwaitExpression
5508
- | ImportExpression
5509
- | ChainExpression
6163
+ | TemplateLiteral
6164
+ | ThisExpression
6165
+ | UpdateExpression
6166
+ | YieldExpression
5510
6167
  | Super;
5511
6168
  membersOptionals: boolean[];
6169
+ memberRanges: [number, number][];
5512
6170
  };
5513
- getFreeInfoFromVariable(varName: string): {
5514
- name: string;
5515
- info: string | VariableInfo;
5516
- };
6171
+ getFreeInfoFromVariable(
6172
+ varName: string
6173
+ ): undefined | { name: string; info: string | VariableInfo };
5517
6174
  getMemberExpressionInfo(
5518
6175
  expression: MemberExpression,
5519
6176
  allowedTypes: number
5520
6177
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5521
- getNameForExpression(expression: MemberExpression): {
5522
- name: string;
5523
- rootInfo: ExportedVariableInfo;
5524
- getMembers: () => string[];
5525
- };
6178
+ getNameForExpression(
6179
+ expression: MemberExpression
6180
+ ):
6181
+ | undefined
6182
+ | {
6183
+ name: string;
6184
+ rootInfo: ExportedVariableInfo;
6185
+ getMembers: () => string[];
6186
+ };
5526
6187
  static ALLOWED_MEMBER_TYPES_ALL: 3;
5527
6188
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
5528
6189
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
@@ -5559,6 +6220,11 @@ declare interface JavascriptParserOptions {
5559
6220
  */
5560
6221
  createRequire?: string | boolean;
5561
6222
 
6223
+ /**
6224
+ * Specifies global fetchPriority for dynamic import.
6225
+ */
6226
+ dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6227
+
5562
6228
  /**
5563
6229
  * Specifies global mode for dynamic import.
5564
6230
  */
@@ -5714,8 +6380,19 @@ declare interface JavascriptParserOptions {
5714
6380
  */
5715
6381
  wrappedContextRegExp?: RegExp;
5716
6382
  }
6383
+ type JsonObject = { [index: string]: JsonValue } & {
6384
+ [index: string]:
6385
+ | undefined
6386
+ | null
6387
+ | string
6388
+ | number
6389
+ | boolean
6390
+ | JsonObject
6391
+ | JsonValue[];
6392
+ };
6393
+ type JsonValue = null | string | number | boolean | JsonObject | JsonValue[];
5717
6394
  declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
5718
- constructor(runtimeRequirements?: any);
6395
+ constructor(runtimeRequirements: Set<string>);
5719
6396
  static getCompilationHooks(
5720
6397
  compilation: Compilation
5721
6398
  ): JsonpCompilationPluginHooks;
@@ -5830,6 +6507,23 @@ declare interface KnownBuildMeta {
5830
6507
  declare interface KnownCreateStatsOptionsContext {
5831
6508
  forToString?: boolean;
5832
6509
  }
6510
+ declare interface KnownHooks {
6511
+ resolveStep: SyncHook<
6512
+ [
6513
+ AsyncSeriesBailHook<
6514
+ [ResolveRequest, ResolveContext],
6515
+ null | ResolveRequest
6516
+ >,
6517
+ ResolveRequest
6518
+ ]
6519
+ >;
6520
+ noResolve: SyncHook<[ResolveRequest, Error]>;
6521
+ resolve: AsyncSeriesBailHook<
6522
+ [ResolveRequest, ResolveContext],
6523
+ null | ResolveRequest
6524
+ >;
6525
+ result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
6526
+ }
5833
6527
  declare interface KnownNormalizedStatsOptions {
5834
6528
  context: string;
5835
6529
  requestShortener: RequestShortener;
@@ -6133,7 +6827,10 @@ declare interface LazyCompilationDefaultBackendOptions {
6133
6827
  /**
6134
6828
  * Specifies how to create the server handling the EventSource requests.
6135
6829
  */
6136
- server?: ServerOptionsImport | ServerOptionsHttps | (() => typeof Server);
6830
+ server?:
6831
+ | ServerOptionsImport<typeof IncomingMessage>
6832
+ | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
6833
+ | (() => typeof Server);
6137
6834
  }
6138
6835
 
6139
6836
  /**
@@ -6181,9 +6878,9 @@ declare class LazySet<T> {
6181
6878
  has(item: T): boolean;
6182
6879
  keys(): IterableIterator<T>;
6183
6880
  values(): IterableIterator<T>;
6184
- serialize(__0: { write: any }): void;
6881
+ serialize(__0: ObjectSerializerContext): void;
6185
6882
  [Symbol.iterator](): IterableIterator<T>;
6186
- static deserialize(__0: { read: any }): LazySet<any>;
6883
+ static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
6187
6884
  }
6188
6885
  declare interface LibIdentOptions {
6189
6886
  /**
@@ -6197,14 +6894,45 @@ declare interface LibIdentOptions {
6197
6894
  associatedObjectForCache?: Object;
6198
6895
  }
6199
6896
  declare class LibManifestPlugin {
6200
- constructor(options?: any);
6201
- options: any;
6897
+ constructor(options: LibManifestPluginOptions);
6898
+ options: LibManifestPluginOptions;
6202
6899
 
6203
6900
  /**
6204
6901
  * Apply the plugin
6205
6902
  */
6206
6903
  apply(compiler: Compiler): void;
6207
6904
  }
6905
+ declare interface LibManifestPluginOptions {
6906
+ /**
6907
+ * Context of requests in the manifest file (defaults to the webpack context).
6908
+ */
6909
+ context?: string;
6910
+
6911
+ /**
6912
+ * If true, only entry points will be exposed (default: true).
6913
+ */
6914
+ entryOnly?: boolean;
6915
+
6916
+ /**
6917
+ * If true, manifest json file (output) will be formatted.
6918
+ */
6919
+ format?: boolean;
6920
+
6921
+ /**
6922
+ * Name of the exposed dll function (external name, use value of 'output.library').
6923
+ */
6924
+ name?: string;
6925
+
6926
+ /**
6927
+ * Absolute path to the manifest json file (output).
6928
+ */
6929
+ path: string;
6930
+
6931
+ /**
6932
+ * Type of the dll bundle (external type, use value of 'output.libraryTarget').
6933
+ */
6934
+ type?: string;
6935
+ }
6208
6936
  declare interface LibraryContext<T> {
6209
6937
  compilation: Compilation;
6210
6938
  chunkGraph: ChunkGraph;
@@ -6262,6 +6990,11 @@ type LibraryName = string | string[] | LibraryCustomUmdObject;
6262
6990
  * Options for library.
6263
6991
  */
6264
6992
  declare interface LibraryOptions {
6993
+ /**
6994
+ * Add a container for define/require functions in the AMD module.
6995
+ */
6996
+ amdContainer?: string;
6997
+
6265
6998
  /**
6266
6999
  * Add a comment in the UMD wrapper.
6267
7000
  */
@@ -6333,7 +7066,7 @@ declare interface LoadScriptCompilationHooks {
6333
7066
  createScript: SyncWaterfallHook<[string, Chunk]>;
6334
7067
  }
6335
7068
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
6336
- constructor(withCreateScriptUrl?: boolean);
7069
+ constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
6337
7070
  static getCompilationHooks(
6338
7071
  compilation: Compilation
6339
7072
  ): LoadScriptCompilationHooks;
@@ -6405,8 +7138,8 @@ declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
6405
7138
  pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
6406
7139
  }
6407
7140
  declare class LoaderOptionsPlugin {
6408
- constructor(options?: LoaderOptionsPluginOptions);
6409
- options: LoaderOptionsPluginOptions;
7141
+ constructor(options?: LoaderOptionsPluginOptions & MatchObject);
7142
+ options: LoaderOptionsPluginOptions & MatchObject;
6410
7143
 
6411
7144
  /**
6412
7145
  * Apply the plugin
@@ -6570,6 +7303,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
6570
7303
  data?: object;
6571
7304
  pitchExecuted: boolean;
6572
7305
  normalExecuted: boolean;
7306
+ type?: "module" | "commonjs";
6573
7307
  }[];
6574
7308
 
6575
7309
  /**
@@ -6600,7 +7334,13 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
6600
7334
  * Target of compilation.
6601
7335
  * Example: "web"
6602
7336
  */
6603
- target: string;
7337
+ target: string;
7338
+
7339
+ /**
7340
+ * Tell what kind of ES-features may be used in the generated runtime-code.
7341
+ * Example: { arrowFunction: true }
7342
+ */
7343
+ environment: Environment;
6604
7344
  }
6605
7345
  declare class LoaderTargetPlugin {
6606
7346
  constructor(target: string);
@@ -6704,6 +7444,12 @@ declare interface MapOptions {
6704
7444
  columns?: boolean;
6705
7445
  module?: boolean;
6706
7446
  }
7447
+ declare interface MatchObject {
7448
+ test?: string | RegExp | (string | RegExp)[];
7449
+ include?: string | RegExp | (string | RegExp)[];
7450
+ exclude?: string | RegExp | (string | RegExp)[];
7451
+ }
7452
+ type Matcher = string | RegExp | (string | RegExp)[];
6707
7453
 
6708
7454
  /**
6709
7455
  * Options object for in-memory caching.
@@ -6758,27 +7504,27 @@ declare interface MinChunkSizePluginOptions {
6758
7504
  minChunkSize: number;
6759
7505
  }
6760
7506
  declare class Module extends DependenciesBlock {
6761
- constructor(type: string, context?: string, layer?: string);
7507
+ constructor(type: string, context?: null | string, layer?: null | string);
6762
7508
  type: string;
6763
7509
  context: null | string;
6764
7510
  layer: null | string;
6765
7511
  needId: boolean;
6766
7512
  debugId: number;
6767
- resolveOptions: ResolveOptionsWebpackOptions;
6768
- factoryMeta?: object;
7513
+ resolveOptions?: ResolveOptionsWebpackOptions;
7514
+ factoryMeta?: FactoryMeta;
6769
7515
  useSourceMap: boolean;
6770
7516
  useSimpleSourceMap: boolean;
6771
- buildMeta: BuildMeta;
6772
- buildInfo: Record<string, any>;
7517
+ buildMeta?: BuildMeta;
7518
+ buildInfo?: BuildInfo;
6773
7519
  presentationalDependencies?: Dependency[];
6774
7520
  codeGenerationDependencies?: Dependency[];
6775
7521
  id: string | number;
6776
7522
  get hash(): string;
6777
7523
  get renderedHash(): string;
6778
7524
  profile: null | ModuleProfile;
6779
- index: number;
6780
- index2: number;
6781
- depth: number;
7525
+ index: null | number;
7526
+ index2: null | number;
7527
+ depth: null | number;
6782
7528
  issuer: null | Module;
6783
7529
  get usedExports(): null | boolean | SortableSet<string>;
6784
7530
  get optimizationBailout(): (
@@ -6786,9 +7532,9 @@ declare class Module extends DependenciesBlock {
6786
7532
  | ((requestShortener: RequestShortener) => string)
6787
7533
  )[];
6788
7534
  get optional(): boolean;
6789
- addChunk(chunk?: any): boolean;
6790
- removeChunk(chunk?: any): void;
6791
- isInChunk(chunk?: any): boolean;
7535
+ addChunk(chunk: Chunk): boolean;
7536
+ removeChunk(chunk: Chunk): void;
7537
+ isInChunk(chunk: Chunk): boolean;
6792
7538
  isEntryModule(): boolean;
6793
7539
  getChunks(): Chunk[];
6794
7540
  getNumberOfChunks(): number;
@@ -6798,7 +7544,7 @@ declare class Module extends DependenciesBlock {
6798
7544
  get moduleArgument(): string;
6799
7545
  getExportsType(
6800
7546
  moduleGraph: ModuleGraph,
6801
- strict: boolean
7547
+ strict?: boolean
6802
7548
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
6803
7549
  addPresentationalDependency(presentationalDependency: Dependency): void;
6804
7550
  addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
@@ -6918,7 +7664,7 @@ declare class ModuleDependency extends Dependency {
6918
7664
  declare abstract class ModuleFactory {
6919
7665
  create(
6920
7666
  data: ModuleFactoryCreateData,
6921
- callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
7667
+ callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
6922
7668
  ): void;
6923
7669
  }
6924
7670
  declare interface ModuleFactoryCreateData {
@@ -7062,11 +7808,11 @@ declare class ModuleGraph {
7062
7808
  filterConnection: (arg0: ModuleGraphConnection) => boolean
7063
7809
  ): void;
7064
7810
  addExtraReason(module: Module, explanation: string): void;
7065
- getResolvedModule(dependency: Dependency): Module;
7811
+ getResolvedModule(dependency: Dependency): null | Module;
7066
7812
  getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
7067
- getModule(dependency: Dependency): Module;
7068
- getOrigin(dependency: Dependency): Module;
7069
- getResolvedOrigin(dependency: Dependency): Module;
7813
+ getModule(dependency: Dependency): null | Module;
7814
+ getOrigin(dependency: Dependency): null | Module;
7815
+ getResolvedOrigin(dependency: Dependency): null | Module;
7070
7816
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
7071
7817
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
7072
7818
  getIncomingConnectionsByOriginModule(
@@ -7095,19 +7841,19 @@ declare class ModuleGraph {
7095
7841
  module: Module,
7096
7842
  runtime: RuntimeSpec
7097
7843
  ): null | boolean | SortableSet<string>;
7098
- getPreOrderIndex(module: Module): number;
7099
- getPostOrderIndex(module: Module): number;
7844
+ getPreOrderIndex(module: Module): null | number;
7845
+ getPostOrderIndex(module: Module): null | number;
7100
7846
  setPreOrderIndex(module: Module, index: number): void;
7101
7847
  setPreOrderIndexIfUnset(module: Module, index: number): boolean;
7102
7848
  setPostOrderIndex(module: Module, index: number): void;
7103
7849
  setPostOrderIndexIfUnset(module: Module, index: number): boolean;
7104
- getDepth(module: Module): number;
7850
+ getDepth(module: Module): null | number;
7105
7851
  setDepth(module: Module, depth: number): void;
7106
7852
  setDepthIfLower(module: Module, depth: number): boolean;
7107
7853
  isAsync(module: Module): boolean;
7108
7854
  setAsync(module: Module): void;
7109
7855
  getMeta(thing?: any): Object;
7110
- getMetaIfExisting(thing?: any): Object;
7856
+ getMetaIfExisting(thing?: any): undefined | Object;
7111
7857
  freeze(cacheStage?: string): void;
7112
7858
  unfreeze(): void;
7113
7859
  cached<T extends any[], V>(
@@ -7148,11 +7894,11 @@ declare class ModuleGraphConnection {
7148
7894
  module: Module;
7149
7895
  weak: boolean;
7150
7896
  conditional: boolean;
7151
- condition: (
7897
+ condition?: (
7152
7898
  arg0: ModuleGraphConnection,
7153
7899
  arg1: RuntimeSpec
7154
7900
  ) => ConnectionState;
7155
- explanations: Set<string>;
7901
+ explanations?: Set<string>;
7156
7902
  clone(): ModuleGraphConnection;
7157
7903
  addCondition(
7158
7904
  condition: (
@@ -7183,7 +7929,7 @@ declare interface ModuleOptions {
7183
7929
  /**
7184
7930
  * An array of rules applied by default for modules.
7185
7931
  */
7186
- defaultRules?: (RuleSetRule | "...")[];
7932
+ defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7187
7933
 
7188
7934
  /**
7189
7935
  * Enable warnings for full dynamic dependencies.
@@ -7223,7 +7969,7 @@ declare interface ModuleOptions {
7223
7969
  /**
7224
7970
  * An array of rules applied for modules.
7225
7971
  */
7226
- rules?: (RuleSetRule | "...")[];
7972
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7227
7973
 
7228
7974
  /**
7229
7975
  * 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 +8029,7 @@ declare interface ModuleOptionsNormalized {
7283
8029
  /**
7284
8030
  * An array of rules applied by default for modules.
7285
8031
  */
7286
- defaultRules: (RuleSetRule | "...")[];
8032
+ defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7287
8033
 
7288
8034
  /**
7289
8035
  * Specify options for each generator.
@@ -7303,7 +8049,7 @@ declare interface ModuleOptionsNormalized {
7303
8049
  /**
7304
8050
  * An array of rules applied for modules.
7305
8051
  */
7306
- rules: (RuleSetRule | "...")[];
8052
+ rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7307
8053
 
7308
8054
  /**
7309
8055
  * Cache the resolving of module requests.
@@ -7337,7 +8083,7 @@ declare abstract class ModuleProfile {
7337
8083
  storingEndTime: number;
7338
8084
  storing: number;
7339
8085
  storingParallelismFactor: number;
7340
- additionalFactoryTimes: any;
8086
+ additionalFactoryTimes?: { start: number; end: number }[];
7341
8087
  additionalFactories: number;
7342
8088
  additionalFactoriesParallelismFactor: number;
7343
8089
  additionalIntegration: number;
@@ -7475,30 +8221,47 @@ declare abstract class MultiStats {
7475
8221
  declare abstract class MultiWatching {
7476
8222
  watchings: Watching[];
7477
8223
  compiler: MultiCompiler;
7478
- invalidate(callback?: any): void;
8224
+ invalidate(callback?: CallbackFunction<void>): void;
7479
8225
  suspend(): void;
7480
8226
  resume(): void;
7481
8227
  close(callback: CallbackFunction<void>): void;
7482
8228
  }
7483
8229
  declare class NamedChunkIdsPlugin {
7484
- constructor(options?: any);
7485
- delimiter: any;
7486
- context: any;
8230
+ constructor(options?: NamedChunkIdsPluginOptions);
8231
+ delimiter: string;
8232
+ context?: string;
7487
8233
 
7488
8234
  /**
7489
8235
  * Apply the plugin
7490
8236
  */
7491
8237
  apply(compiler: Compiler): void;
7492
8238
  }
8239
+ declare interface NamedChunkIdsPluginOptions {
8240
+ /**
8241
+ * context
8242
+ */
8243
+ context?: string;
8244
+
8245
+ /**
8246
+ * delimiter
8247
+ */
8248
+ delimiter?: string;
8249
+ }
7493
8250
  declare class NamedModuleIdsPlugin {
7494
- constructor(options?: any);
7495
- options: any;
8251
+ constructor(options?: NamedModuleIdsPluginOptions);
8252
+ options: NamedModuleIdsPluginOptions;
7496
8253
 
7497
8254
  /**
7498
8255
  * Apply the plugin
7499
8256
  */
7500
8257
  apply(compiler: Compiler): void;
7501
8258
  }
8259
+ declare interface NamedModuleIdsPluginOptions {
8260
+ /**
8261
+ * context
8262
+ */
8263
+ context?: string;
8264
+ }
7502
8265
  declare class NaturalModuleIdsPlugin {
7503
8266
  constructor();
7504
8267
 
@@ -7520,6 +8283,7 @@ declare class NoEmitOnErrorsPlugin {
7520
8283
  */
7521
8284
  apply(compiler: Compiler): void;
7522
8285
  }
8286
+ type Node = false | NodeOptions;
7523
8287
  declare class NodeEnvironmentPlugin {
7524
8288
  constructor(options: {
7525
8289
  /**
@@ -7539,81 +8303,6 @@ declare class NodeEnvironmentPlugin {
7539
8303
  */
7540
8304
  apply(compiler: Compiler): void;
7541
8305
  }
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
8306
 
7618
8307
  /**
7619
8308
  * Options object for node compatibility features.
@@ -7651,14 +8340,19 @@ declare class NodeTargetPlugin {
7651
8340
  apply(compiler: Compiler): void;
7652
8341
  }
7653
8342
  declare class NodeTemplatePlugin {
7654
- constructor(options?: any);
8343
+ constructor(options?: NodeTemplatePluginOptions);
7655
8344
 
7656
8345
  /**
7657
8346
  * Apply the plugin
7658
8347
  */
7659
8348
  apply(compiler: Compiler): void;
7660
8349
  }
7661
- type NodeWebpackOptions = false | NodeOptions;
8350
+ declare interface NodeTemplatePluginOptions {
8351
+ /**
8352
+ * enable async chunk loading
8353
+ */
8354
+ asyncChunkLoading?: boolean;
8355
+ }
7662
8356
  declare class NormalModule extends Module {
7663
8357
  constructor(__0: NormalModuleCreateData);
7664
8358
  request: string;
@@ -7718,9 +8412,9 @@ declare interface NormalModuleCreateData {
7718
8412
  layer?: string;
7719
8413
 
7720
8414
  /**
7721
- * module type
8415
+ * module type. When deserializing, this is set to an empty string "".
7722
8416
  */
7723
- type: string;
8417
+ type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
7724
8418
 
7725
8419
  /**
7726
8420
  * request string
@@ -7818,6 +8512,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
7818
8512
  parser: HookMap<SyncHook<any>>;
7819
8513
  createGenerator: HookMap<SyncBailHook<any, any>>;
7820
8514
  generator: HookMap<SyncHook<any>>;
8515
+ createModuleClass: HookMap<SyncBailHook<any, any>>;
7821
8516
  }>;
7822
8517
  resolverFactory: ResolverFactory;
7823
8518
  ruleSet: RuleSet;
@@ -7863,9 +8558,9 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7863
8558
  context: string,
7864
8559
  request: string,
7865
8560
  callback: (
7866
- arg0: null | Error,
7867
- arg1?: string | false,
7868
- arg2?: ResolveRequest
8561
+ err: null | ErrorWithDetail,
8562
+ res?: string | false,
8563
+ req?: ResolveRequest
7869
8564
  ) => void
7870
8565
  ): any;
7871
8566
  getResolve(options?: ResolveOptionsWithDependencyType): {
@@ -7873,9 +8568,9 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7873
8568
  context: string,
7874
8569
  request: string,
7875
8570
  callback: (
7876
- arg0: null | Error,
7877
- arg1?: string | false,
7878
- arg2?: ResolveRequest
8571
+ err: null | ErrorWithDetail,
8572
+ res?: string | false,
8573
+ req?: ResolveRequest
7879
8574
  ) => void
7880
8575
  ): void;
7881
8576
  (context: string, request: string): Promise<string>;
@@ -7907,10 +8602,10 @@ declare class NormalModuleReplacementPlugin {
7907
8602
  */
7908
8603
  constructor(
7909
8604
  resourceRegExp: RegExp,
7910
- newResource: string | ((arg0?: any) => void)
8605
+ newResource: string | ((arg0: ResolveData) => void)
7911
8606
  );
7912
8607
  resourceRegExp: RegExp;
7913
- newResource: string | ((arg0?: any) => void);
8608
+ newResource: string | ((arg0: ResolveData) => void);
7914
8609
 
7915
8610
  /**
7916
8611
  * Apply the plugin
@@ -7972,6 +8667,7 @@ declare class NullDependencyTemplate extends DependencyTemplate {
7972
8667
  }
7973
8668
  declare interface ObjectDeserializerContext {
7974
8669
  read: () => any;
8670
+ setCircularReference: (arg0?: any) => void;
7975
8671
  }
7976
8672
  declare interface ObjectSerializer {
7977
8673
  serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
@@ -7979,6 +8675,7 @@ declare interface ObjectSerializer {
7979
8675
  }
7980
8676
  declare interface ObjectSerializerContext {
7981
8677
  write: (arg0?: any) => void;
8678
+ setCircularReference: (arg0?: any) => void;
7982
8679
  }
7983
8680
  declare class OccurrenceChunkIdsPlugin {
7984
8681
  constructor(options?: OccurrenceChunkIdsPluginOptions);
@@ -8075,6 +8772,11 @@ declare interface Optimization {
8075
8772
  * Minimizer(s) to use for minimizing the output.
8076
8773
  */
8077
8774
  minimizer?: (
8775
+ | undefined
8776
+ | null
8777
+ | false
8778
+ | ""
8779
+ | 0
8078
8780
  | ((this: Compiler, compiler: Compiler) => void)
8079
8781
  | WebpackPluginInstance
8080
8782
  | "..."
@@ -8162,7 +8864,7 @@ declare interface OptimizationSplitChunksCacheGroup {
8162
8864
  /**
8163
8865
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
8164
8866
  */
8165
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8867
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8166
8868
 
8167
8869
  /**
8168
8870
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -8289,7 +8991,7 @@ declare interface OptimizationSplitChunksOptions {
8289
8991
  /**
8290
8992
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8291
8993
  */
8292
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8994
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8293
8995
 
8294
8996
  /**
8295
8997
  * Sets the size types which are used when a number is used for sizes.
@@ -8312,7 +9014,7 @@ declare interface OptimizationSplitChunksOptions {
8312
9014
  /**
8313
9015
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8314
9016
  */
8315
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9017
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8316
9018
  /**
8317
9019
  * Maximal size hint for the on-demand chunks.
8318
9020
  */
@@ -8417,6 +9119,11 @@ declare class OriginalSource extends Source {
8417
9119
  * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
8418
9120
  */
8419
9121
  declare interface Output {
9122
+ /**
9123
+ * Add a container for define/require functions in the AMD module.
9124
+ */
9125
+ amdContainer?: string;
9126
+
8420
9127
  /**
8421
9128
  * The filename of asset modules as relative path inside the 'output.path' directory.
8422
9129
  */
@@ -8575,6 +9282,11 @@ declare interface Output {
8575
9282
  */
8576
9283
  hotUpdateMainFilename?: string;
8577
9284
 
9285
+ /**
9286
+ * Ignore warnings in the browser.
9287
+ */
9288
+ ignoreBrowserWarnings?: boolean;
9289
+
8578
9290
  /**
8579
9291
  * Wrap javascript code into IIFE's to avoid leaking into global scope.
8580
9292
  */
@@ -8680,6 +9392,11 @@ declare interface Output {
8680
9392
  */
8681
9393
  workerChunkLoading?: string | false;
8682
9394
 
9395
+ /**
9396
+ * 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.
9397
+ */
9398
+ workerPublicPath?: string;
9399
+
8683
9400
  /**
8684
9401
  * 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
9402
  */
@@ -8884,6 +9601,11 @@ declare interface OutputNormalized {
8884
9601
  */
8885
9602
  hotUpdateMainFilename?: string;
8886
9603
 
9604
+ /**
9605
+ * Ignore warnings in the browser.
9606
+ */
9607
+ ignoreBrowserWarnings?: boolean;
9608
+
8887
9609
  /**
8888
9610
  * Wrap javascript code into IIFE's to avoid leaking into global scope.
8889
9611
  */
@@ -8974,6 +9696,11 @@ declare interface OutputNormalized {
8974
9696
  */
8975
9697
  workerChunkLoading?: string | false;
8976
9698
 
9699
+ /**
9700
+ * 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.
9701
+ */
9702
+ workerPublicPath?: string;
9703
+
8977
9704
  /**
8978
9705
  * 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
9706
  */
@@ -9076,6 +9803,13 @@ declare interface PathData {
9076
9803
  noChunkHash?: boolean;
9077
9804
  url?: string;
9078
9805
  }
9806
+ type Pattern =
9807
+ | Identifier
9808
+ | MemberExpression
9809
+ | ObjectPattern
9810
+ | ArrayPattern
9811
+ | RestElement
9812
+ | AssignmentPattern;
9079
9813
 
9080
9814
  /**
9081
9815
  * Configuration object for web performance recommendations.
@@ -9117,6 +9851,11 @@ declare interface PitchLoaderDefinitionFunction<
9117
9851
  ): string | void | Buffer | Promise<string | Buffer>;
9118
9852
  }
9119
9853
  type Plugin =
9854
+ | undefined
9855
+ | null
9856
+ | false
9857
+ | ""
9858
+ | 0
9120
9859
  | { apply: (arg0: Resolver) => void }
9121
9860
  | ((this: Resolver, arg1: Resolver) => void);
9122
9861
  declare interface PnpApiImpl {
@@ -9129,9 +9868,9 @@ declare interface PossibleFileSystemError {
9129
9868
  syscall?: string;
9130
9869
  }
9131
9870
  declare class PrefetchPlugin {
9132
- constructor(context?: any, request?: any);
9133
- context: any;
9134
- request: any;
9871
+ constructor(context: string, request?: string);
9872
+ context: null | string;
9873
+ request: string;
9135
9874
 
9136
9875
  /**
9137
9876
  * Apply the plugin
@@ -9173,14 +9912,18 @@ declare class Profiler {
9173
9912
  inspector: any;
9174
9913
  hasSession(): boolean;
9175
9914
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
9176
- sendCommand(method?: any, params?: any): Promise<any>;
9915
+ sendCommand(method: string, params?: object): Promise<any>;
9177
9916
  destroy(): Promise<void>;
9178
9917
  stopProfiling(): Promise<{ profile: any }>;
9179
9918
  }
9180
9919
  declare class ProfilingPlugin {
9181
9920
  constructor(options?: ProfilingPluginOptions);
9182
9921
  outputPath: string;
9183
- apply(compiler?: any): void;
9922
+
9923
+ /**
9924
+ * Apply the plugin
9925
+ */
9926
+ apply(compiler: Compiler): void;
9184
9927
  static Profiler: typeof Profiler;
9185
9928
  }
9186
9929
  declare interface ProfilingPluginOptions {
@@ -9199,11 +9942,11 @@ declare class ProgressPlugin {
9199
9942
  showModules?: boolean;
9200
9943
  showDependencies?: boolean;
9201
9944
  showActiveModules?: boolean;
9202
- percentBy?: null | "modules" | "dependencies" | "entries";
9945
+ percentBy?: null | "entries" | "modules" | "dependencies";
9203
9946
  apply(compiler: Compiler | MultiCompiler): void;
9204
9947
  static getReporter(
9205
9948
  compiler: Compiler
9206
- ): (p: number, ...args: string[]) => void;
9949
+ ): undefined | ((p: number, ...args: string[]) => void);
9207
9950
  static defaultOptions: {
9208
9951
  profile: boolean;
9209
9952
  modulesCount: number;
@@ -9213,6 +9956,10 @@ declare class ProgressPlugin {
9213
9956
  activeModules: boolean;
9214
9957
  entries: boolean;
9215
9958
  };
9959
+ static createDefaultHandler: (
9960
+ profile: undefined | null | boolean,
9961
+ logger: WebpackLogger
9962
+ ) => (percentage: number, msg: string, ...args: string[]) => void;
9216
9963
  }
9217
9964
  type ProgressPluginArgument =
9218
9965
  | ProgressPluginOptions
@@ -9260,7 +10007,7 @@ declare interface ProgressPluginOptions {
9260
10007
  /**
9261
10008
  * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
9262
10009
  */
9263
- percentBy?: null | "modules" | "dependencies" | "entries";
10010
+ percentBy?: null | "entries" | "modules" | "dependencies";
9264
10011
 
9265
10012
  /**
9266
10013
  * Collect profile data for progress steps. Default: false.
@@ -9331,6 +10078,7 @@ declare interface ProvidesObject {
9331
10078
  declare interface RawChunkGroupOptions {
9332
10079
  preloadOrder?: number;
9333
10080
  prefetchOrder?: number;
10081
+ fetchPriority?: "auto" | "low" | "high";
9334
10082
  }
9335
10083
  type RawLoaderDefinition<
9336
10084
  OptionsType = {},
@@ -9358,17 +10106,58 @@ declare class RawSource extends Source {
9358
10106
  constructor(source: string | Buffer, convertToString?: boolean);
9359
10107
  isBuffer(): boolean;
9360
10108
  }
10109
+ declare interface RawSourceMap {
10110
+ version: number;
10111
+ sources: string[];
10112
+ names: string[];
10113
+ sourceRoot?: string;
10114
+ sourcesContent?: string[];
10115
+ mappings: string;
10116
+ file: string;
10117
+ }
9361
10118
  declare class ReadFileCompileWasmPlugin {
9362
- constructor(options?: any);
9363
- options: any;
10119
+ constructor(options?: ReadFileCompileWasmPluginOptions);
10120
+ options: ReadFileCompileWasmPluginOptions;
9364
10121
 
9365
10122
  /**
9366
10123
  * Apply the plugin
9367
10124
  */
9368
10125
  apply(compiler: Compiler): void;
9369
10126
  }
10127
+ declare interface ReadFileCompileWasmPluginOptions {
10128
+ /**
10129
+ * mangle imports
10130
+ */
10131
+ mangleImports?: boolean;
10132
+ }
10133
+ declare interface ReaddirOptions {
10134
+ encoding?:
10135
+ | null
10136
+ | "ascii"
10137
+ | "utf8"
10138
+ | "utf16le"
10139
+ | "ucs2"
10140
+ | "latin1"
10141
+ | "binary"
10142
+ | "utf-8"
10143
+ | "ucs-2"
10144
+ | "base64"
10145
+ | "base64url"
10146
+ | "hex"
10147
+ | "buffer";
10148
+ withFileTypes?: boolean;
10149
+ }
9370
10150
  declare class RealContentHashPlugin {
9371
- constructor(__0: { hashFunction: any; hashDigest: any });
10151
+ constructor(__0: {
10152
+ /**
10153
+ * the hash function to use
10154
+ */
10155
+ hashFunction: string | typeof Hash;
10156
+ /**
10157
+ * the hash digest to use
10158
+ */
10159
+ hashDigest: string;
10160
+ });
9372
10161
 
9373
10162
  /**
9374
10163
  * Apply the plugin
@@ -9796,7 +10585,15 @@ declare interface ResolveOptionsWebpackOptions {
9796
10585
  /**
9797
10586
  * Plugins for the resolver.
9798
10587
  */
9799
- plugins?: (ResolvePluginInstance | "...")[];
10588
+ plugins?: (
10589
+ | undefined
10590
+ | null
10591
+ | false
10592
+ | ""
10593
+ | 0
10594
+ | ResolvePluginInstance
10595
+ | "..."
10596
+ )[];
9800
10597
 
9801
10598
  /**
9802
10599
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -9867,23 +10664,7 @@ declare interface ResolvedContextTimestampAndHash {
9867
10664
  declare abstract class Resolver {
9868
10665
  fileSystem: FileSystem;
9869
10666
  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
- };
10667
+ hooks: KnownHooks;
9887
10668
  ensureHook(
9888
10669
  name:
9889
10670
  | string
@@ -9913,24 +10694,27 @@ declare abstract class Resolver {
9913
10694
  request: string,
9914
10695
  resolveContext: ResolveContext,
9915
10696
  callback: (
9916
- arg0: null | Error,
9917
- arg1?: string | false,
9918
- arg2?: ResolveRequest
10697
+ err: null | ErrorWithDetail,
10698
+ res?: string | false,
10699
+ req?: ResolveRequest
9919
10700
  ) => void
9920
10701
  ): void;
9921
10702
  doResolve(
9922
- hook?: any,
9923
- request?: any,
9924
- message?: any,
9925
- resolveContext?: any,
9926
- callback?: any
9927
- ): any;
10703
+ hook: AsyncSeriesBailHook<
10704
+ [ResolveRequest, ResolveContext],
10705
+ null | ResolveRequest
10706
+ >,
10707
+ request: ResolveRequest,
10708
+ message: null | string,
10709
+ resolveContext: ResolveContext,
10710
+ callback: (err?: null | Error, result?: ResolveRequest) => void
10711
+ ): void;
9928
10712
  parse(identifier: string): ParsedIdentifier;
9929
- isModule(path?: any): boolean;
9930
- isPrivate(path?: any): boolean;
10713
+ isModule(path: string): boolean;
10714
+ isPrivate(path: string): boolean;
9931
10715
  isDirectory(path: string): boolean;
9932
- join(path?: any, request?: any): string;
9933
- normalize(path?: any): string;
10716
+ join(path: string, request: string): string;
10717
+ normalize(path: string): string;
9934
10718
  }
9935
10719
  declare interface ResolverCache {
9936
10720
  direct: WeakMap<Object, ResolverWithOptions>;
@@ -10149,7 +10933,7 @@ declare interface RuleSetRule {
10149
10933
  /**
10150
10934
  * Only execute the first matching rule in this array.
10151
10935
  */
10152
- oneOf?: RuleSetRule[];
10936
+ oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10153
10937
 
10154
10938
  /**
10155
10939
  * Shortcut for use.options.
@@ -10209,7 +10993,7 @@ declare interface RuleSetRule {
10209
10993
  /**
10210
10994
  * Match and execute these rules when this rule is matched.
10211
10995
  */
10212
- rules?: RuleSetRule[];
10996
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10213
10997
 
10214
10998
  /**
10215
10999
  * Match module scheme.
@@ -10246,14 +11030,52 @@ declare interface RuleSetRule {
10246
11030
  */
10247
11031
  use?:
10248
11032
  | string
10249
- | RuleSetUseItem[]
11033
+ | (
11034
+ | undefined
11035
+ | null
11036
+ | string
11037
+ | false
11038
+ | 0
11039
+ | {
11040
+ /**
11041
+ * Unique loader options identifier.
11042
+ */
11043
+ ident?: string;
11044
+ /**
11045
+ * Loader name.
11046
+ */
11047
+ loader?: string;
11048
+ /**
11049
+ * Loader options.
11050
+ */
11051
+ options?: string | { [index: string]: any };
11052
+ }
11053
+ | ((data: object) =>
11054
+ | string
11055
+ | {
11056
+ /**
11057
+ * Unique loader options identifier.
11058
+ */
11059
+ ident?: string;
11060
+ /**
11061
+ * Loader name.
11062
+ */
11063
+ loader?: string;
11064
+ /**
11065
+ * Loader options.
11066
+ */
11067
+ options?: string | { [index: string]: any };
11068
+ }
11069
+ | __TypeWebpackOptions
11070
+ | __Type_2[])
11071
+ )[]
10250
11072
  | ((data: {
10251
11073
  resource: string;
10252
11074
  realResource: string;
10253
11075
  resourceQuery: string;
10254
11076
  issuer: string;
10255
11077
  compiler: string;
10256
- }) => RuleSetUseItem[])
11078
+ }) => __Type_2[])
10257
11079
  | {
10258
11080
  /**
10259
11081
  * Unique loader options identifier.
@@ -10268,35 +11090,56 @@ declare interface RuleSetRule {
10268
11090
  */
10269
11091
  options?: string | { [index: string]: any };
10270
11092
  }
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[]);
11093
+ | __TypeWebpackOptions;
10289
11094
  }
10290
11095
  type RuleSetUse =
10291
11096
  | string
10292
- | RuleSetUseItem[]
11097
+ | (
11098
+ | undefined
11099
+ | null
11100
+ | string
11101
+ | false
11102
+ | 0
11103
+ | {
11104
+ /**
11105
+ * Unique loader options identifier.
11106
+ */
11107
+ ident?: string;
11108
+ /**
11109
+ * Loader name.
11110
+ */
11111
+ loader?: string;
11112
+ /**
11113
+ * Loader options.
11114
+ */
11115
+ options?: string | { [index: string]: any };
11116
+ }
11117
+ | ((data: object) =>
11118
+ | string
11119
+ | {
11120
+ /**
11121
+ * Unique loader options identifier.
11122
+ */
11123
+ ident?: string;
11124
+ /**
11125
+ * Loader name.
11126
+ */
11127
+ loader?: string;
11128
+ /**
11129
+ * Loader options.
11130
+ */
11131
+ options?: string | { [index: string]: any };
11132
+ }
11133
+ | __TypeWebpackOptions
11134
+ | __Type_2[])
11135
+ )[]
10293
11136
  | ((data: {
10294
11137
  resource: string;
10295
11138
  realResource: string;
10296
11139
  resourceQuery: string;
10297
11140
  issuer: string;
10298
11141
  compiler: string;
10299
- }) => RuleSetUseItem[])
11142
+ }) => __Type_2[])
10300
11143
  | {
10301
11144
  /**
10302
11145
  * Unique loader options identifier.
@@ -10343,14 +11186,14 @@ declare class RuntimeModule extends Module {
10343
11186
  constructor(name: string, stage?: number);
10344
11187
  name: string;
10345
11188
  stage: number;
10346
- compilation: Compilation;
10347
- chunk: Chunk;
10348
- chunkGraph: ChunkGraph;
11189
+ compilation?: Compilation;
11190
+ chunk?: Chunk;
11191
+ chunkGraph?: ChunkGraph;
10349
11192
  fullHash: boolean;
10350
11193
  dependentHash: boolean;
10351
11194
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
10352
- generate(): string;
10353
- getGeneratedCode(): string;
11195
+ generate(): null | string;
11196
+ getGeneratedCode(): null | string;
10354
11197
  shouldIsolate(): boolean;
10355
11198
 
10356
11199
  /**
@@ -10387,20 +11230,20 @@ declare interface RuntimeRequirementsContext {
10387
11230
  type RuntimeSpec = undefined | string | SortableSet<string>;
10388
11231
  declare class RuntimeSpecMap<T> {
10389
11232
  constructor(clone?: RuntimeSpecMap<T>);
10390
- get(runtime: RuntimeSpec): T;
11233
+ get(runtime: RuntimeSpec): undefined | T;
10391
11234
  has(runtime: RuntimeSpec): boolean;
10392
- set(runtime?: any, value?: any): void;
10393
- provide(runtime?: any, computer?: any): any;
10394
- delete(runtime?: any): void;
10395
- update(runtime?: any, fn?: any): void;
11235
+ set(runtime: RuntimeSpec, value: T): void;
11236
+ provide(runtime: RuntimeSpec, computer: () => any): any;
11237
+ delete(runtime: RuntimeSpec): void;
11238
+ update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
10396
11239
  keys(): RuntimeSpec[];
10397
11240
  values(): IterableIterator<T>;
10398
11241
  get size(): number;
10399
11242
  }
10400
11243
  declare class RuntimeSpecSet {
10401
- constructor(iterable?: any);
10402
- add(runtime?: any): void;
10403
- has(runtime?: any): boolean;
11244
+ constructor(iterable?: Iterable<RuntimeSpec>);
11245
+ add(runtime: RuntimeSpec): void;
11246
+ has(runtime: RuntimeSpec): boolean;
10404
11247
  get size(): number;
10405
11248
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
10406
11249
  }
@@ -10530,7 +11373,7 @@ declare abstract class RuntimeTemplate {
10530
11373
  /**
10531
11374
  * the module
10532
11375
  */
10533
- module: Module;
11376
+ module: null | Module;
10534
11377
  /**
10535
11378
  * the chunk graph
10536
11379
  */
@@ -10552,7 +11395,7 @@ declare abstract class RuntimeTemplate {
10552
11395
  /**
10553
11396
  * the module
10554
11397
  */
10555
- module: Module;
11398
+ module: null | Module;
10556
11399
  /**
10557
11400
  * the chunk graph
10558
11401
  */
@@ -10714,7 +11557,7 @@ declare abstract class RuntimeTemplate {
10714
11557
  /**
10715
11558
  * when false, call context will not be preserved
10716
11559
  */
10717
- callContext: boolean;
11560
+ callContext: null | boolean;
10718
11561
  /**
10719
11562
  * when true and accessing the default exports, interop code will be generated
10720
11563
  */
@@ -10841,13 +11684,20 @@ declare interface RuntimeValueOptions {
10841
11684
  buildDependencies?: string[];
10842
11685
  version?: string | (() => string);
10843
11686
  }
11687
+
11688
+ /**
11689
+ * Helper function for joining two ranges into a single range. This is useful
11690
+ * when working with AST nodes, as it allows you to combine the ranges of child nodes
11691
+ * to create the range of the _parent node_.
11692
+ */
10844
11693
  declare interface ScopeInfo {
10845
11694
  definitions: StackedMap<string, ScopeInfo | VariableInfo>;
10846
11695
  topLevelScope: boolean | "arrow";
10847
- inShorthand: boolean;
11696
+ inShorthand: string | boolean;
11697
+ inTaggedTemplateTag: boolean;
11698
+ inTry: boolean;
10848
11699
  isStrict: boolean;
10849
11700
  isAsmJs: boolean;
10850
- inTry: boolean;
10851
11701
  }
10852
11702
  declare interface Selector<A, B> {
10853
11703
  (input: A): B;
@@ -10859,9 +11709,10 @@ declare abstract class Serializer {
10859
11709
  serialize(obj?: any, context?: any): any;
10860
11710
  deserialize(value?: any, context?: any): any;
10861
11711
  }
10862
- type ServerOptionsHttps = SecureContextOptions &
10863
- TlsOptions &
10864
- ServerOptionsImport;
11712
+ type ServerOptionsHttps<
11713
+ Request extends typeof IncomingMessage = typeof IncomingMessage,
11714
+ Response extends typeof ServerResponse = typeof ServerResponse
11715
+ > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
10865
11716
  declare class SharePlugin {
10866
11717
  constructor(options: SharePluginOptions);
10867
11718
 
@@ -10951,10 +11802,10 @@ declare class SideEffectsFlagPlugin {
10951
11802
  */
10952
11803
  apply(compiler: Compiler): void;
10953
11804
  static moduleHasSideEffects(
10954
- moduleName?: any,
10955
- flagValue?: any,
10956
- cache?: any
10957
- ): any;
11805
+ moduleName: string,
11806
+ flagValue: undefined | string | boolean | string[],
11807
+ cache: Map<string, RegExp>
11808
+ ): undefined | boolean;
10958
11809
  }
10959
11810
  declare class SizeOnlySource extends Source {
10960
11811
  constructor(size: number);
@@ -11001,17 +11852,28 @@ declare abstract class Snapshot {
11001
11852
  hasChildren(): boolean;
11002
11853
  setChildren(value?: any): void;
11003
11854
  addChild(child?: any): void;
11004
- serialize(__0: { write: any }): void;
11005
- deserialize(__0: { read: any }): void;
11855
+ serialize(__0: ObjectSerializerContext): void;
11856
+ deserialize(__0: ObjectDeserializerContext): void;
11006
11857
  getFileIterable(): Iterable<string>;
11007
11858
  getContextIterable(): Iterable<string>;
11008
11859
  getMissingIterable(): Iterable<string>;
11009
11860
  }
11861
+ declare interface SnapshotOptionsFileSystemInfo {
11862
+ /**
11863
+ * should use hash to snapshot
11864
+ */
11865
+ hash?: boolean;
11866
+
11867
+ /**
11868
+ * should use timestamp to snapshot
11869
+ */
11870
+ timestamp?: boolean;
11871
+ }
11010
11872
 
11011
11873
  /**
11012
11874
  * Options affecting how file system snapshots are created and validated.
11013
11875
  */
11014
- declare interface SnapshotOptions {
11876
+ declare interface SnapshotOptionsWebpackOptions {
11015
11877
  /**
11016
11878
  * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
11017
11879
  */
@@ -11104,7 +11966,7 @@ declare abstract class SortableSet<T> extends Set<T> {
11104
11966
  declare class Source {
11105
11967
  constructor();
11106
11968
  size(): number;
11107
- map(options?: MapOptions): Object;
11969
+ map(options?: MapOptions): null | RawSourceMap;
11108
11970
  sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
11109
11971
  updateHash(hash: Hash): void;
11110
11972
  source(): string | Buffer;
@@ -11125,7 +11987,10 @@ declare interface SourceMap {
11125
11987
  declare class SourceMapDevToolPlugin {
11126
11988
  constructor(options?: SourceMapDevToolPluginOptions);
11127
11989
  sourceMapFilename: string | false;
11128
- sourceMappingURLComment: string | false;
11990
+ sourceMappingURLComment:
11991
+ | string
11992
+ | false
11993
+ | ((arg0: PathData, arg1?: AssetInfo) => string);
11129
11994
  moduleFilenameTemplate: string | Function;
11130
11995
  fallbackModuleFilenameTemplate: string | Function;
11131
11996
  namespace: string;
@@ -11140,7 +12005,11 @@ declare interface SourceMapDevToolPluginOptions {
11140
12005
  /**
11141
12006
  * 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
12007
  */
11143
- append?: null | string | false;
12008
+ append?:
12009
+ | null
12010
+ | string
12011
+ | false
12012
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
11144
12013
 
11145
12014
  /**
11146
12015
  * Indicates whether column mappings should be used (defaults to true).
@@ -11230,7 +12099,7 @@ declare interface SourcePosition {
11230
12099
  column?: number;
11231
12100
  }
11232
12101
  declare interface SplitChunksOptions {
11233
- chunksFilter: (chunk: Chunk) => boolean;
12102
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
11234
12103
  defaultSizeTypes: string[];
11235
12104
  minSize: SplitChunksSizes;
11236
12105
  minSizeReduction: SplitChunksSizes;
@@ -11547,6 +12416,11 @@ declare interface StatsOptions {
11547
12416
  */
11548
12417
  errorsCount?: boolean;
11549
12418
 
12419
+ /**
12420
+ * Space to display errors (value is in number of lines).
12421
+ */
12422
+ errorsSpace?: number;
12423
+
11550
12424
  /**
11551
12425
  * Please use excludeModules instead.
11552
12426
  */
@@ -11807,6 +12681,11 @@ declare interface StatsOptions {
11807
12681
  | RegExp
11808
12682
  | WarningFilterItemTypes[]
11809
12683
  | ((warning: StatsError, value: string) => boolean);
12684
+
12685
+ /**
12686
+ * Space to display warnings (value is in number of lines).
12687
+ */
12688
+ warningsSpace?: number;
11810
12689
  }
11811
12690
  declare abstract class StatsPrinter {
11812
12691
  hooks: Readonly<{
@@ -11867,6 +12746,12 @@ declare interface SyntheticDependencyLocation {
11867
12746
  declare const TOMBSTONE: unique symbol;
11868
12747
  declare const TRANSITIVE: unique symbol;
11869
12748
  declare const TRANSITIVE_ONLY: unique symbol;
12749
+
12750
+ /**
12751
+ * Helper function for joining two ranges into a single range. This is useful
12752
+ * when working with AST nodes, as it allows you to combine the ranges of child nodes
12753
+ * to create the range of the _parent node_.
12754
+ */
11870
12755
  declare interface TagInfo {
11871
12756
  tag: any;
11872
12757
  data: any;
@@ -11890,7 +12775,7 @@ declare class Template {
11890
12775
  modules: Module[],
11891
12776
  renderModule: (arg0: Module) => Source,
11892
12777
  prefix?: string
11893
- ): Source;
12778
+ ): null | Source;
11894
12779
  static renderRuntimeModules(
11895
12780
  runtimeModules: RuntimeModule[],
11896
12781
  renderContext: RenderContext & {
@@ -11918,6 +12803,11 @@ declare class TopLevelSymbol {
11918
12803
  * Use a Trusted Types policy to create urls for chunks.
11919
12804
  */
11920
12805
  declare interface TrustedTypes {
12806
+ /**
12807
+ * 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'.
12808
+ */
12809
+ onPolicyCreationFailure?: "continue" | "stop";
12810
+
11921
12811
  /**
11922
12812
  * The name of the Trusted Types policy created by webpack to serve bundle chunks.
11923
12813
  */
@@ -12086,7 +12976,7 @@ declare interface UserResolveOptions {
12086
12976
  }
12087
12977
  declare abstract class VariableInfo {
12088
12978
  declaredScope: ScopeInfo;
12089
- freeName: string | true;
12979
+ freeName?: string | true;
12090
12980
  tagInfo?: TagInfo;
12091
12981
  }
12092
12982
  declare interface VariableInfoInterface {
@@ -12314,14 +13204,14 @@ declare class WebpackError extends Error {
12314
13204
  * Creates an instance of WebpackError.
12315
13205
  */
12316
13206
  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;
13207
+ details?: string;
13208
+ module?: null | Module;
13209
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
13210
+ hideStack?: boolean;
13211
+ chunk?: Chunk;
13212
+ file?: string;
13213
+ serialize(__0: ObjectSerializerContext): void;
13214
+ deserialize(__0: ObjectDeserializerContext): void;
12325
13215
 
12326
13216
  /**
12327
13217
  * Create .stack property on a target object
@@ -12367,7 +13257,7 @@ declare class WebpackOptionsApply extends OptionsApply {
12367
13257
  }
12368
13258
  declare class WebpackOptionsDefaulter {
12369
13259
  constructor();
12370
- process(options?: any): any;
13260
+ process(options: Configuration): WebpackOptionsNormalized;
12371
13261
  }
12372
13262
 
12373
13263
  /**
@@ -12491,7 +13381,7 @@ declare interface WebpackOptionsNormalized {
12491
13381
  /**
12492
13382
  * Include polyfills or mocks for various node stuff.
12493
13383
  */
12494
- node: NodeWebpackOptions;
13384
+ node: Node;
12495
13385
 
12496
13386
  /**
12497
13387
  * Enables/Disables integrated optimizations.
@@ -12517,6 +13407,11 @@ declare interface WebpackOptionsNormalized {
12517
13407
  * Add additional plugins to the compiler.
12518
13408
  */
12519
13409
  plugins: (
13410
+ | undefined
13411
+ | null
13412
+ | false
13413
+ | ""
13414
+ | 0
12520
13415
  | ((this: Compiler, compiler: Compiler) => void)
12521
13416
  | WebpackPluginInstance
12522
13417
  )[];
@@ -12549,7 +13444,7 @@ declare interface WebpackOptionsNormalized {
12549
13444
  /**
12550
13445
  * Options affecting how file system snapshots are created and validated.
12551
13446
  */
12552
- snapshot: SnapshotOptions;
13447
+ snapshot: SnapshotOptionsWebpackOptions;
12553
13448
 
12554
13449
  /**
12555
13450
  * Stats options object or preset name.
@@ -12595,7 +13490,7 @@ declare interface WithOptions {
12595
13490
  ) => ResolverWithOptions;
12596
13491
  }
12597
13492
  declare interface WriteOnlySet<T> {
12598
- add: (T?: any) => void;
13493
+ add: (item: T) => void;
12599
13494
  }
12600
13495
  type __TypeWebpackOptions = (data: object) =>
12601
13496
  | string
@@ -12614,7 +13509,45 @@ type __TypeWebpackOptions = (data: object) =>
12614
13509
  options?: string | { [index: string]: any };
12615
13510
  }
12616
13511
  | __TypeWebpackOptions
12617
- | RuleSetUseItem[];
13512
+ | __Type_2[];
13513
+ type __Type_2 =
13514
+ | undefined
13515
+ | null
13516
+ | string
13517
+ | false
13518
+ | 0
13519
+ | {
13520
+ /**
13521
+ * Unique loader options identifier.
13522
+ */
13523
+ ident?: string;
13524
+ /**
13525
+ * Loader name.
13526
+ */
13527
+ loader?: string;
13528
+ /**
13529
+ * Loader options.
13530
+ */
13531
+ options?: string | { [index: string]: any };
13532
+ }
13533
+ | ((data: object) =>
13534
+ | string
13535
+ | {
13536
+ /**
13537
+ * Unique loader options identifier.
13538
+ */
13539
+ ident?: string;
13540
+ /**
13541
+ * Loader name.
13542
+ */
13543
+ loader?: string;
13544
+ /**
13545
+ * Loader options.
13546
+ */
13547
+ options?: string | { [index: string]: any };
13548
+ }
13549
+ | __TypeWebpackOptions
13550
+ | __Type_2[]);
12618
13551
  declare function exports(
12619
13552
  options: Configuration,
12620
13553
  callback?: CallbackWebpack<Stats>
@@ -12694,13 +13627,17 @@ declare namespace exports {
12694
13627
  hashFunction: string | typeof Hash;
12695
13628
  }
12696
13629
  ) => 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;
13630
+ export let replaceDuplicates: <T>(
13631
+ array: T[],
13632
+ fn: (
13633
+ duplicateItem: T,
13634
+ duplicateItemIndex: number,
13635
+ numberOfTimesReplaced: number
13636
+ ) => T,
13637
+ comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
13638
+ ) => T[];
13639
+ export let matchPart: (str: string, test: Matcher) => boolean;
13640
+ export let matchObject: (obj: MatchObject, str: string) => boolean;
12704
13641
  }
12705
13642
  export namespace RuntimeGlobals {
12706
13643
  export let require: "__webpack_require__";
@@ -12738,6 +13675,7 @@ declare namespace exports {
12738
13675
  export let createScript: "__webpack_require__.ts";
12739
13676
  export let createScriptUrl: "__webpack_require__.tu";
12740
13677
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
13678
+ export let hasFetchPriority: "has fetch priority";
12741
13679
  export let chunkName: "__webpack_require__.cn";
12742
13680
  export let runtimeId: "__webpack_require__.j";
12743
13681
  export let getChunkScriptFilename: "__webpack_require__.u";
@@ -12841,7 +13779,7 @@ declare namespace exports {
12841
13779
  ) => void;
12842
13780
  export let setTopLevelSymbol: (
12843
13781
  state: ParserState,
12844
- symbol: TopLevelSymbol
13782
+ symbol?: TopLevelSymbol
12845
13783
  ) => void;
12846
13784
  export let getTopLevelSymbol: (
12847
13785
  state: ParserState
@@ -12849,7 +13787,7 @@ declare namespace exports {
12849
13787
  export let tagTopLevelSymbol: (
12850
13788
  parser: JavascriptParser,
12851
13789
  name: string
12852
- ) => TopLevelSymbol;
13790
+ ) => undefined | TopLevelSymbol;
12853
13791
  export let isDependencyUsedByExports: (
12854
13792
  dependency: Dependency,
12855
13793
  usedByExports: boolean | Set<string>,
@@ -12858,7 +13796,7 @@ declare namespace exports {
12858
13796
  ) => boolean;
12859
13797
  export let getDependencyUsedByExportsCondition: (
12860
13798
  dependency: Dependency,
12861
- usedByExports: boolean | Set<string>,
13799
+ usedByExports: undefined | boolean | Set<string>,
12862
13800
  moduleGraph: ModuleGraph
12863
13801
  ) =>
12864
13802
  | null
@@ -12935,7 +13873,7 @@ declare namespace exports {
12935
13873
  export { ProfilingPlugin };
12936
13874
  }
12937
13875
  export namespace util {
12938
- export const createHash: (algorithm: string | typeof Hash) => Hash;
13876
+ export const createHash: (algorithm?: string | typeof Hash) => Hash;
12939
13877
  export namespace comparators {
12940
13878
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
12941
13879
  export let compareModulesByIdentifier: (
@@ -12999,7 +13937,7 @@ declare namespace exports {
12999
13937
  ) => RuntimeSpec;
13000
13938
  export let forEachRuntime: (
13001
13939
  runtime: RuntimeSpec,
13002
- fn: (arg0: string) => void,
13940
+ fn: (arg0?: string) => void,
13003
13941
  deterministicOrder?: boolean
13004
13942
  ) => void;
13005
13943
  export let getRuntimeKey: (runtime: RuntimeSpec) => string;
@@ -13048,7 +13986,7 @@ declare namespace exports {
13048
13986
  export const register: (
13049
13987
  Constructor: Constructor,
13050
13988
  request: string,
13051
- name: string,
13989
+ name: null | string,
13052
13990
  serializer: ObjectSerializer
13053
13991
  ) => void;
13054
13992
  export const registerLoader: (
@@ -13059,8 +13997,8 @@ declare namespace exports {
13059
13997
  export const NOT_SERIALIZABLE: object;
13060
13998
  export const buffersSerializer: Serializer;
13061
13999
  export let createFileSerializer: (
13062
- fs?: any,
13063
- hashFunction?: any
14000
+ fs: IntermediateFileSystem,
14001
+ hashFunction: string | typeof Hash
13064
14002
  ) => Serializer;
13065
14003
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
13066
14004
  }
@@ -13153,8 +14091,14 @@ declare namespace exports {
13153
14091
  Entry,
13154
14092
  EntryNormalized,
13155
14093
  EntryObject,
14094
+ ExternalItemFunctionData,
14095
+ ExternalItemObjectKnown,
14096
+ ExternalItemObjectUnknown,
14097
+ ExternalItemValue,
14098
+ Externals,
13156
14099
  FileCacheOptions,
13157
14100
  LibraryOptions,
14101
+ MemoryCacheOptions,
13158
14102
  ModuleOptions,
13159
14103
  ResolveOptionsWebpackOptions as ResolveOptions,
13160
14104
  RuleSetCondition,
@@ -13166,12 +14110,14 @@ declare namespace exports {
13166
14110
  Configuration,
13167
14111
  WebpackOptionsNormalized,
13168
14112
  WebpackPluginInstance,
14113
+ ChunkGroup,
13169
14114
  Asset,
13170
14115
  AssetInfo,
13171
14116
  EntryOptions,
13172
14117
  PathData,
13173
14118
  AssetEmittedInfo,
13174
14119
  MultiStats,
14120
+ ResolveData,
13175
14121
  ParserState,
13176
14122
  ResolvePluginInstance,
13177
14123
  Resolver,