webpack 5.101.3 → 5.102.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/README.md +21 -26
  2. package/lib/APIPlugin.js +30 -36
  3. package/lib/AsyncDependenciesBlock.js +1 -4
  4. package/lib/BannerPlugin.js +0 -1
  5. package/lib/Cache.js +7 -6
  6. package/lib/CacheFacade.js +0 -1
  7. package/lib/Chunk.js +49 -31
  8. package/lib/ChunkGraph.js +37 -27
  9. package/lib/ChunkGroup.js +8 -10
  10. package/lib/ChunkTemplate.js +1 -1
  11. package/lib/CleanPlugin.js +3 -3
  12. package/lib/CodeGenerationResults.js +3 -2
  13. package/lib/CompatibilityPlugin.js +29 -12
  14. package/lib/Compilation.js +209 -196
  15. package/lib/Compiler.js +36 -35
  16. package/lib/ConcatenationScope.js +6 -1
  17. package/lib/ConditionalInitFragment.js +1 -1
  18. package/lib/ConstPlugin.js +6 -5
  19. package/lib/ContextExclusionPlugin.js +0 -1
  20. package/lib/ContextModule.js +25 -21
  21. package/lib/ContextModuleFactory.js +30 -11
  22. package/lib/ContextReplacementPlugin.js +38 -15
  23. package/lib/DefinePlugin.js +5 -9
  24. package/lib/DelegatedModule.js +7 -11
  25. package/lib/DependenciesBlock.js +0 -2
  26. package/lib/Dependency.js +9 -11
  27. package/lib/DependencyTemplates.js +2 -4
  28. package/lib/DllModule.js +1 -7
  29. package/lib/DllReferencePlugin.js +2 -4
  30. package/lib/DynamicEntryPlugin.js +0 -2
  31. package/lib/EntryOptionPlugin.js +0 -5
  32. package/lib/EnvironmentNotSupportAsyncWarning.js +0 -3
  33. package/lib/EvalDevToolModulePlugin.js +4 -3
  34. package/lib/EvalSourceMapDevToolPlugin.js +3 -4
  35. package/lib/ExportsInfo.js +50 -49
  36. package/lib/ExternalModule.js +84 -52
  37. package/lib/ExternalModuleFactoryPlugin.js +27 -7
  38. package/lib/ExternalsPlugin.js +24 -17
  39. package/lib/FileSystemInfo.js +105 -90
  40. package/lib/FlagDependencyUsagePlugin.js +3 -4
  41. package/lib/Generator.js +2 -13
  42. package/lib/GraphHelpers.js +0 -3
  43. package/lib/HookWebpackError.js +0 -2
  44. package/lib/HotModuleReplacementPlugin.js +22 -24
  45. package/lib/HotUpdateChunk.js +0 -3
  46. package/lib/IgnorePlugin.js +5 -2
  47. package/lib/InitFragment.js +41 -29
  48. package/lib/InvalidDependenciesModuleWarning.js +0 -1
  49. package/lib/LibManifestPlugin.js +4 -6
  50. package/lib/LoaderOptionsPlugin.js +1 -10
  51. package/lib/MainTemplate.js +8 -19
  52. package/lib/Module.js +32 -20
  53. package/lib/ModuleFactory.js +1 -1
  54. package/lib/ModuleFilenameHelpers.js +42 -25
  55. package/lib/ModuleGraph.js +30 -16
  56. package/lib/ModuleInfoHeaderPlugin.js +0 -1
  57. package/lib/ModuleTemplate.js +0 -2
  58. package/lib/ModuleTypeConstants.js +11 -1
  59. package/lib/MultiCompiler.js +23 -15
  60. package/lib/MultiWatching.js +6 -10
  61. package/lib/NodeStuffPlugin.js +2 -10
  62. package/lib/NormalModule.js +146 -89
  63. package/lib/NormalModuleFactory.js +132 -42
  64. package/lib/OptionsApply.js +1 -1
  65. package/lib/Parser.js +1 -1
  66. package/lib/ProgressPlugin.js +6 -10
  67. package/lib/ProvidePlugin.js +5 -7
  68. package/lib/RawModule.js +1 -6
  69. package/lib/RecordIdsPlugin.js +10 -6
  70. package/lib/ResolverFactory.js +0 -2
  71. package/lib/RuntimeGlobals.js +5 -0
  72. package/lib/RuntimeModule.js +1 -3
  73. package/lib/RuntimePlugin.js +26 -22
  74. package/lib/RuntimeTemplate.js +22 -12
  75. package/lib/SourceMapDevToolModuleOptionsPlugin.js +2 -2
  76. package/lib/SourceMapDevToolPlugin.js +11 -18
  77. package/lib/Stats.js +0 -1
  78. package/lib/Template.js +6 -11
  79. package/lib/TemplatedPathPlugin.js +2 -1
  80. package/lib/WatchIgnorePlugin.js +2 -3
  81. package/lib/Watching.js +15 -15
  82. package/lib/WebpackIsIncludedPlugin.js +0 -2
  83. package/lib/WebpackOptionsApply.js +74 -107
  84. package/lib/asset/AssetBytesGenerator.js +167 -0
  85. package/lib/asset/AssetBytesParser.js +37 -0
  86. package/lib/asset/AssetGenerator.js +22 -37
  87. package/lib/asset/AssetModulesPlugin.js +34 -16
  88. package/lib/asset/AssetParser.js +7 -3
  89. package/lib/asset/AssetSourceGenerator.js +1 -1
  90. package/lib/asset/RawDataUrlModule.js +3 -2
  91. package/lib/async-modules/AsyncModuleHelpers.js +6 -4
  92. package/lib/buildChunkGraph.js +0 -1
  93. package/lib/cache/MemoryCachePlugin.js +0 -2
  94. package/lib/cache/MemoryWithGcCachePlugin.js +0 -2
  95. package/lib/cache/PackFileCacheStrategy.js +14 -1
  96. package/lib/cache/ResolverCachePlugin.js +9 -15
  97. package/lib/cache/getLazyHashedEtag.js +1 -1
  98. package/lib/config/browserslistTargetHandler.js +77 -76
  99. package/lib/config/defaults.js +162 -23
  100. package/lib/config/normalization.js +18 -3
  101. package/lib/config/target.js +1 -1
  102. package/lib/container/ContainerEntryDependency.js +0 -1
  103. package/lib/container/ContainerEntryModule.js +3 -7
  104. package/lib/container/ContainerPlugin.js +1 -2
  105. package/lib/container/ContainerReferencePlugin.js +0 -1
  106. package/lib/container/FallbackDependency.js +2 -1
  107. package/lib/container/FallbackModule.js +6 -7
  108. package/lib/container/ModuleFederationPlugin.js +0 -1
  109. package/lib/container/RemoteModule.js +8 -8
  110. package/lib/container/RemoteRuntimeModule.js +2 -2
  111. package/lib/css/CssGenerator.js +3 -6
  112. package/lib/css/CssLoadingRuntimeModule.js +6 -9
  113. package/lib/css/CssModulesPlugin.js +13 -19
  114. package/lib/css/CssParser.js +3 -3
  115. package/lib/css/walkCssTokens.js +2 -2
  116. package/lib/debug/ProfilingPlugin.js +35 -8
  117. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +12 -17
  118. package/lib/dependencies/AMDPlugin.js +2 -2
  119. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -2
  120. package/lib/dependencies/CachedConstDependency.js +0 -4
  121. package/lib/dependencies/CommonJsExportRequireDependency.js +20 -14
  122. package/lib/dependencies/CommonJsExportsDependency.js +2 -1
  123. package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -5
  124. package/lib/dependencies/CommonJsFullRequireDependency.js +6 -4
  125. package/lib/dependencies/CommonJsImportsParserPlugin.js +16 -7
  126. package/lib/dependencies/CommonJsRequireContextDependency.js +1 -1
  127. package/lib/dependencies/CommonJsSelfReferenceDependency.js +4 -4
  128. package/lib/dependencies/ConstDependency.js +2 -2
  129. package/lib/dependencies/ContextDependency.js +9 -4
  130. package/lib/dependencies/ContextDependencyHelpers.js +2 -2
  131. package/lib/dependencies/ContextDependencyTemplateAsId.js +9 -9
  132. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +9 -9
  133. package/lib/dependencies/ContextElementDependency.js +22 -11
  134. package/lib/dependencies/CssIcssImportDependency.js +0 -2
  135. package/lib/dependencies/CssIcssSymbolDependency.js +2 -2
  136. package/lib/dependencies/CssImportDependency.js +0 -8
  137. package/lib/dependencies/CssLocalIdentifierDependency.js +4 -7
  138. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -2
  139. package/lib/dependencies/CssUrlDependency.js +0 -6
  140. package/lib/dependencies/ExportsInfoDependency.js +7 -9
  141. package/lib/dependencies/ExternalModuleDependency.js +0 -3
  142. package/lib/dependencies/ExternalModuleInitFragment.js +1 -1
  143. package/lib/dependencies/HarmonyAcceptDependency.js +1 -1
  144. package/lib/dependencies/HarmonyAcceptImportDependency.js +0 -4
  145. package/lib/dependencies/HarmonyCompatibilityDependency.js +0 -1
  146. package/lib/dependencies/HarmonyDetectionParserPlugin.js +0 -14
  147. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -3
  148. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -1
  149. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +29 -35
  150. package/lib/dependencies/HarmonyImportDependency.js +33 -14
  151. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +20 -23
  152. package/lib/dependencies/HarmonyImportSideEffectDependency.js +0 -4
  153. package/lib/dependencies/HarmonyImportSpecifierDependency.js +46 -31
  154. package/lib/dependencies/HarmonyModulesPlugin.js +3 -3
  155. package/lib/dependencies/ImportContextDependency.js +13 -0
  156. package/lib/dependencies/ImportDependency.js +18 -6
  157. package/lib/dependencies/ImportEagerDependency.js +2 -3
  158. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -5
  159. package/lib/dependencies/ImportMetaContextPlugin.js +0 -1
  160. package/lib/dependencies/ImportMetaPlugin.js +3 -2
  161. package/lib/dependencies/ImportParserPlugin.js +288 -45
  162. package/lib/dependencies/ImportWeakDependency.js +2 -3
  163. package/lib/dependencies/JsonExportsDependency.js +0 -1
  164. package/lib/dependencies/LoaderDependency.js +0 -3
  165. package/lib/dependencies/LoaderImportDependency.js +0 -3
  166. package/lib/dependencies/LoaderPlugin.js +11 -5
  167. package/lib/dependencies/ModuleDecoratorDependency.js +2 -4
  168. package/lib/dependencies/ModuleDependency.js +3 -9
  169. package/lib/dependencies/NullDependency.js +2 -0
  170. package/lib/dependencies/ProvidedDependency.js +6 -8
  171. package/lib/dependencies/PureExpressionDependency.js +0 -1
  172. package/lib/dependencies/RequireEnsureDependenciesBlock.js +0 -1
  173. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -2
  174. package/lib/dependencies/RequireIncludeDependency.js +2 -2
  175. package/lib/dependencies/RequireResolveDependency.js +2 -2
  176. package/lib/dependencies/RuntimeRequirementsDependency.js +2 -3
  177. package/lib/dependencies/StaticExportsDependency.js +3 -5
  178. package/lib/dependencies/URLDependency.js +2 -7
  179. package/lib/dependencies/URLPlugin.js +1 -2
  180. package/lib/dependencies/WebAssemblyExportImportedDependency.js +2 -2
  181. package/lib/dependencies/WebAssemblyImportDependency.js +2 -2
  182. package/lib/dependencies/WebpackIsIncludedDependency.js +2 -3
  183. package/lib/dependencies/WorkerDependency.js +2 -3
  184. package/lib/dependencies/WorkerPlugin.js +4 -12
  185. package/lib/dependencies/processExportInfo.js +2 -3
  186. package/lib/esm/ModuleChunkFormatPlugin.js +0 -3
  187. package/lib/esm/ModuleChunkLoadingPlugin.js +2 -1
  188. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -7
  189. package/lib/hmr/LazyCompilationPlugin.js +6 -4
  190. package/lib/hmr/lazyCompilationBackend.js +13 -10
  191. package/lib/ids/DeterministicChunkIdsPlugin.js +0 -1
  192. package/lib/ids/HashedModuleIdsPlugin.js +5 -7
  193. package/lib/ids/IdHelpers.js +1 -1
  194. package/lib/ids/NamedChunkIdsPlugin.js +1 -6
  195. package/lib/ids/NamedModuleIdsPlugin.js +1 -5
  196. package/lib/ids/NaturalChunkIdsPlugin.js +0 -1
  197. package/lib/ids/NaturalModuleIdsPlugin.js +0 -1
  198. package/lib/ids/OccurrenceChunkIdsPlugin.js +0 -1
  199. package/lib/ids/OccurrenceModuleIdsPlugin.js +0 -1
  200. package/lib/ids/SyncModuleIdsPlugin.js +4 -3
  201. package/lib/index.js +8 -7
  202. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -1
  203. package/lib/javascript/BasicEvaluatedExpression.js +13 -6
  204. package/lib/javascript/ChunkFormatHelpers.js +1 -1
  205. package/lib/javascript/CommonJsChunkFormatPlugin.js +0 -1
  206. package/lib/javascript/JavascriptGenerator.js +2 -3
  207. package/lib/javascript/JavascriptModulesPlugin.js +46 -24
  208. package/lib/javascript/JavascriptParser.js +120 -55
  209. package/lib/javascript/JavascriptParserHelpers.js +2 -2
  210. package/lib/javascript/StartupHelpers.js +2 -4
  211. package/lib/json/JsonData.js +1 -1
  212. package/lib/json/JsonGenerator.js +4 -5
  213. package/lib/json/JsonModulesPlugin.js +0 -3
  214. package/lib/json/JsonParser.js +4 -2
  215. package/lib/library/AbstractLibraryPlugin.js +2 -2
  216. package/lib/library/AmdLibraryPlugin.js +0 -1
  217. package/lib/library/AssignLibraryPlugin.js +23 -12
  218. package/lib/library/EnableLibraryPlugin.js +7 -11
  219. package/lib/library/ExportPropertyLibraryPlugin.js +8 -20
  220. package/lib/library/JsonpLibraryPlugin.js +5 -2
  221. package/lib/library/ModuleLibraryPlugin.js +88 -43
  222. package/lib/library/SystemLibraryPlugin.js +15 -6
  223. package/lib/library/UmdLibraryPlugin.js +12 -18
  224. package/lib/logging/Logger.js +12 -10
  225. package/lib/logging/createConsoleLogger.js +15 -14
  226. package/lib/logging/truncateArgs.js +1 -1
  227. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
  228. package/lib/node/NodeWatchFileSystem.js +4 -4
  229. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
  230. package/lib/node/RequireChunkLoadingRuntimeModule.js +5 -2
  231. package/lib/node/nodeConsole.js +2 -2
  232. package/lib/optimize/AggressiveSplittingPlugin.js +2 -0
  233. package/lib/optimize/ConcatenatedModule.js +142 -100
  234. package/lib/optimize/InnerGraph.js +17 -11
  235. package/lib/optimize/InnerGraphPlugin.js +0 -3
  236. package/lib/optimize/ModuleConcatenationPlugin.js +3 -4
  237. package/lib/optimize/RealContentHashPlugin.js +5 -3
  238. package/lib/optimize/RuntimeChunkPlugin.js +0 -1
  239. package/lib/optimize/SideEffectsFlagPlugin.js +3 -10
  240. package/lib/optimize/SplitChunksPlugin.js +46 -40
  241. package/lib/performance/SizeLimitsPlugin.js +2 -1
  242. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +5 -7
  243. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +0 -2
  244. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +0 -1
  245. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +2 -2
  246. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +2 -2
  247. package/lib/rules/BasicMatcherRulePlugin.js +0 -2
  248. package/lib/rules/ObjectMatcherRulePlugin.js +0 -1
  249. package/lib/rules/RuleSetCompiler.js +8 -6
  250. package/lib/runtime/BaseUriRuntimeModule.js +2 -2
  251. package/lib/runtime/CompatRuntimeModule.js +0 -1
  252. package/lib/runtime/GetChunkFilenameRuntimeModule.js +8 -9
  253. package/lib/runtime/LoadScriptRuntimeModule.js +0 -2
  254. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  255. package/lib/runtime/PublicPathRuntimeModule.js +2 -2
  256. package/lib/runtime/StartupEntrypointRuntimeModule.js +0 -1
  257. package/lib/runtime/SystemContextRuntimeModule.js +0 -2
  258. package/lib/runtime/ToBinaryRuntimeModule.js +64 -0
  259. package/lib/schemes/DataUriPlugin.js +2 -28
  260. package/lib/schemes/FileUriPlugin.js +5 -2
  261. package/lib/schemes/HttpUriPlugin.js +4 -2
  262. package/lib/schemes/VirtualUrlPlugin.js +11 -11
  263. package/lib/serialization/FileMiddleware.js +1 -1
  264. package/lib/serialization/NullPrototypeObjectSerializer.js +5 -3
  265. package/lib/serialization/ObjectMiddleware.js +31 -20
  266. package/lib/serialization/SerializerMiddleware.js +1 -3
  267. package/lib/serialization/types.js +1 -1
  268. package/lib/sharing/ConsumeSharedModule.js +3 -5
  269. package/lib/sharing/ConsumeSharedPlugin.js +2 -4
  270. package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -6
  271. package/lib/sharing/ProvideSharedModule.js +3 -7
  272. package/lib/sharing/SharePlugin.js +0 -2
  273. package/lib/sharing/ShareRuntimeModule.js +4 -1
  274. package/lib/sharing/resolveMatchedConfigs.js +14 -6
  275. package/lib/sharing/utils.js +0 -6
  276. package/lib/stats/DefaultStatsFactoryPlugin.js +179 -95
  277. package/lib/stats/DefaultStatsPresetPlugin.js +15 -9
  278. package/lib/stats/DefaultStatsPrinterPlugin.js +77 -113
  279. package/lib/stats/StatsFactory.js +14 -11
  280. package/lib/url/URLParserPlugin.js +2 -4
  281. package/lib/util/ArrayHelpers.js +4 -4
  282. package/lib/util/AsyncQueue.js +1 -0
  283. package/lib/util/Hash.js +35 -5
  284. package/lib/util/LazySet.js +2 -2
  285. package/lib/util/StackedCacheMap.js +0 -2
  286. package/lib/util/TupleSet.js +9 -4
  287. package/lib/util/URLAbsoluteSpecifier.js +0 -1
  288. package/lib/util/WeakTupleMap.js +1 -1
  289. package/lib/util/chainedImports.js +3 -1
  290. package/lib/util/cleverMerge.js +15 -18
  291. package/lib/util/comparators.js +2 -4
  292. package/lib/util/compileBooleanMatcher.js +11 -9
  293. package/lib/util/concatenate.js +1 -2
  294. package/lib/util/create-schema-validation.js +1 -2
  295. package/lib/util/createHash.js +85 -15
  296. package/lib/util/dataURL.js +39 -0
  297. package/lib/util/deprecation.js +29 -31
  298. package/lib/util/deterministicGrouping.js +34 -30
  299. package/lib/util/extractSourceMap.js +319 -0
  300. package/lib/util/findGraphRoots.js +15 -5
  301. package/lib/util/fs.js +29 -8
  302. package/lib/util/hash/BatchedHash.js +47 -8
  303. package/lib/util/hash/wasm-hash.js +53 -13
  304. package/lib/util/semver.js +9 -8
  305. package/lib/util/smartGrouping.js +41 -26
  306. package/lib/util/traverseDestructuringAssignmentProperties.js +45 -0
  307. package/lib/wasm/EnableWasmLoadingPlugin.js +3 -2
  308. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
  309. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +2 -13
  310. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -9
  311. package/lib/wasm-async/AsyncWebAssemblyParser.js +2 -10
  312. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +6 -4
  313. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -3
  314. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -4
  315. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -7
  316. package/lib/wasm-sync/WebAssemblyParser.js +1 -13
  317. package/lib/web/JsonpChunkLoadingPlugin.js +2 -1
  318. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  319. package/lib/web/JsonpTemplatePlugin.js +0 -1
  320. package/lib/webpack.js +21 -8
  321. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -1
  322. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  323. package/package.json +21 -21
  324. package/schemas/WebpackOptions.check.js +1 -1
  325. package/schemas/WebpackOptions.json +93 -96
  326. package/schemas/plugins/BannerPlugin.check.js +1 -1
  327. package/schemas/plugins/BannerPlugin.json +4 -0
  328. package/schemas/plugins/IgnorePlugin.json +1 -1
  329. package/schemas/plugins/ProgressPlugin.json +1 -1
  330. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  331. package/schemas/plugins/SourceMapDevToolPlugin.json +5 -1
  332. package/schemas/plugins/ids/HashedModuleIdsPlugin.check.d.ts +7 -0
  333. package/schemas/plugins/ids/HashedModuleIdsPlugin.check.js +6 -0
  334. package/schemas/plugins/{HashedModuleIdsPlugin.json → ids/HashedModuleIdsPlugin.json} +15 -2
  335. package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
  336. package/types.d.ts +1699 -706
  337. package/SECURITY.md +0 -9
  338. package/schemas/plugins/HashedModuleIdsPlugin.check.d.ts +0 -7
  339. package/schemas/plugins/HashedModuleIdsPlugin.check.js +0 -6
package/types.d.ts CHANGED
@@ -15,7 +15,6 @@ import {
15
15
  AssignmentPattern,
16
16
  AssignmentProperty,
17
17
  AwaitExpression,
18
- BaseNode,
19
18
  BigIntLiteral,
20
19
  BinaryExpression,
21
20
  BlockStatement,
@@ -25,16 +24,16 @@ import {
25
24
  ClassBody,
26
25
  ClassDeclaration,
27
26
  ClassExpression,
28
- Comment,
27
+ Comment as CommentImport,
29
28
  ConditionalExpression,
30
29
  ContinueStatement,
31
30
  DebuggerStatement,
32
31
  Directive,
33
32
  DoWhileStatement,
34
33
  EmptyStatement,
35
- ExportAllDeclaration as ExportAllDeclarationImport,
34
+ ExportAllDeclaration,
36
35
  ExportDefaultDeclaration,
37
- ExportNamedDeclaration as ExportNamedDeclarationImport,
36
+ ExportNamedDeclaration,
38
37
  ExportSpecifier,
39
38
  ExpressionStatement,
40
39
  ForInStatement,
@@ -44,7 +43,7 @@ import {
44
43
  FunctionExpression,
45
44
  Identifier,
46
45
  IfStatement,
47
- ImportDeclaration as ImportDeclarationImport,
46
+ ImportDeclaration,
48
47
  ImportDefaultSpecifier,
49
48
  ImportExpression as ImportExpressionImport,
50
49
  ImportNamespaceSpecifier,
@@ -88,16 +87,23 @@ import {
88
87
  WithStatement,
89
88
  YieldExpression
90
89
  } from "estree";
91
- import { IncomingMessage, ServerOptions } from "http";
90
+ import {
91
+ IncomingMessage,
92
+ Server as ServerImportHttp,
93
+ ServerOptions
94
+ } from "http";
95
+ import { Server as ServerImportHttps } from "https";
92
96
  import {
93
97
  Session as SessionImportInspectorClass_1,
94
98
  Session as SessionImportInspectorClass_2
95
99
  } from "inspector";
96
100
  import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
97
- import { ListenOptions, Server } from "net";
98
- import { validate as validateFunction } from "schema-utils";
101
+ import { ListenOptions } from "net";
102
+ import {
103
+ ValidationErrorConfiguration,
104
+ validate as validateFunction
105
+ } from "schema-utils";
99
106
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
100
- import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
101
107
  import {
102
108
  AsArray,
103
109
  AsyncParallelHook,
@@ -110,7 +116,8 @@ import {
110
116
  SyncBailHook,
111
117
  SyncHook,
112
118
  SyncWaterfallHook,
113
- TapOptions
119
+ TapOptions,
120
+ TypedHookMap
114
121
  } from "tapable";
115
122
  import { SecureContextOptions, TlsOptions } from "tls";
116
123
  import { URL } from "url";
@@ -189,6 +196,20 @@ declare interface AdditionalData {
189
196
  [index: string]: any;
190
197
  webpackAST: object;
191
198
  }
199
+ type AfterContextResolveData = ContextResolveData &
200
+ ContextOptions & {
201
+ resource: string | string[];
202
+ resourceQuery?: string;
203
+ resourceFragment?: string;
204
+ resolveDependencies: (
205
+ fs: InputFileSystem,
206
+ options: ContextModuleOptions,
207
+ callback: (
208
+ err: null | Error,
209
+ dependencies?: ContextElementDependency[]
210
+ ) => void
211
+ ) => void;
212
+ };
192
213
  declare class AggressiveMergingPlugin {
193
214
  constructor(options?: AggressiveMergingPluginOptions);
194
215
  options: AggressiveMergingPluginOptions;
@@ -245,6 +266,10 @@ type AliasOptionNewRequest = string | false | string[];
245
266
  declare interface AliasOptions {
246
267
  [index: string]: AliasOptionNewRequest;
247
268
  }
269
+ type AnyLoaderContext = NormalModuleLoaderContext<any> &
270
+ LoaderRunnerLoaderContext<any> &
271
+ LoaderPluginLoaderContext &
272
+ HotModuleReplacementPluginLoaderContext;
248
273
  declare interface Argument {
249
274
  description?: string;
250
275
  simpleType: SimpleType;
@@ -275,6 +300,14 @@ declare interface Asset {
275
300
  */
276
301
  info: AssetInfo;
277
302
  }
303
+ declare abstract class AssetBytesGenerator extends Generator {
304
+ generateError(
305
+ error: Error,
306
+ module: NormalModule,
307
+ generateContext: GenerateContext
308
+ ): null | Source;
309
+ }
310
+ declare abstract class AssetBytesParser extends ParserClass {}
278
311
  declare interface AssetDependencyMeta {
279
312
  sourceType: "css-url";
280
313
  }
@@ -289,6 +322,25 @@ type AssetFilterItemTypes =
289
322
  | string
290
323
  | RegExp
291
324
  | ((name: string, asset: StatsAsset) => boolean);
325
+ declare abstract class AssetGenerator extends Generator {
326
+ dataUrlOptions?:
327
+ | AssetGeneratorDataUrlOptions
328
+ | ((
329
+ source: string | Buffer,
330
+ context: { filename: string; module: Module }
331
+ ) => string);
332
+ filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
333
+ publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
334
+ outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
335
+ emit?: boolean;
336
+ getMimeType(module: NormalModule): string;
337
+ generateDataUri(module: NormalModule): string;
338
+ generateError(
339
+ error: Error,
340
+ module: NormalModule,
341
+ generateContext: GenerateContext
342
+ ): null | Source;
343
+ }
292
344
 
293
345
  /**
294
346
  * Options object for data url generation.
@@ -327,6 +379,15 @@ declare interface AssetInlineGeneratorOptions {
327
379
  context: { filename: string; module: Module }
328
380
  ) => string);
329
381
  }
382
+ declare abstract class AssetParser extends ParserClass {
383
+ dataUrlCondition?:
384
+ | boolean
385
+ | AssetParserDataUrlOptions
386
+ | ((
387
+ source: string | Buffer,
388
+ context: { filename: string; module: Module }
389
+ ) => boolean);
390
+ }
330
391
 
331
392
  /**
332
393
  * Options object for DataUrl condition.
@@ -382,6 +443,14 @@ declare interface AssetResourceGeneratorOptions {
382
443
  */
383
444
  publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
384
445
  }
446
+ declare abstract class AssetSourceGenerator extends Generator {
447
+ generateError(
448
+ error: Error,
449
+ module: NormalModule,
450
+ generateContext: GenerateContext
451
+ ): null | Source;
452
+ }
453
+ declare abstract class AssetSourceParser extends ParserClass {}
385
454
  declare class AsyncDependenciesBlock extends DependenciesBlock {
386
455
  constructor(
387
456
  groupOptions:
@@ -451,6 +520,7 @@ declare interface AsyncWebAssemblyModulesPluginOptions {
451
520
  */
452
521
  mangleImports?: boolean;
453
522
  }
523
+ declare abstract class AsyncWebAssemblyParser extends ParserClass {}
454
524
  declare class AutomaticPrefetchPlugin {
455
525
  constructor();
456
526
 
@@ -494,7 +564,7 @@ declare interface BannerPluginOptions {
494
564
  /**
495
565
  * Exclude all modules matching any of these conditions.
496
566
  */
497
- exclude?: string | RegExp | Rule[];
567
+ exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
498
568
 
499
569
  /**
500
570
  * If true, banner will be placed at the end of the output.
@@ -504,7 +574,7 @@ declare interface BannerPluginOptions {
504
574
  /**
505
575
  * Include all modules matching any of these conditions.
506
576
  */
507
- include?: string | RegExp | Rule[];
577
+ include?: string | RegExp | Rule[] | ((str: string) => boolean);
508
578
 
509
579
  /**
510
580
  * If true, banner will not be wrapped in a comment.
@@ -519,7 +589,7 @@ declare interface BannerPluginOptions {
519
589
  /**
520
590
  * Include all modules that pass test assertion.
521
591
  */
522
- test?: string | RegExp | Rule[];
592
+ test?: string | RegExp | Rule[] | ((str: string) => boolean);
523
593
  }
524
594
  declare interface BaseResolveRequest {
525
595
  /**
@@ -604,9 +674,9 @@ declare abstract class BasicEvaluatedExpression {
604
674
  getMemberRanges?: () => [number, number][];
605
675
  expression?:
606
676
  | Program
607
- | ImportDeclarationImport
608
- | ExportNamedDeclarationImport
609
- | ExportAllDeclarationImport
677
+ | ImportDeclaration
678
+ | ExportNamedDeclaration
679
+ | ExportAllDeclaration
610
680
  | ImportExpressionImport
611
681
  | UnaryExpression
612
682
  | ArrayExpression
@@ -835,9 +905,9 @@ declare abstract class BasicEvaluatedExpression {
835
905
  setExpression(
836
906
  expression?:
837
907
  | Program
838
- | ImportDeclarationImport
839
- | ExportNamedDeclarationImport
840
- | ExportAllDeclarationImport
908
+ | ImportDeclaration
909
+ | ExportNamedDeclaration
910
+ | ExportAllDeclaration
841
911
  | ImportExpressionImport
842
912
  | UnaryExpression
843
913
  | ArrayExpression
@@ -910,6 +980,7 @@ declare abstract class BasicEvaluatedExpression {
910
980
  | TemplateElement
911
981
  ): BasicEvaluatedExpression;
912
982
  }
983
+ type BeforeContextResolveData = ContextResolveData & ContextOptions;
913
984
  declare interface Bootstrap {
914
985
  header: string[];
915
986
  beforeStartup: string[];
@@ -918,18 +989,18 @@ declare interface Bootstrap {
918
989
  allowInlineStartup: boolean;
919
990
  }
920
991
  type BufferEncoding =
921
- | "ascii"
992
+ | "base64"
993
+ | "base64url"
994
+ | "hex"
995
+ | "binary"
922
996
  | "utf8"
923
997
  | "utf-8"
924
998
  | "utf16le"
925
999
  | "utf-16le"
926
- | "ucs2"
927
- | "ucs-2"
928
- | "base64"
929
- | "base64url"
930
1000
  | "latin1"
931
- | "binary"
932
- | "hex";
1001
+ | "ascii"
1002
+ | "ucs2"
1003
+ | "ucs-2";
933
1004
  type BufferEncodingOption = "buffer" | { encoding: "buffer" };
934
1005
  declare interface BufferEntry {
935
1006
  map?: null | RawSourceMap;
@@ -985,14 +1056,7 @@ declare const CIRCULAR_CONNECTION: unique symbol;
985
1056
  declare class CacheClass {
986
1057
  constructor();
987
1058
  hooks: {
988
- get: AsyncSeriesBailHook<
989
- [
990
- string,
991
- null | Etag,
992
- ((result: any, callback: (err?: Error) => void) => void)[]
993
- ],
994
- any
995
- >;
1059
+ get: AsyncSeriesBailHook<[string, null | Etag, GotHandler<any>[]], any>;
996
1060
  store: AsyncParallelHook<[string, null | Etag, any]>;
997
1061
  storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
998
1062
  beginIdle: SyncHook<[]>;
@@ -1162,7 +1226,7 @@ declare interface CallExpressionInfo {
1162
1226
  getMemberRanges: () => [number, number][];
1163
1227
  }
1164
1228
  declare interface CallbackAsyncQueue<T> {
1165
- (err?: null | WebpackError, result?: null | T): any;
1229
+ (err?: null | WebpackError, result?: null | T): void;
1166
1230
  }
1167
1231
  declare interface CallbackCacheCache<T> {
1168
1232
  (err: null | WebpackError, result?: T): void;
@@ -1170,20 +1234,14 @@ declare interface CallbackCacheCache<T> {
1170
1234
  declare interface CallbackCacheCacheFacade<T> {
1171
1235
  (err?: null | Error, result?: null | T): void;
1172
1236
  }
1173
- declare interface CallbackFunction_1<T> {
1174
- (err: null | Error, result?: T): any;
1175
- }
1176
- declare interface CallbackFunction_2<T> {
1177
- (err?: null | Error, result?: T): any;
1178
- }
1179
1237
  declare interface CallbackNormalErrorCache<T> {
1180
1238
  (err?: null | Error, result?: T): void;
1181
1239
  }
1182
- declare interface CallbackNormalModuleFactory<T> {
1183
- (err?: null | Error, stats?: T): void;
1240
+ declare interface CallbackWebpackFunction_1<T> {
1241
+ (err: null | Error, result?: T): void;
1184
1242
  }
1185
- declare interface CallbackWebpack<T> {
1186
- (err: null | Error, stats?: T): void;
1243
+ declare interface CallbackWebpackFunction_2<T, R = void> {
1244
+ (err: null | Error, result?: T): R;
1187
1245
  }
1188
1246
  type Cell<T> = undefined | T;
1189
1247
  type ChildrenStatsOptions = undefined | string | boolean | StatsOptions;
@@ -1262,7 +1320,7 @@ declare class Chunk {
1262
1320
  chunkGraph: ChunkGraph,
1263
1321
  includeDirectChildren?: boolean,
1264
1322
  filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1265
- ): Record<string | number, Record<string, (string | number)[]>>;
1323
+ ): ChunkChildIdsByOrdersMapByData;
1266
1324
  hasChildByOrder(
1267
1325
  chunkGraph: ChunkGraph,
1268
1326
  type: string,
@@ -1270,6 +1328,12 @@ declare class Chunk {
1270
1328
  filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1271
1329
  ): boolean;
1272
1330
  }
1331
+ declare interface ChunkChildIdsByOrdersMap {
1332
+ [index: string]: ChunkId[];
1333
+ }
1334
+ declare interface ChunkChildIdsByOrdersMapByData {
1335
+ [index: string]: ChunkChildIdsByOrdersMap;
1336
+ }
1273
1337
  declare class ChunkGraph {
1274
1338
  constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
1275
1339
  moduleGraph: ModuleGraph;
@@ -1327,17 +1391,17 @@ declare class ChunkGraph {
1327
1391
  chunk: Chunk,
1328
1392
  filterFn: (m: Module) => boolean,
1329
1393
  includeAllChunks?: boolean
1330
- ): Record<string | number, (string | number)[]>;
1394
+ ): ChunkModuleIdMapEs5Alias_2;
1331
1395
  getChunkModuleRenderedHashMap(
1332
1396
  chunk: Chunk,
1333
1397
  filterFn: (m: Module) => boolean,
1334
1398
  hashLength?: number,
1335
1399
  includeAllChunks?: boolean
1336
- ): Record<string | number, Record<string | number, string>>;
1400
+ ): ChunkModuleHashMap;
1337
1401
  getChunkConditionMap(
1338
1402
  chunk: Chunk,
1339
1403
  filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1340
- ): Record<string | number, boolean>;
1404
+ ): Record<ChunkId, boolean>;
1341
1405
  hasModuleInGraph(
1342
1406
  chunk: Chunk,
1343
1407
  filterFn: (m: Module) => boolean,
@@ -1397,8 +1461,8 @@ declare class ChunkGraph {
1397
1461
  disconnectChunkGroup(chunkGroup: ChunkGroup): void;
1398
1462
  getModuleId(module: Module): null | string | number;
1399
1463
  setModuleId(module: Module, id: ModuleId): void;
1400
- getRuntimeId(runtime: string): string | number;
1401
- setRuntimeId(runtime: string, id: string | number): void;
1464
+ getRuntimeId(runtime: string): RuntimeId;
1465
+ setRuntimeId(runtime: string, id: RuntimeId): void;
1402
1466
  hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
1403
1467
  getModuleHash(module: Module, runtime: RuntimeSpec): string;
1404
1468
  getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
@@ -1580,13 +1644,25 @@ declare interface ChunkHashes {
1580
1644
  }
1581
1645
  type ChunkId = string | number;
1582
1646
  declare interface ChunkMaps {
1583
- hash: Record<string | number, string>;
1584
- contentHash: Record<string | number, Record<string, string>>;
1585
- name: Record<string | number, string>;
1647
+ hash: Record<ChunkId, string>;
1648
+ contentHash: Record<ChunkId, Record<string, string>>;
1649
+ name: Record<ChunkId, string>;
1650
+ }
1651
+ declare interface ChunkModuleHashMap {
1652
+ [index: number]: IdToHashMap;
1653
+ [index: string]: IdToHashMap;
1586
1654
  }
1587
1655
  declare interface ChunkModuleHashes {
1588
1656
  [index: string]: string;
1589
1657
  }
1658
+ declare interface ChunkModuleIdMapEs5Alias_1 {
1659
+ [index: number]: ChunkId[];
1660
+ [index: string]: ChunkId[];
1661
+ }
1662
+ declare interface ChunkModuleIdMapEs5Alias_2 {
1663
+ [index: number]: ModuleId[];
1664
+ [index: string]: ModuleId[];
1665
+ }
1590
1666
  declare class ChunkModuleIdRangePlugin {
1591
1667
  constructor(options: ChunkModuleIdRangePluginOptions);
1592
1668
  options: ChunkModuleIdRangePluginOptions;
@@ -1622,8 +1698,8 @@ declare interface ChunkModuleIds {
1622
1698
  [index: string]: ModuleId[];
1623
1699
  }
1624
1700
  declare interface ChunkModuleMaps {
1625
- id: Record<string | number, (string | number)[]>;
1626
- hash: Record<string | number, string>;
1701
+ id: ChunkModuleIdMapEs5Alias_1;
1702
+ hash: chunkModuleHashMap;
1627
1703
  }
1628
1704
  type ChunkName = null | string;
1629
1705
  declare interface ChunkPathData {
@@ -1786,7 +1862,7 @@ declare abstract class ChunkTemplate {
1786
1862
  ) => void;
1787
1863
  };
1788
1864
  }>;
1789
- get outputOptions(): Output;
1865
+ get outputOptions(): OutputNormalizedWithDefaults;
1790
1866
  }
1791
1867
 
1792
1868
  /**
@@ -1801,7 +1877,7 @@ declare interface CleanOptions {
1801
1877
  /**
1802
1878
  * Keep these assets.
1803
1879
  */
1804
- keep?: string | RegExp | ((filename: string) => boolean);
1880
+ keep?: string | RegExp | ((path: string) => undefined | boolean);
1805
1881
  }
1806
1882
  declare class CleanPlugin {
1807
1883
  constructor(options?: CleanOptions);
@@ -1813,7 +1889,7 @@ declare class CleanPlugin {
1813
1889
  /**
1814
1890
  * Keep these assets.
1815
1891
  */
1816
- keep?: string | RegExp | ((filename: string) => boolean);
1892
+ keep?: string | RegExp | ((path: string) => undefined | boolean);
1817
1893
  };
1818
1894
 
1819
1895
  /**
@@ -1891,7 +1967,7 @@ declare interface CodeGenerationResult {
1891
1967
  /**
1892
1968
  * the resulting data for all source types
1893
1969
  */
1894
- data?: Map<string, any>;
1970
+ data?: CodeGenerationResultData;
1895
1971
 
1896
1972
  /**
1897
1973
  * the runtime requirements
@@ -1903,6 +1979,14 @@ declare interface CodeGenerationResult {
1903
1979
  */
1904
1980
  hash?: string;
1905
1981
  }
1982
+ type CodeGenerationResultData = Map<"topLevelDeclarations", Set<string>> &
1983
+ Map<"chunkInitFragments", InitFragment<any>[]> &
1984
+ Map<"url", { "css-url": string }> &
1985
+ Map<"filename", string> &
1986
+ Map<"assetInfo", AssetInfo> &
1987
+ Map<"fullContentHash", string> &
1988
+ Map<"share-init", [{ shareScope: string; initStage: number; init: string }]> &
1989
+ Map<string, any>;
1906
1990
  declare abstract class CodeGenerationResults {
1907
1991
  map: Map<Module, RuntimeSpecMap<CodeGenerationResult, CodeGenerationResult>>;
1908
1992
  get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
@@ -2008,6 +2092,15 @@ declare interface ColorsOptions {
2008
2092
  */
2009
2093
  useColor?: boolean;
2010
2094
  }
2095
+ declare interface CommentCssParser {
2096
+ value: string;
2097
+ range: [number, number];
2098
+ loc: { start: Position; end: Position };
2099
+ }
2100
+ declare interface CommonJsImportSettings {
2101
+ name?: string;
2102
+ context: string;
2103
+ }
2011
2104
  declare interface Comparator<T> {
2012
2105
  (a: T, b: T): 0 | 1 | -1;
2013
2106
  }
@@ -2015,6 +2108,15 @@ declare class CompatSource extends Source {
2015
2108
  constructor(sourceLike: SourceLike);
2016
2109
  static from(sourceLike: SourceLike): Source;
2017
2110
  }
2111
+ declare interface CompatibilitySettings {
2112
+ name: string;
2113
+ declaration: CompatibilitySettingsDeclaration;
2114
+ }
2115
+ declare interface CompatibilitySettingsDeclaration {
2116
+ updated: boolean;
2117
+ loc: DependencyLocation;
2118
+ range: [number, number];
2119
+ }
2018
2120
  declare class Compilation {
2019
2121
  /**
2020
2122
  * Creates an instance of Compilation.
@@ -2030,7 +2132,8 @@ declare class Compilation {
2030
2132
  failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
2031
2133
  succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
2032
2134
  dependencyReferencedExports: SyncWaterfallHook<
2033
- [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
2135
+ [(string[] | ReferencedExport)[], Dependency, RuntimeSpec],
2136
+ (string[] | ReferencedExport)[]
2034
2137
  >;
2035
2138
  executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
2036
2139
  prepareModuleExecution: AsyncParallelHook<
@@ -2146,18 +2249,22 @@ declare class Compilation {
2146
2249
  needAdditionalSeal: SyncBailHook<[], boolean | void>;
2147
2250
  afterSeal: AsyncSeriesHook<[]>;
2148
2251
  renderManifest: SyncWaterfallHook<
2149
- [RenderManifestEntry[], RenderManifestOptions]
2252
+ [RenderManifestEntry[], RenderManifestOptions],
2253
+ RenderManifestEntry[]
2150
2254
  >;
2151
2255
  fullHash: SyncHook<[Hash]>;
2152
2256
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
2153
2257
  moduleAsset: SyncHook<[Module, string]>;
2154
2258
  chunkAsset: SyncHook<[Chunk, string]>;
2155
- assetPath: SyncWaterfallHook<[string, PathData, undefined | AssetInfo]>;
2259
+ assetPath: SyncWaterfallHook<
2260
+ [string, PathData, undefined | AssetInfo],
2261
+ string
2262
+ >;
2156
2263
  needAdditionalPass: SyncBailHook<[], boolean | void>;
2157
2264
  childCompiler: SyncHook<[Compiler, string, number]>;
2158
2265
  log: SyncBailHook<[string, LogEntry], boolean | void>;
2159
- processWarnings: SyncWaterfallHook<[Error[]]>;
2160
- processErrors: SyncWaterfallHook<[Error[]]>;
2266
+ processWarnings: SyncWaterfallHook<[Error[]], Error[]>;
2267
+ processErrors: SyncWaterfallHook<[Error[]], Error[]>;
2161
2268
  statsPreset: HookMap<
2162
2269
  SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
2163
2270
  >;
@@ -2166,9 +2273,7 @@ declare class Compilation {
2166
2273
  >;
2167
2274
  statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
2168
2275
  statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
2169
- get normalModuleLoader(): SyncHook<
2170
- [LoaderContextObject<any>, NormalModule]
2171
- >;
2276
+ get normalModuleLoader(): SyncHook<[AnyLoaderContext, NormalModule]>;
2172
2277
  }>;
2173
2278
  name?: string;
2174
2279
  startTime?: number;
@@ -2177,12 +2282,12 @@ declare class Compilation {
2177
2282
  resolverFactory: ResolverFactory;
2178
2283
  inputFileSystem: InputFileSystem;
2179
2284
  fileSystemInfo: FileSystemInfo;
2180
- valueCacheVersions: Map<string, string | Set<string>>;
2285
+ valueCacheVersions: Map<string, ValueCacheVersion>;
2181
2286
  requestShortener: RequestShortener;
2182
2287
  compilerPath: string;
2183
2288
  logger: WebpackLogger;
2184
- options: WebpackOptionsNormalized;
2185
- outputOptions: OutputNormalized;
2289
+ options: WebpackOptionsNormalizedWithDefaults;
2290
+ outputOptions: OutputNormalizedWithDefaults;
2186
2291
  bail: boolean;
2187
2292
  profile: boolean;
2188
2293
  params: CompilationParams;
@@ -2194,7 +2299,7 @@ declare class Compilation {
2194
2299
  moduleMemCaches2?: Map<Module, WeakTupleMap<any[], any>>;
2195
2300
  moduleGraph: ModuleGraph;
2196
2301
  chunkGraph: ChunkGraph;
2197
- codeGenerationResults: CodeGenerationResults;
2302
+ codeGenerationResults?: CodeGenerationResults;
2198
2303
  processDependenciesQueue: AsyncQueue<Module, Module, Module>;
2199
2304
  addModuleQueue: AsyncQueue<Module, string, Module>;
2200
2305
  factorizeQueue: AsyncQueue<
@@ -2228,10 +2333,10 @@ declare class Compilation {
2228
2333
  warnings: Error[];
2229
2334
  children: Compilation[];
2230
2335
  logging: Map<string, LogEntry[]>;
2231
- dependencyFactories: Map<DepConstructor, ModuleFactory>;
2336
+ dependencyFactories: Map<DependencyConstructor, ModuleFactory>;
2232
2337
  dependencyTemplates: DependencyTemplates;
2233
2338
  childrenCounters: Record<string, number>;
2234
- usedChunkIds: null | Set<string | number>;
2339
+ usedChunkIds: null | Set<number>;
2235
2340
  usedModuleIds: null | Set<number>;
2236
2341
  needAdditionalPass: boolean;
2237
2342
  builtModules: WeakSet<Module>;
@@ -2280,6 +2385,17 @@ declare class Compilation {
2280
2385
  callback: (err?: null | WebpackError, result?: null | Module) => void
2281
2386
  ): void;
2282
2387
  processModuleDependenciesNonRecursive(module: Module): void;
2388
+ factorizeModule(
2389
+ options: FactorizeModuleOptions & { factoryResult?: false },
2390
+ callback: (err?: null | WebpackError, result?: null | Module) => void
2391
+ ): void;
2392
+ factorizeModule(
2393
+ options: FactorizeModuleOptions & { factoryResult: true },
2394
+ callback: (
2395
+ err?: null | WebpackError,
2396
+ result?: null | ModuleFactoryResult
2397
+ ) => void
2398
+ ): void;
2283
2399
  handleModuleCreation(
2284
2400
  __0: HandleModuleCreationOptions,
2285
2401
  callback: (err?: null | WebpackError, result?: null | Module) => void
@@ -2436,6 +2552,11 @@ declare class Compilation {
2436
2552
  name: string,
2437
2553
  outputOptions?: Partial<OutputNormalized>,
2438
2554
  plugins?: (
2555
+ | undefined
2556
+ | null
2557
+ | false
2558
+ | ""
2559
+ | 0
2439
2560
  | ((this: Compiler, compiler: Compiler) => void)
2440
2561
  | WebpackPluginInstance
2441
2562
  )[]
@@ -2443,22 +2564,12 @@ declare class Compilation {
2443
2564
  executeModule(
2444
2565
  module: Module,
2445
2566
  options: ExecuteModuleOptions,
2446
- callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
2567
+ callback: (
2568
+ err?: null | WebpackError,
2569
+ result?: null | ExecuteModuleResult
2570
+ ) => void
2447
2571
  ): void;
2448
2572
  checkConstraints(): void;
2449
- factorizeModule: {
2450
- (
2451
- options: FactorizeModuleOptions & { factoryResult?: false },
2452
- callback: (err?: null | WebpackError, result?: null | Module) => void
2453
- ): void;
2454
- (
2455
- options: FactorizeModuleOptions & { factoryResult: true },
2456
- callback: (
2457
- err?: null | WebpackError,
2458
- result?: ModuleFactoryResult
2459
- ) => void
2460
- ): void;
2461
- };
2462
2573
 
2463
2574
  /**
2464
2575
  * Add additional assets to the compilation.
@@ -2546,31 +2657,51 @@ declare interface CompilationAssets {
2546
2657
  }
2547
2658
  declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
2548
2659
  renderModuleContent: SyncWaterfallHook<
2549
- [Source, Module, WebAssemblyRenderContext]
2660
+ [Source, Module, WebAssemblyRenderContext],
2661
+ Source
2550
2662
  >;
2551
2663
  }
2552
2664
  declare interface CompilationHooksCssModulesPlugin {
2553
2665
  renderModulePackage: SyncWaterfallHook<
2554
- [Source, Module, ChunkRenderContextCssModulesPlugin]
2666
+ [Source, Module, ChunkRenderContextCssModulesPlugin],
2667
+ Source
2555
2668
  >;
2556
2669
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
2557
2670
  }
2558
2671
  declare interface CompilationHooksJavascriptModulesPlugin {
2559
- renderModuleContent: SyncWaterfallHook<[Source, Module, ModuleRenderContext]>;
2672
+ renderModuleContent: SyncWaterfallHook<
2673
+ [Source, Module, ModuleRenderContext],
2674
+ Source
2675
+ >;
2560
2676
  renderModuleContainer: SyncWaterfallHook<
2561
- [Source, Module, ModuleRenderContext]
2677
+ [Source, Module, ModuleRenderContext],
2678
+ Source
2679
+ >;
2680
+ renderModulePackage: SyncWaterfallHook<
2681
+ [Source, Module, ModuleRenderContext],
2682
+ Source
2562
2683
  >;
2563
- renderModulePackage: SyncWaterfallHook<[Source, Module, ModuleRenderContext]>;
2564
2684
  renderChunk: SyncWaterfallHook<
2565
- [Source, RenderContextJavascriptModulesPlugin]
2685
+ [Source, RenderContextJavascriptModulesPlugin],
2686
+ Source
2687
+ >;
2688
+ renderMain: SyncWaterfallHook<
2689
+ [Source, RenderContextJavascriptModulesPlugin],
2690
+ Source
2566
2691
  >;
2567
- renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
2568
2692
  renderContent: SyncWaterfallHook<
2569
- [Source, RenderContextJavascriptModulesPlugin]
2693
+ [Source, RenderContextJavascriptModulesPlugin],
2694
+ Source
2695
+ >;
2696
+ render: SyncWaterfallHook<
2697
+ [Source, RenderContextJavascriptModulesPlugin],
2698
+ Source
2570
2699
  >;
2571
- render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
2572
- renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
2573
- renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
2700
+ renderStartup: SyncWaterfallHook<
2701
+ [Source, Module, StartupRenderContext],
2702
+ Source
2703
+ >;
2704
+ renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext], string>;
2574
2705
  inlineInRuntimeBailout: SyncBailHook<
2575
2706
  [Module, Partial<RenderBootstrapContext>],
2576
2707
  string | void
@@ -2678,28 +2809,39 @@ declare class Compiler {
2678
2809
  watchMode: boolean;
2679
2810
  getCache(name: string): CacheFacade;
2680
2811
  getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
2681
- watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
2682
- run(callback: RunCallback<Stats>): void;
2812
+ watch(
2813
+ watchOptions: WatchOptions,
2814
+ handler: CallbackWebpackFunction_2<Stats, void>
2815
+ ): undefined | Watching;
2816
+ run(callback: CallbackWebpackFunction_2<Stats, void>): void;
2683
2817
  runAsChild(
2684
2818
  callback: (
2685
2819
  err: null | Error,
2686
2820
  entries?: Chunk[],
2687
2821
  compilation?: Compilation
2688
- ) => any
2822
+ ) => void
2689
2823
  ): void;
2690
2824
  purgeInputFileSystem(): void;
2691
2825
  emitAssets(
2692
2826
  compilation: Compilation,
2693
- callback: CallbackFunction_2<void>
2827
+ callback: (err: null | Error, result?: void) => void
2694
2828
  ): void;
2695
- emitRecords(callback: CallbackFunction_2<void>): void;
2696
- readRecords(callback: CallbackFunction_2<void>): void;
2829
+ emitRecords(callback: (err: null | Error, result?: void) => void): void;
2830
+ readRecords(callback: (err: null | Error, result?: void) => void): void;
2697
2831
  createChildCompiler(
2698
2832
  compilation: Compilation,
2699
2833
  compilerName: string,
2700
2834
  compilerIndex: number,
2701
2835
  outputOptions?: Partial<OutputNormalized>,
2702
- plugins?: WebpackPluginInstance[]
2836
+ plugins?: (
2837
+ | undefined
2838
+ | null
2839
+ | false
2840
+ | ""
2841
+ | 0
2842
+ | ((this: Compiler, compiler: Compiler) => void)
2843
+ | WebpackPluginInstance
2844
+ )[]
2703
2845
  ): Compiler;
2704
2846
  isChild(): boolean;
2705
2847
  createCompilation(params: CompilationParams): Compilation;
@@ -2710,8 +2852,8 @@ declare class Compiler {
2710
2852
  normalModuleFactory: NormalModuleFactory;
2711
2853
  contextModuleFactory: ContextModuleFactory;
2712
2854
  };
2713
- compile(callback: RunCallback<Compilation>): void;
2714
- close(callback: RunCallback<void>): void;
2855
+ compile(callback: CallbackWebpackFunction_2<Compilation, void>): void;
2856
+ close(callback: (err: null | Error, result?: void) => void): void;
2715
2857
  }
2716
2858
  declare class ConcatSource extends Source {
2717
2859
  constructor(...args: ConcatSourceChild[]);
@@ -2821,6 +2963,7 @@ declare class ConcatenationScope {
2821
2963
  ): null | (ModuleReferenceOptions & { index: number });
2822
2964
  static DEFAULT_EXPORT: string;
2823
2965
  static NAMESPACE_OBJECT_EXPORT: string;
2966
+ static chunkUsedNames: WeakMap<Chunk, Set<string>>;
2824
2967
  }
2825
2968
 
2826
2969
  /**
@@ -3052,13 +3195,13 @@ declare interface Configuration {
3052
3195
  | boolean
3053
3196
  | StatsOptions
3054
3197
  | "none"
3055
- | "verbose"
3056
3198
  | "summary"
3057
3199
  | "errors-only"
3058
3200
  | "errors-warnings"
3059
3201
  | "minimal"
3060
3202
  | "normal"
3061
- | "detailed";
3203
+ | "detailed"
3204
+ | "verbose";
3062
3205
 
3063
3206
  /**
3064
3207
  * Environment to build for. An array of environments to build for all of them when possible.
@@ -3243,8 +3386,21 @@ declare interface ContextAlternativeRequest {
3243
3386
  context: string;
3244
3387
  request: string;
3245
3388
  }
3389
+ declare abstract class ContextDependency extends Dependency {
3390
+ options: ContextDependencyOptions;
3391
+ userRequest: string;
3392
+ critical?: string | false;
3393
+ hadGlobalOrStickyRegExp: boolean;
3394
+ request?: string;
3395
+ range?: [number, number];
3396
+ valueRange?: [number, number];
3397
+ inShorthand?: string | boolean;
3398
+ replaces?: { value: string; range: [number, number] }[];
3399
+ }
3400
+ type ContextDependencyOptions = ContextOptions & { request: string };
3246
3401
  declare abstract class ContextElementDependency extends ModuleDependency {
3247
3402
  referencedExports?: null | string[][];
3403
+ attributes?: ImportAttributes;
3248
3404
  }
3249
3405
  declare class ContextExclusionPlugin {
3250
3406
  constructor(negativeMatcher: RegExp);
@@ -3275,17 +3431,27 @@ type ContextMode =
3275
3431
  | "async-weak";
3276
3432
  declare abstract class ContextModuleFactory extends ModuleFactory {
3277
3433
  hooks: Readonly<{
3278
- beforeResolve: AsyncSeriesWaterfallHook<[any]>;
3279
- afterResolve: AsyncSeriesWaterfallHook<[any]>;
3280
- contextModuleFiles: SyncWaterfallHook<[string[]]>;
3434
+ beforeResolve: AsyncSeriesWaterfallHook<
3435
+ [BeforeContextResolveData],
3436
+ false | void | BeforeContextResolveData
3437
+ >;
3438
+ afterResolve: AsyncSeriesWaterfallHook<
3439
+ [AfterContextResolveData],
3440
+ false | void | AfterContextResolveData
3441
+ >;
3442
+ contextModuleFiles: SyncWaterfallHook<[string[]], string[]>;
3281
3443
  alternatives: FakeHook<
3282
3444
  Pick<
3283
- AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
3445
+ AsyncSeriesWaterfallHook<
3446
+ [ContextAlternativeRequest[]],
3447
+ ContextAlternativeRequest[]
3448
+ >,
3284
3449
  "name" | "tap" | "tapAsync" | "tapPromise"
3285
3450
  >
3286
3451
  >;
3287
3452
  alternativeRequests: AsyncSeriesWaterfallHook<
3288
- [ContextAlternativeRequest[], ContextModuleOptions]
3453
+ [ContextAlternativeRequest[], ContextModuleOptions],
3454
+ ContextAlternativeRequest[]
3289
3455
  >;
3290
3456
  }>;
3291
3457
  resolverFactory: ResolverFactory;
@@ -3295,14 +3461,20 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
3295
3461
  callback: (
3296
3462
  err: null | Error,
3297
3463
  dependencies?: ContextElementDependency[]
3298
- ) => any
3464
+ ) => void
3299
3465
  ): void;
3300
3466
  }
3301
-
3302
- declare interface ContextModuleOptions {
3467
+ type ContextModuleOptions = ContextOptions & ContextModuleOptionsExtras;
3468
+ declare interface ContextModuleOptionsExtras {
3469
+ resource: string | false | string[];
3470
+ resourceQuery?: string;
3471
+ resourceFragment?: string;
3472
+ resolveOptions?: ResolveOptions;
3473
+ }
3474
+ declare interface ContextOptions {
3303
3475
  mode: ContextMode;
3304
3476
  recursive: boolean;
3305
- regExp: RegExp;
3477
+ regExp: null | false | RegExp;
3306
3478
  namespaceObject?: boolean | "strict";
3307
3479
  addon?: string;
3308
3480
  chunkName?: null | string;
@@ -3316,22 +3488,24 @@ declare interface ContextModuleOptions {
3316
3488
  * exports referenced from modules (won't be mangled)
3317
3489
  */
3318
3490
  referencedExports?: null | string[][];
3319
- layer?: string;
3491
+ layer?: null | string;
3320
3492
  attributes?: ImportAttributes;
3321
- resource: string | false | string[];
3322
- resourceQuery?: string;
3323
- resourceFragment?: string;
3324
- resolveOptions?: ResolveOptions;
3325
3493
  }
3326
3494
  declare class ContextReplacementPlugin {
3327
3495
  constructor(
3328
3496
  resourceRegExp: RegExp,
3329
- newContentResource?: string | boolean | RegExp | ((context?: any) => void),
3497
+ newContentResource?:
3498
+ | string
3499
+ | boolean
3500
+ | RegExp
3501
+ | ((context: BeforeContextResolveData | AfterContextResolveData) => void),
3330
3502
  newContentRecursive?: boolean | RegExp | NewContentCreateContextMap,
3331
3503
  newContentRegExp?: RegExp
3332
3504
  );
3333
3505
  resourceRegExp: RegExp;
3334
- newContentCallback?: (context?: any) => void;
3506
+ newContentCallback?: (
3507
+ context: BeforeContextResolveData | AfterContextResolveData
3508
+ ) => void;
3335
3509
  newContentResource?: string;
3336
3510
  newContentCreateContextMap?: (
3337
3511
  fs: InputFileSystem,
@@ -3348,6 +3522,15 @@ declare class ContextReplacementPlugin {
3348
3522
  */
3349
3523
  apply(compiler: Compiler): void;
3350
3524
  }
3525
+ declare interface ContextResolveData {
3526
+ context: string;
3527
+ request: string;
3528
+ resolveOptions?: ResolveOptions;
3529
+ fileDependencies: LazySet<string>;
3530
+ missingDependencies: LazySet<string>;
3531
+ contextDependencies: LazySet<string>;
3532
+ dependencies: ContextDependency[];
3533
+ }
3351
3534
  type ContextTimestamp = null | ContextFileSystemInfoEntry | "ignore";
3352
3535
  declare interface ContextTimestampAndHash {
3353
3536
  safeTime: number;
@@ -3356,6 +3539,9 @@ declare interface ContextTimestampAndHash {
3356
3539
  resolved?: ResolvedContextTimestampAndHash;
3357
3540
  symlinks?: Set<string>;
3358
3541
  }
3542
+ type CreateReadStreamFSImplementation = FSImplementation & {
3543
+ read: (...args: any[]) => any;
3544
+ };
3359
3545
  type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
3360
3546
  Record<string, any>;
3361
3547
  type CreateWriteStreamFSImplementation = FSImplementation & {
@@ -3425,6 +3611,23 @@ declare interface CssData {
3425
3611
  */
3426
3612
  exports: Map<string, string>;
3427
3613
  }
3614
+ declare abstract class CssGenerator extends Generator {
3615
+ convention?:
3616
+ | "as-is"
3617
+ | "camel-case"
3618
+ | "camel-case-only"
3619
+ | "dashes"
3620
+ | "dashes-only"
3621
+ | ((name: string) => string);
3622
+ localIdentName?: string;
3623
+ exportsOnly?: boolean;
3624
+ esModule?: boolean;
3625
+ generateError(
3626
+ error: Error,
3627
+ module: NormalModule,
3628
+ generateContext: GenerateContext
3629
+ ): null | Source;
3630
+ }
3428
3631
 
3429
3632
  /**
3430
3633
  * Generator options for css modules.
@@ -3524,9 +3727,9 @@ declare class CssLoadingRuntimeModule extends RuntimeModule {
3524
3727
  static STAGE_TRIGGER: number;
3525
3728
  }
3526
3729
  declare interface CssLoadingRuntimeModulePluginHooks {
3527
- createStylesheet: SyncWaterfallHook<[string, Chunk]>;
3528
- linkPreload: SyncWaterfallHook<[string, Chunk]>;
3529
- linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
3730
+ createStylesheet: SyncWaterfallHook<[string, Chunk], string>;
3731
+ linkPreload: SyncWaterfallHook<[string, Chunk], string>;
3732
+ linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
3530
3733
  }
3531
3734
  declare abstract class CssModule extends NormalModule {
3532
3735
  cssLayer: CssLayer;
@@ -3616,10 +3819,23 @@ declare class CssModulesPlugin {
3616
3819
  ): CompilationHooksCssModulesPlugin;
3617
3820
  static getChunkFilenameTemplate(
3618
3821
  chunk: Chunk,
3619
- outputOptions: OutputNormalized
3822
+ outputOptions: OutputNormalizedWithDefaults
3620
3823
  ): TemplatePath;
3621
3824
  static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
3622
3825
  }
3826
+ declare abstract class CssParser extends ParserClass {
3827
+ defaultMode: "global" | "auto" | "pure" | "local";
3828
+ import: boolean;
3829
+ url: boolean;
3830
+ namedExports: boolean;
3831
+ comments?: CommentCssParser[];
3832
+ magicCommentContext: Context;
3833
+ getComments(range: [number, number]): CommentCssParser[];
3834
+ parseCommentOptions(range: [number, number]): {
3835
+ options: null | Record<string, any>;
3836
+ errors: null | (Error & { comment: CommentCssParser })[];
3837
+ };
3838
+ }
3623
3839
 
3624
3840
  /**
3625
3841
  * Parser options for css modules.
@@ -3670,9 +3886,6 @@ declare class DelegatedPlugin {
3670
3886
  */
3671
3887
  apply(compiler: Compiler): void;
3672
3888
  }
3673
- declare interface DepConstructor {
3674
- new (...args: any[]): Dependency;
3675
- }
3676
3889
  declare abstract class DependenciesBlock {
3677
3890
  dependencies: Dependency[];
3678
3891
  blocks: AsyncDependenciesBlock[];
@@ -3702,7 +3915,6 @@ declare interface DependenciesBlockLike {
3702
3915
  declare class Dependency {
3703
3916
  constructor();
3704
3917
  weak: boolean;
3705
- defer?: boolean;
3706
3918
  optional?: boolean;
3707
3919
  get type(): string;
3708
3920
  get category(): string;
@@ -3872,7 +4084,8 @@ declare abstract class DependencyTemplates {
3872
4084
  */
3873
4085
  declare interface DestructuringAssignmentProperty {
3874
4086
  id: string;
3875
- range?: [number, number];
4087
+ range: [number, number];
4088
+ pattern?: Set<DestructuringAssignmentProperty>;
3876
4089
  shorthand: string | boolean;
3877
4090
  }
3878
4091
  declare class DeterministicChunkIdsPlugin {
@@ -3935,7 +4148,9 @@ declare interface DeterministicModuleIdsPluginOptions {
3935
4148
  */
3936
4149
  failOnConflict?: boolean;
3937
4150
  }
3938
- type DevtoolModuleFilenameTemplate = string | ((context?: any) => string);
4151
+ type DevtoolModuleFilenameTemplate =
4152
+ | string
4153
+ | ((context: ModuleFilenameTemplateContext) => string);
3939
4154
  declare interface Dirent<T extends string | Buffer = string> {
3940
4155
  /**
3941
4156
  * true when is file, otherwise false
@@ -4225,10 +4440,10 @@ declare interface EffectData {
4225
4440
  resourceQuery?: string;
4226
4441
  resourceFragment?: string;
4227
4442
  scheme?: string;
4228
- assertions?: ImportAttributes;
4443
+ attributes?: ImportAttributes;
4229
4444
  mimetype?: string;
4230
4445
  dependency: string;
4231
- descriptionData?: Record<string, any>;
4446
+ descriptionData?: JsonObjectTypes;
4232
4447
  compiler?: string;
4233
4448
  issuer: string;
4234
4449
  issuerLayer: string;
@@ -4303,18 +4518,18 @@ declare class EnableWasmLoadingPlugin {
4303
4518
  type EncodingOption =
4304
4519
  | undefined
4305
4520
  | null
4306
- | "ascii"
4521
+ | "base64"
4522
+ | "base64url"
4523
+ | "hex"
4524
+ | "binary"
4307
4525
  | "utf8"
4308
4526
  | "utf-8"
4309
4527
  | "utf16le"
4310
4528
  | "utf-16le"
4529
+ | "latin1"
4530
+ | "ascii"
4311
4531
  | "ucs2"
4312
4532
  | "ucs-2"
4313
- | "base64"
4314
- | "base64url"
4315
- | "latin1"
4316
- | "binary"
4317
- | "hex"
4318
4533
  | ObjectEncodingOptions;
4319
4534
  type Entry =
4320
4535
  | string
@@ -4661,12 +4876,16 @@ declare interface EvalDevToolModulePluginOptions {
4661
4876
  /**
4662
4877
  * module filename template
4663
4878
  */
4664
- moduleFilenameTemplate?: string | ((context?: any) => string);
4879
+ moduleFilenameTemplate?:
4880
+ | string
4881
+ | ((context: ModuleFilenameTemplateContext) => string);
4665
4882
  }
4666
4883
  declare class EvalSourceMapDevToolPlugin {
4667
- constructor(inputOptions: string | SourceMapDevToolPluginOptions);
4884
+ constructor(inputOptions?: string | SourceMapDevToolPluginOptions);
4668
4885
  sourceMapComment: string;
4669
- moduleFilenameTemplate: string | ((context?: any) => string);
4886
+ moduleFilenameTemplate:
4887
+ | string
4888
+ | ((context: ModuleFilenameTemplateContext) => string);
4670
4889
  namespace: string;
4671
4890
  options: SourceMapDevToolPluginOptions;
4672
4891
 
@@ -4679,7 +4898,6 @@ type ExcludeModulesType = "module" | "chunk" | "root-of-chunk" | "nested";
4679
4898
  declare interface ExecuteModuleArgument {
4680
4899
  module: Module;
4681
4900
  moduleObject?: ExecuteModuleObject;
4682
- preparedInfo: any;
4683
4901
  codeGenerationResult: CodeGenerationResult;
4684
4902
  }
4685
4903
  declare interface ExecuteModuleContext {
@@ -4763,11 +4981,6 @@ declare interface ExperimentsCommon {
4763
4981
  */
4764
4982
  futureDefaults?: boolean;
4765
4983
 
4766
- /**
4767
- * Enable module layers.
4768
- */
4769
- layers?: boolean;
4770
-
4771
4984
  /**
4772
4985
  * Allow output javascript files as module source type.
4773
4986
  */
@@ -4777,17 +4990,14 @@ declare interface ExperimentsCommon {
4777
4990
  * Support WebAssembly as synchronous EcmaScript Module (outdated).
4778
4991
  */
4779
4992
  syncWebAssembly?: boolean;
4780
-
4781
- /**
4782
- * Allow using top-level-await in EcmaScript Modules.
4783
- */
4784
- topLevelAwait?: boolean;
4785
4993
  }
4786
4994
 
4787
4995
  /**
4788
4996
  * Enables/Disables experiments (experimental features with relax SemVer compatibility).
4789
4997
  */
4790
4998
  declare interface ExperimentsExtra {
4999
+ [index: string]: any;
5000
+
4791
5001
  /**
4792
5002
  * Build http(s): urls using a lockfile and resource content cache.
4793
5003
  */
@@ -4834,9 +5044,6 @@ declare interface ExperimentsNormalizedExtra {
4834
5044
  */
4835
5045
  lazyCompilation?: false | LazyCompilationOptions;
4836
5046
  }
4837
- type ExportAllDeclarationJavascriptParser = ExportAllDeclarationImport & {
4838
- attributes?: ImportAttribute[];
4839
- };
4840
5047
  declare abstract class ExportInfo {
4841
5048
  name: string;
4842
5049
 
@@ -4936,9 +5143,6 @@ declare abstract class ExportInfo {
4936
5143
  | "not provided";
4937
5144
  getRenameInfo(): string;
4938
5145
  }
4939
- type ExportNamedDeclarationJavascriptParser = ExportNamedDeclarationImport & {
4940
- attributes?: ImportAttribute[];
4941
- };
4942
5146
  type ExportPresenceMode = false | 0 | 1 | 2 | 3;
4943
5147
  declare interface ExportSpec {
4944
5148
  /**
@@ -5154,30 +5358,26 @@ type ExternalItemFunction =
5154
5358
  ) => void
5155
5359
  ) => void)
5156
5360
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
5157
-
5158
- /**
5159
- * Data object passed as argument when a function is set for 'externals'.
5160
- */
5161
5361
  declare interface ExternalItemFunctionData {
5162
5362
  /**
5163
- * The directory in which the request is placed.
5363
+ * the directory in which the request is placed
5164
5364
  */
5165
- context?: string;
5365
+ context: string;
5166
5366
 
5167
5367
  /**
5168
- * Contextual information.
5368
+ * contextual information
5169
5369
  */
5170
- contextInfo?: ModuleFactoryCreateDataContextInfo;
5370
+ contextInfo: ModuleFactoryCreateDataContextInfo;
5171
5371
 
5172
5372
  /**
5173
- * The category of the referencing dependencies.
5373
+ * the category of the referencing dependency
5174
5374
  */
5175
- dependencyType?: string;
5375
+ dependencyType: string;
5176
5376
 
5177
5377
  /**
5178
- * Get a resolve function with the current resolver options.
5378
+ * get a resolve function with the current resolver options
5179
5379
  */
5180
- getResolve?: (
5380
+ getResolve: (
5181
5381
  options?: ResolveOptions
5182
5382
  ) =>
5183
5383
  | ((
@@ -5192,9 +5392,9 @@ declare interface ExternalItemFunctionData {
5192
5392
  | ((context: string, request: string) => Promise<string>);
5193
5393
 
5194
5394
  /**
5195
- * The request as written by the user in the require/import expression/statement.
5395
+ * the request as written by the user in the require/import expression/statement
5196
5396
  */
5197
- request?: string;
5397
+ request: string;
5198
5398
  }
5199
5399
 
5200
5400
  /**
@@ -5218,7 +5418,7 @@ declare interface ExternalItemObjectUnknown {
5218
5418
  type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
5219
5419
  declare class ExternalModule extends Module {
5220
5420
  constructor(
5221
- request: string | string[] | RequestRecord,
5421
+ request: ExternalModuleRequest,
5222
5422
  type: string,
5223
5423
  userRequest: string,
5224
5424
  dependencyMeta?:
@@ -5226,7 +5426,7 @@ declare class ExternalModule extends Module {
5226
5426
  | CssImportDependencyMeta
5227
5427
  | AssetDependencyMeta
5228
5428
  );
5229
- request: string | string[] | Record<string, string | string[]>;
5429
+ request: ExternalModuleRequest;
5230
5430
  externalType: string;
5231
5431
  userRequest: string;
5232
5432
  dependencyMeta?:
@@ -5242,6 +5442,9 @@ declare class ExternalModule extends Module {
5242
5442
  normalModuleFactory: NormalModuleFactory
5243
5443
  ): void;
5244
5444
  static ModuleExternalInitFragment: typeof ModuleExternalInitFragment;
5445
+ static getExternalModuleNodeCommonjsInitFragment: (
5446
+ runtimeTemplate: RuntimeTemplate
5447
+ ) => InitFragment<ChunkRenderContextJavascriptModulesPlugin>;
5245
5448
  }
5246
5449
  declare interface ExternalModuleInfo {
5247
5450
  type: "external";
@@ -5304,6 +5507,7 @@ declare interface ExternalModuleInfo {
5304
5507
  */
5305
5508
  interopDefaultAccessName?: string;
5306
5509
  }
5510
+ type ExternalModuleRequest = string | string[] | RequestRecord;
5307
5511
  type Externals =
5308
5512
  | string
5309
5513
  | RegExp
@@ -5318,8 +5522,8 @@ type Externals =
5318
5522
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
5319
5523
  | ExternalItem[];
5320
5524
  declare class ExternalsPlugin {
5321
- constructor(type: undefined | string, externals: Externals);
5322
- type?: string;
5525
+ constructor(type: string, externals: Externals);
5526
+ type: string;
5323
5527
  externals: Externals;
5324
5528
 
5325
5529
  /**
@@ -5372,6 +5576,15 @@ declare interface ExternalsPresets {
5372
5576
  */
5373
5577
  webAsync?: boolean;
5374
5578
  }
5579
+ type ExternalsPresetsNormalizedWithDefaults = ExternalsPresets & {
5580
+ web: NonNullable<undefined | boolean>;
5581
+ node: NonNullable<undefined | boolean>;
5582
+ nwjs: NonNullable<undefined | boolean>;
5583
+ electron: NonNullable<undefined | boolean>;
5584
+ electronMain: NonNullable<undefined | boolean>;
5585
+ electronPreload: NonNullable<undefined | boolean>;
5586
+ electronRenderer: NonNullable<undefined | boolean>;
5587
+ };
5375
5588
  type ExternalsType =
5376
5589
  | "import"
5377
5590
  | "var"
@@ -5743,15 +5956,8 @@ declare interface GenerateContext {
5743
5956
  /**
5744
5957
  * get access to the code generation data
5745
5958
  */
5746
- getData?: () => GenerateContextData;
5959
+ getData?: () => CodeGenerationResultData;
5747
5960
  }
5748
- type GenerateContextData = Map<"url", { [index: string]: string }> &
5749
- Map<"fullContentHash", string> &
5750
- Map<"contentHash", string> &
5751
- Map<"filename", string> &
5752
- Map<"assetInfo", AssetInfo> &
5753
- Map<"chunkInitFragments", InitFragment<GenerateContext>[]> &
5754
- Record<string, any>;
5755
5961
  declare interface GeneratedSourceInfo {
5756
5962
  /**
5757
5963
  * generated line
@@ -5795,6 +6001,11 @@ declare interface GeneratorOptionsByModuleTypeKnown {
5795
6001
  */
5796
6002
  asset?: AssetGeneratorOptions;
5797
6003
 
6004
+ /**
6005
+ * No generator options are supported for this module type.
6006
+ */
6007
+ "asset/bytes"?: EmptyGeneratorOptions;
6008
+
5798
6009
  /**
5799
6010
  * Generator options for asset/inline modules.
5800
6011
  */
@@ -5805,6 +6016,11 @@ declare interface GeneratorOptionsByModuleTypeKnown {
5805
6016
  */
5806
6017
  "asset/resource"?: AssetResourceGeneratorOptions;
5807
6018
 
6019
+ /**
6020
+ * No generator options are supported for this module type.
6021
+ */
6022
+ "asset/source"?: EmptyGeneratorOptions;
6023
+
5808
6024
  /**
5809
6025
  * Generator options for css modules.
5810
6026
  */
@@ -5897,10 +6113,13 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
5897
6113
  */
5898
6114
  static STAGE_TRIGGER: number;
5899
6115
  }
5900
- declare interface GroupConfig {
5901
- getKeys: (item?: any) => undefined | string[];
5902
- createGroup: (key: string, children: any[], items: any[]) => object;
5903
- getOptions?: (name: string, items: any[]) => GroupOptions;
6116
+ declare interface GotHandler<T> {
6117
+ (result: T, callback: () => void): void;
6118
+ }
6119
+ declare interface GroupConfig<T, R> {
6120
+ getKeys: (item: T) => undefined | string[];
6121
+ getOptions?: (name: string, items: T[]) => GroupOptions;
6122
+ createGroup: (key: string, children: T[], items: T[]) => R;
5904
6123
  }
5905
6124
  declare interface GroupOptions {
5906
6125
  groupChildren?: boolean;
@@ -5976,6 +6195,8 @@ declare class HarmonyImportDependency extends ModuleDependency {
5976
6195
  defer?: boolean
5977
6196
  );
5978
6197
  sourceOrder: number;
6198
+ attributes?: ImportAttributes;
6199
+ defer?: boolean;
5979
6200
  getImportVar(moduleGraph: ModuleGraph): string;
5980
6201
  getModuleExports(__0: DependencyTemplateContext): string;
5981
6202
  getImportStatement(
@@ -6006,19 +6227,51 @@ declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
6006
6227
  referencedModule: Module
6007
6228
  ): undefined | string | boolean | SortableSet<string>;
6008
6229
  }
6230
+ declare interface HarmonySettings {
6231
+ ids: string[];
6232
+ source: string;
6233
+ sourceOrder: number;
6234
+ name: string;
6235
+ await: boolean;
6236
+ attributes?: ImportAttributes;
6237
+ defer?: boolean;
6238
+ }
6009
6239
  declare class Hash {
6010
6240
  constructor();
6011
6241
 
6012
6242
  /**
6013
6243
  * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
6014
6244
  */
6015
- update(data: string | Buffer, inputEncoding?: string): Hash;
6245
+ update(data: string | Buffer): Hash;
6246
+
6247
+ /**
6248
+ * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
6249
+ */
6250
+ update(data: string, inputEncoding: HashDigest): Hash;
6016
6251
 
6017
6252
  /**
6018
6253
  * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
6019
6254
  */
6020
- digest(encoding?: string): string | Buffer;
6255
+ digest(): Buffer;
6256
+
6257
+ /**
6258
+ * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
6259
+ */
6260
+ digest(encoding: HashDigest): string;
6021
6261
  }
6262
+ type HashDigest =
6263
+ | "base64"
6264
+ | "base64url"
6265
+ | "hex"
6266
+ | "binary"
6267
+ | "utf8"
6268
+ | "utf-8"
6269
+ | "utf16le"
6270
+ | "utf-16le"
6271
+ | "latin1"
6272
+ | "ascii"
6273
+ | "ucs2"
6274
+ | "ucs-2";
6022
6275
  type HashFunction = string | typeof Hash;
6023
6276
  declare interface HashLike {
6024
6277
  /**
@@ -6036,8 +6289,10 @@ declare interface HashableObject {
6036
6289
  }
6037
6290
  declare class HashedModuleIdsPlugin {
6038
6291
  constructor(options?: HashedModuleIdsPluginOptions);
6039
- options: HashedModuleIdsPluginOptions;
6040
-
6292
+ options: Required<Omit<HashedModuleIdsPluginOptions, "context">> & {
6293
+ context?: string;
6294
+ };
6295
+
6041
6296
  /**
6042
6297
  * Apply the plugin
6043
6298
  */
@@ -6052,7 +6307,19 @@ declare interface HashedModuleIdsPluginOptions {
6052
6307
  /**
6053
6308
  * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
6054
6309
  */
6055
- hashDigest?: "base64" | "latin1" | "hex";
6310
+ hashDigest?:
6311
+ | "base64"
6312
+ | "base64url"
6313
+ | "hex"
6314
+ | "binary"
6315
+ | "utf8"
6316
+ | "utf-8"
6317
+ | "utf16le"
6318
+ | "utf-16le"
6319
+ | "latin1"
6320
+ | "ascii"
6321
+ | "ucs2"
6322
+ | "ucs-2";
6056
6323
 
6057
6324
  /**
6058
6325
  * The prefix length of the hash digest to use, defaults to 4.
@@ -6190,6 +6457,10 @@ declare interface IStatsBase<T> {
6190
6457
  ctime: Date;
6191
6458
  birthtime: Date;
6192
6459
  }
6460
+ declare interface IdToHashMap {
6461
+ [index: number]: string;
6462
+ [index: string]: string;
6463
+ }
6193
6464
  declare class IgnorePlugin {
6194
6465
  constructor(options: IgnorePluginOptions);
6195
6466
  options: IgnorePluginOptions;
@@ -6197,7 +6468,9 @@ declare class IgnorePlugin {
6197
6468
  /**
6198
6469
  * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
6199
6470
  */
6200
- checkIgnore(resolveData: ResolveData): undefined | false;
6471
+ checkIgnore(
6472
+ resolveData: ResolveData | BeforeContextResolveData
6473
+ ): undefined | false;
6201
6474
 
6202
6475
  /**
6203
6476
  * Apply the plugin
@@ -6221,50 +6494,12 @@ type IgnorePluginOptions =
6221
6494
  */
6222
6495
  checkResource: (resource: string, context: string) => boolean;
6223
6496
  };
6224
- type ImportAttribute = BaseNode & {
6225
- type: "ImportAttribute";
6226
- key: Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral;
6227
- value: Literal;
6228
- };
6229
6497
  type ImportAttributes = Record<string, string> & {};
6230
- type ImportDeclarationJavascriptParser = ImportDeclarationImport & {
6231
- attributes?: ImportAttribute[];
6232
- phase?: "defer";
6233
- };
6234
6498
  declare interface ImportDependencyMeta {
6235
6499
  attributes?: ImportAttributes;
6236
6500
  externalType?: "import" | "module";
6237
6501
  }
6238
6502
  type ImportExpressionJavascriptParser = ImportExpressionImport & {
6239
- options?:
6240
- | null
6241
- | ImportExpressionImport
6242
- | UnaryExpression
6243
- | ArrayExpression
6244
- | ArrowFunctionExpression
6245
- | AssignmentExpression
6246
- | AwaitExpression
6247
- | BinaryExpression
6248
- | SimpleCallExpression
6249
- | NewExpression
6250
- | ChainExpression
6251
- | ClassExpression
6252
- | ConditionalExpression
6253
- | FunctionExpression
6254
- | Identifier
6255
- | SimpleLiteral
6256
- | RegExpLiteral
6257
- | BigIntLiteral
6258
- | LogicalExpression
6259
- | MemberExpression
6260
- | MetaProperty
6261
- | ObjectExpression
6262
- | SequenceExpression
6263
- | TaggedTemplateExpression
6264
- | TemplateLiteral
6265
- | ThisExpression
6266
- | UpdateExpression
6267
- | YieldExpression;
6268
6503
  phase?: "defer";
6269
6504
  };
6270
6505
  declare interface ImportModuleOptions {
@@ -6283,6 +6518,10 @@ declare interface ImportModuleOptions {
6283
6518
  */
6284
6519
  baseUri?: string;
6285
6520
  }
6521
+ declare interface ImportSettings {
6522
+ references: string[][];
6523
+ expression: ImportExpressionJavascriptParser;
6524
+ }
6286
6525
  type ImportSource =
6287
6526
  | undefined
6288
6527
  | null
@@ -6324,7 +6563,7 @@ declare interface InfrastructureLogging {
6324
6563
  /**
6325
6564
  * Log level.
6326
6565
  */
6327
- level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
6566
+ level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
6328
6567
 
6329
6568
  /**
6330
6569
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
@@ -6335,6 +6574,26 @@ declare interface InfrastructureLogging {
6335
6574
  rows?: number;
6336
6575
  };
6337
6576
  }
6577
+ type InfrastructureLoggingNormalizedWithDefaults = InfrastructureLogging & {
6578
+ stream: NodeJS.WritableStream & {
6579
+ isTTY?: boolean;
6580
+ columns?: number;
6581
+ rows?: number;
6582
+ };
6583
+ level: NonNullable<
6584
+ undefined | "none" | "verbose" | "error" | "warn" | "info" | "log"
6585
+ >;
6586
+ debug: NonNullable<
6587
+ | undefined
6588
+ | string
6589
+ | boolean
6590
+ | RegExp
6591
+ | FilterItemTypes[]
6592
+ | ((value: string) => boolean)
6593
+ >;
6594
+ colors: NonNullable<undefined | boolean>;
6595
+ appendOnly: NonNullable<undefined | boolean>;
6596
+ };
6338
6597
  declare class InitFragment<GenerateContext> {
6339
6598
  constructor(
6340
6599
  content: undefined | string | Source,
@@ -6352,12 +6611,9 @@ declare class InitFragment<GenerateContext> {
6352
6611
  getEndContent(context: GenerateContext): undefined | string | Source;
6353
6612
  serialize(context: ObjectSerializerContext): void;
6354
6613
  deserialize(context: ObjectDeserializerContext): void;
6355
- merge: any;
6356
- getImported: any;
6357
- setImported: any;
6358
- static addToSource<Context, T>(
6614
+ static addToSource<Context>(
6359
6615
  source: Source,
6360
- initFragments: InitFragment<T>[],
6616
+ initFragments: MaybeMergeableInitFragment<Context>[],
6361
6617
  context: Context
6362
6618
  ): Source;
6363
6619
  static STAGE_CONSTANTS: number;
@@ -6405,18 +6661,18 @@ declare interface IntermediateFileSystemExtras {
6405
6661
  createWriteStream: (
6406
6662
  pathLike: PathLikeFs,
6407
6663
  result?:
6408
- | "ascii"
6664
+ | "base64"
6665
+ | "base64url"
6666
+ | "hex"
6667
+ | "binary"
6409
6668
  | "utf8"
6410
6669
  | "utf-8"
6411
6670
  | "utf16le"
6412
6671
  | "utf-16le"
6672
+ | "latin1"
6673
+ | "ascii"
6413
6674
  | "ucs2"
6414
6675
  | "ucs-2"
6415
- | "base64"
6416
- | "base64url"
6417
- | "latin1"
6418
- | "binary"
6419
- | "hex"
6420
6676
  | WriteStreamOptions
6421
6677
  ) => NodeJS.WritableStream;
6422
6678
  open: Open;
@@ -6436,6 +6692,8 @@ declare interface InterpolatedPathAndAssetInfo {
6436
6692
  path: string;
6437
6693
  info: AssetInfo;
6438
6694
  }
6695
+ type Issuer = undefined | null | Module;
6696
+ type IssuerLayer = null | string;
6439
6697
  declare interface Item<T> {
6440
6698
  [index: string]: string | string[] | T;
6441
6699
  }
@@ -6456,6 +6714,33 @@ declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
6456
6714
  [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
6457
6715
  [Symbol.dispose](): void;
6458
6716
  }
6717
+ declare abstract class JavascriptGenerator extends Generator {
6718
+ generateError(
6719
+ error: Error,
6720
+ module: NormalModule,
6721
+ generateContext: GenerateContext
6722
+ ): null | Source;
6723
+ sourceModule(
6724
+ module: Module,
6725
+ initFragments: InitFragment<GenerateContext>[],
6726
+ source: ReplaceSource,
6727
+ generateContext: GenerateContext
6728
+ ): void;
6729
+ sourceBlock(
6730
+ module: Module,
6731
+ block: DependenciesBlock,
6732
+ initFragments: InitFragment<GenerateContext>[],
6733
+ source: ReplaceSource,
6734
+ generateContext: GenerateContext
6735
+ ): void;
6736
+ sourceDependency(
6737
+ module: Module,
6738
+ dependency: Dependency,
6739
+ initFragments: InitFragment<GenerateContext>[],
6740
+ source: ReplaceSource,
6741
+ generateContext: GenerateContext
6742
+ ): void;
6743
+ }
6459
6744
  declare class JavascriptModulesPlugin {
6460
6745
  constructor(options?: object);
6461
6746
  options: object;
@@ -6505,7 +6790,7 @@ declare class JavascriptModulesPlugin {
6505
6790
  ): CompilationHooksJavascriptModulesPlugin;
6506
6791
  static getChunkFilenameTemplate(
6507
6792
  chunk: Chunk,
6508
- outputOptions: Output
6793
+ outputOptions: OutputNormalizedWithDefaults
6509
6794
  ): TemplatePath;
6510
6795
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
6511
6796
  }
@@ -6627,9 +6912,9 @@ declare class JavascriptParser extends ParserClass {
6627
6912
  >;
6628
6913
  preStatement: SyncBailHook<
6629
6914
  [
6630
- | ImportDeclarationJavascriptParser
6631
- | ExportNamedDeclarationJavascriptParser
6632
- | ExportAllDeclarationJavascriptParser
6915
+ | ImportDeclaration
6916
+ | ExportNamedDeclaration
6917
+ | ExportAllDeclaration
6633
6918
  | FunctionDeclaration
6634
6919
  | MaybeNamedFunctionDeclaration
6635
6920
  | VariableDeclaration
@@ -6660,9 +6945,9 @@ declare class JavascriptParser extends ParserClass {
6660
6945
  >;
6661
6946
  blockPreStatement: SyncBailHook<
6662
6947
  [
6663
- | ImportDeclarationJavascriptParser
6664
- | ExportNamedDeclarationJavascriptParser
6665
- | ExportAllDeclarationJavascriptParser
6948
+ | ImportDeclaration
6949
+ | ExportNamedDeclaration
6950
+ | ExportAllDeclaration
6666
6951
  | FunctionDeclaration
6667
6952
  | MaybeNamedFunctionDeclaration
6668
6953
  | VariableDeclaration
@@ -6693,9 +6978,9 @@ declare class JavascriptParser extends ParserClass {
6693
6978
  >;
6694
6979
  statement: SyncBailHook<
6695
6980
  [
6696
- | ImportDeclarationJavascriptParser
6697
- | ExportNamedDeclarationJavascriptParser
6698
- | ExportAllDeclarationJavascriptParser
6981
+ | ImportDeclaration
6982
+ | ExportNamedDeclaration
6983
+ | ExportAllDeclaration
6699
6984
  | FunctionDeclaration
6700
6985
  | MaybeNamedFunctionDeclaration
6701
6986
  | VariableDeclaration
@@ -6748,33 +7033,24 @@ declare class JavascriptParser extends ParserClass {
6748
7033
  boolean | void
6749
7034
  >;
6750
7035
  label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
6751
- import: SyncBailHook<
6752
- [ImportDeclarationJavascriptParser, ImportSource],
6753
- boolean | void
6754
- >;
7036
+ import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
6755
7037
  importSpecifier: SyncBailHook<
6756
- [ImportDeclarationJavascriptParser, ImportSource, null | string, string],
7038
+ [ImportDeclaration, ImportSource, null | string, string],
6757
7039
  boolean | void
6758
7040
  >;
6759
7041
  export: SyncBailHook<
6760
- [ExportNamedDeclarationJavascriptParser | ExportDefaultDeclaration],
7042
+ [ExportNamedDeclaration | ExportDefaultDeclaration],
6761
7043
  boolean | void
6762
7044
  >;
6763
7045
  exportImport: SyncBailHook<
6764
- [
6765
- (
6766
- | ExportNamedDeclarationJavascriptParser
6767
- | ExportAllDeclarationJavascriptParser
6768
- ),
6769
- ImportSource
6770
- ],
7046
+ [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
6771
7047
  boolean | void
6772
7048
  >;
6773
7049
  exportDeclaration: SyncBailHook<
6774
7050
  [
6775
7051
  (
6776
- | ExportNamedDeclarationJavascriptParser
6777
- | ExportAllDeclarationJavascriptParser
7052
+ | ExportNamedDeclaration
7053
+ | ExportAllDeclaration
6778
7054
  | ExportDefaultDeclaration
6779
7055
  ),
6780
7056
  Declaration
@@ -6821,8 +7097,8 @@ declare class JavascriptParser extends ParserClass {
6821
7097
  exportSpecifier: SyncBailHook<
6822
7098
  [
6823
7099
  (
6824
- | ExportNamedDeclarationJavascriptParser
6825
- | ExportAllDeclarationJavascriptParser
7100
+ | ExportNamedDeclaration
7101
+ | ExportAllDeclaration
6826
7102
  | ExportDefaultDeclaration
6827
7103
  ),
6828
7104
  string,
@@ -6833,10 +7109,7 @@ declare class JavascriptParser extends ParserClass {
6833
7109
  >;
6834
7110
  exportImportSpecifier: SyncBailHook<
6835
7111
  [
6836
- (
6837
- | ExportNamedDeclarationJavascriptParser
6838
- | ExportAllDeclarationJavascriptParser
6839
- ),
7112
+ ExportNamedDeclaration | ExportAllDeclaration,
6840
7113
  ImportSource,
6841
7114
  null | string,
6842
7115
  null | string,
@@ -6867,7 +7140,10 @@ declare class JavascriptParser extends ParserClass {
6867
7140
  >;
6868
7141
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
6869
7142
  importCall: SyncBailHook<
6870
- [ImportExpressionJavascriptParser],
7143
+ [
7144
+ ImportExpressionJavascriptParser,
7145
+ undefined | SimpleCallExpression | NewExpression
7146
+ ],
6871
7147
  boolean | void
6872
7148
  >;
6873
7149
  topLevelAwait: SyncBailHook<
@@ -6949,21 +7225,21 @@ declare class JavascriptParser extends ParserClass {
6949
7225
  [LogicalExpression],
6950
7226
  boolean | void
6951
7227
  >;
6952
- program: SyncBailHook<[Program, Comment[]], boolean | void>;
7228
+ program: SyncBailHook<[Program, CommentImport[]], boolean | void>;
6953
7229
  terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
6954
- finish: SyncBailHook<[Program, Comment[]], boolean | void>;
7230
+ finish: SyncBailHook<[Program, CommentImport[]], boolean | void>;
6955
7231
  unusedStatement: SyncBailHook<[Statement], boolean | void>;
6956
7232
  }>;
6957
7233
  sourceType: "module" | "auto" | "script";
6958
7234
  scope: ScopeInfo;
6959
7235
  state: ParserState;
6960
- comments?: Comment[];
7236
+ comments?: CommentImport[];
6961
7237
  semicolons?: Set<number>;
6962
7238
  statementPath?: StatementPathItem[];
6963
7239
  prevStatement?:
6964
- | ImportDeclarationJavascriptParser
6965
- | ExportNamedDeclarationJavascriptParser
6966
- | ExportAllDeclarationJavascriptParser
7240
+ | ImportDeclaration
7241
+ | ExportNamedDeclaration
7242
+ | ExportAllDeclaration
6967
7243
  | ImportExpressionImport
6968
7244
  | UnaryExpression
6969
7245
  | ArrayExpression
@@ -7020,7 +7296,13 @@ declare class JavascriptParser extends ParserClass {
7020
7296
  Expression,
7021
7297
  Set<DestructuringAssignmentProperty>
7022
7298
  >;
7023
- currentTagData?: TagData;
7299
+ currentTagData?:
7300
+ | Record<string, any>
7301
+ | TopLevelSymbol
7302
+ | HarmonySettings
7303
+ | ImportSettings
7304
+ | CommonJsImportSettings
7305
+ | CompatibilitySettings;
7024
7306
  magicCommentContext: Context;
7025
7307
  destructuringAssignmentPropertiesFor(
7026
7308
  node: Expression
@@ -7065,9 +7347,9 @@ declare class JavascriptParser extends ParserClass {
7065
7347
  */
7066
7348
  modulePreWalkStatements(
7067
7349
  statements: (
7068
- | ImportDeclarationJavascriptParser
7069
- | ExportNamedDeclarationJavascriptParser
7070
- | ExportAllDeclarationJavascriptParser
7350
+ | ImportDeclaration
7351
+ | ExportNamedDeclaration
7352
+ | ExportAllDeclaration
7071
7353
  | FunctionDeclaration
7072
7354
  | VariableDeclaration
7073
7355
  | ClassDeclaration
@@ -7099,9 +7381,9 @@ declare class JavascriptParser extends ParserClass {
7099
7381
  */
7100
7382
  preWalkStatements(
7101
7383
  statements: (
7102
- | ImportDeclarationJavascriptParser
7103
- | ExportNamedDeclarationJavascriptParser
7104
- | ExportAllDeclarationJavascriptParser
7384
+ | ImportDeclaration
7385
+ | ExportNamedDeclaration
7386
+ | ExportAllDeclaration
7105
7387
  | FunctionDeclaration
7106
7388
  | VariableDeclaration
7107
7389
  | ClassDeclaration
@@ -7133,9 +7415,9 @@ declare class JavascriptParser extends ParserClass {
7133
7415
  */
7134
7416
  blockPreWalkStatements(
7135
7417
  statements: (
7136
- | ImportDeclarationJavascriptParser
7137
- | ExportNamedDeclarationJavascriptParser
7138
- | ExportAllDeclarationJavascriptParser
7418
+ | ImportDeclaration
7419
+ | ExportNamedDeclaration
7420
+ | ExportAllDeclaration
7139
7421
  | FunctionDeclaration
7140
7422
  | VariableDeclaration
7141
7423
  | ClassDeclaration
@@ -7167,9 +7449,9 @@ declare class JavascriptParser extends ParserClass {
7167
7449
  */
7168
7450
  walkStatements(
7169
7451
  statements: (
7170
- | ImportDeclarationJavascriptParser
7171
- | ExportNamedDeclarationJavascriptParser
7172
- | ExportAllDeclarationJavascriptParser
7452
+ | ImportDeclaration
7453
+ | ExportNamedDeclaration
7454
+ | ExportAllDeclaration
7173
7455
  | FunctionDeclaration
7174
7456
  | VariableDeclaration
7175
7457
  | ClassDeclaration
@@ -7201,9 +7483,9 @@ declare class JavascriptParser extends ParserClass {
7201
7483
  */
7202
7484
  preWalkStatement(
7203
7485
  statement:
7204
- | ImportDeclarationJavascriptParser
7205
- | ExportNamedDeclarationJavascriptParser
7206
- | ExportAllDeclarationJavascriptParser
7486
+ | ImportDeclaration
7487
+ | ExportNamedDeclaration
7488
+ | ExportAllDeclaration
7207
7489
  | FunctionDeclaration
7208
7490
  | MaybeNamedFunctionDeclaration
7209
7491
  | VariableDeclaration
@@ -7232,9 +7514,9 @@ declare class JavascriptParser extends ParserClass {
7232
7514
  ): void;
7233
7515
  blockPreWalkStatement(
7234
7516
  statement:
7235
- | ImportDeclarationJavascriptParser
7236
- | ExportNamedDeclarationJavascriptParser
7237
- | ExportAllDeclarationJavascriptParser
7517
+ | ImportDeclaration
7518
+ | ExportNamedDeclaration
7519
+ | ExportAllDeclaration
7238
7520
  | FunctionDeclaration
7239
7521
  | MaybeNamedFunctionDeclaration
7240
7522
  | VariableDeclaration
@@ -7263,9 +7545,9 @@ declare class JavascriptParser extends ParserClass {
7263
7545
  ): void;
7264
7546
  walkStatement(
7265
7547
  statement:
7266
- | ImportDeclarationJavascriptParser
7267
- | ExportNamedDeclarationJavascriptParser
7268
- | ExportAllDeclarationJavascriptParser
7548
+ | ImportDeclaration
7549
+ | ExportNamedDeclaration
7550
+ | ExportAllDeclaration
7269
7551
  | FunctionDeclaration
7270
7552
  | MaybeNamedFunctionDeclaration
7271
7553
  | VariableDeclaration
@@ -7365,29 +7647,19 @@ declare class JavascriptParser extends ParserClass {
7365
7647
  | ThisExpression
7366
7648
  | UpdateExpression
7367
7649
  | YieldExpression;
7368
- modulePreWalkImportDeclaration(
7369
- statement: ImportDeclarationJavascriptParser
7370
- ): void;
7650
+ modulePreWalkImportDeclaration(statement: ImportDeclaration): void;
7371
7651
  enterDeclaration(
7372
7652
  declaration: Declaration,
7373
7653
  onIdent: (ident: string, identifier: Identifier) => void
7374
7654
  ): void;
7375
- modulePreWalkExportNamedDeclaration(
7376
- statement: ExportNamedDeclarationJavascriptParser
7377
- ): void;
7378
- blockPreWalkExportNamedDeclaration(
7379
- statement: ExportNamedDeclarationJavascriptParser
7380
- ): void;
7381
- walkExportNamedDeclaration(
7382
- statement: ExportNamedDeclarationJavascriptParser
7383
- ): void;
7655
+ modulePreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7656
+ blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7657
+ walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7384
7658
  blockPreWalkExportDefaultDeclaration(
7385
7659
  statement: ExportDefaultDeclaration
7386
7660
  ): void;
7387
7661
  walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
7388
- modulePreWalkExportAllDeclaration(
7389
- statement: ExportAllDeclarationJavascriptParser
7390
- ): void;
7662
+ modulePreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
7391
7663
  preWalkVariableDeclaration(statement: VariableDeclaration): void;
7392
7664
  blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
7393
7665
  preWalkVariableDeclarator(declarator: VariableDeclarator): void;
@@ -7597,7 +7869,7 @@ declare class JavascriptParser extends ParserClass {
7597
7869
  hookMap: HookMap<SyncBailHook<T, R>>,
7598
7870
  info: ExportedVariableInfo,
7599
7871
  fallback: undefined | ((name: string) => undefined | R),
7600
- defined: undefined | ((result?: string) => any),
7872
+ defined: undefined | ((result?: string) => undefined | R),
7601
7873
  ...args: AsArray<T>
7602
7874
  ): undefined | R;
7603
7875
  callHooksForNameWithFallback<T, R>(
@@ -7637,9 +7909,9 @@ declare class JavascriptParser extends ParserClass {
7637
7909
  inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
7638
7910
  detectMode(
7639
7911
  statements: (
7640
- | ImportDeclarationJavascriptParser
7641
- | ExportNamedDeclarationJavascriptParser
7642
- | ExportAllDeclarationJavascriptParser
7912
+ | ImportDeclaration
7913
+ | ExportNamedDeclaration
7914
+ | ExportAllDeclaration
7643
7915
  | FunctionDeclaration
7644
7916
  | VariableDeclaration
7645
7917
  | ClassDeclaration
@@ -7785,16 +8057,32 @@ declare class JavascriptParser extends ParserClass {
7785
8057
  | MaybeNamedClassDeclaration,
7786
8058
  commentsStartPos: number
7787
8059
  ): boolean;
7788
- getComments(range: [number, number]): Comment[];
8060
+ getComments(range: [number, number]): CommentImport[];
7789
8061
  isAsiPosition(pos: number): boolean;
7790
8062
  setAsiPosition(pos: number): void;
7791
8063
  unsetAsiPosition(pos: number): void;
7792
8064
  isStatementLevelExpression(expr: Expression): boolean;
7793
- getTagData(name: string, tag: symbol): undefined | TagData;
8065
+ getTagData(
8066
+ name: string,
8067
+ tag: symbol
8068
+ ):
8069
+ | undefined
8070
+ | Record<string, any>
8071
+ | TopLevelSymbol
8072
+ | HarmonySettings
8073
+ | ImportSettings
8074
+ | CommonJsImportSettings
8075
+ | CompatibilitySettings;
7794
8076
  tagVariable(
7795
8077
  name: string,
7796
8078
  tag: symbol,
7797
- data?: TagData,
8079
+ data?:
8080
+ | Record<string, any>
8081
+ | TopLevelSymbol
8082
+ | HarmonySettings
8083
+ | ImportSettings
8084
+ | CommonJsImportSettings
8085
+ | CompatibilitySettings,
7798
8086
  flags?: 0 | 1 | 2 | 4
7799
8087
  ): void;
7800
8088
  defineVariable(name: string): void;
@@ -7805,7 +8093,7 @@ declare class JavascriptParser extends ParserClass {
7805
8093
  evaluatedVariable(tagInfo: TagInfo): VariableInfo;
7806
8094
  parseCommentOptions(range: [number, number]): {
7807
8095
  options: null | Record<string, any>;
7808
- errors: null | (Error & { comment: Comment })[];
8096
+ errors: null | (Error & { comment: CommentImport })[];
7809
8097
  };
7810
8098
  extractMemberExpressionChain(
7811
8099
  expression:
@@ -7933,9 +8221,9 @@ declare class JavascriptParser extends ParserClass {
7933
8221
  }>;
7934
8222
  static getImportAttributes: (
7935
8223
  node:
7936
- | ImportDeclarationJavascriptParser
7937
- | ExportNamedDeclarationJavascriptParser
7938
- | ExportAllDeclarationJavascriptParser
8224
+ | ImportDeclaration
8225
+ | ExportNamedDeclaration
8226
+ | ExportAllDeclaration
7939
8227
  | ImportExpressionJavascriptParser
7940
8228
  ) => undefined | ImportAttributes;
7941
8229
  }
@@ -7944,8 +8232,6 @@ declare class JavascriptParser extends ParserClass {
7944
8232
  * Parser options for javascript modules.
7945
8233
  */
7946
8234
  declare interface JavascriptParserOptions {
7947
- [index: string]: any;
7948
-
7949
8235
  /**
7950
8236
  * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
7951
8237
  */
@@ -8157,6 +8443,14 @@ declare abstract class JsonData {
8157
8443
  | JsonValueFs[];
8158
8444
  updateHash(hash: Hash): void;
8159
8445
  }
8446
+ declare abstract class JsonGenerator extends Generator {
8447
+ options: JsonGeneratorOptions;
8448
+ generateError(
8449
+ error: Error,
8450
+ module: NormalModule,
8451
+ generateContext: GenerateContext
8452
+ ): null | Source;
8453
+ }
8160
8454
 
8161
8455
  /**
8162
8456
  * Generator options for json modules.
@@ -8167,6 +8461,17 @@ declare interface JsonGeneratorOptions {
8167
8461
  */
8168
8462
  JSONParse?: boolean;
8169
8463
  }
8464
+ declare interface JsonModulesPluginParserOptions {
8465
+ /**
8466
+ * The depth of json dependency flagged as `exportInfo`.
8467
+ */
8468
+ exportsDepth?: number;
8469
+
8470
+ /**
8471
+ * Function that executes for a module source string and should return json-compatible data.
8472
+ */
8473
+ parse?: (input: string) => any;
8474
+ }
8170
8475
  declare interface JsonObjectFs {
8171
8476
  [index: string]:
8172
8477
  | undefined
@@ -8187,6 +8492,9 @@ declare interface JsonObjectTypes {
8187
8492
  | JsonObjectTypes
8188
8493
  | JsonValueTypes[];
8189
8494
  }
8495
+ declare abstract class JsonParser extends ParserClass {
8496
+ options: JsonModulesPluginParserOptions;
8497
+ }
8190
8498
 
8191
8499
  /**
8192
8500
  * Parser options for JSON modules.
@@ -8245,8 +8553,8 @@ declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
8245
8553
  static STAGE_TRIGGER: number;
8246
8554
  }
8247
8555
  declare interface JsonpCompilationPluginHooks {
8248
- linkPreload: SyncWaterfallHook<[string, Chunk]>;
8249
- linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
8556
+ linkPreload: SyncWaterfallHook<[string, Chunk], string>;
8557
+ linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
8250
8558
  }
8251
8559
  declare class JsonpTemplatePlugin {
8252
8560
  constructor();
@@ -8373,7 +8681,7 @@ declare interface KnownBuildInfo {
8373
8681
  /**
8374
8682
  * using in NormalModule
8375
8683
  */
8376
- valueDependencies?: Map<string, string | Set<string>>;
8684
+ valueDependencies?: Map<string, ValueCacheVersion>;
8377
8685
 
8378
8686
  /**
8379
8687
  * using in NormalModule
@@ -8444,6 +8752,7 @@ declare interface KnownBuildMeta {
8444
8752
  exportsType?: "namespace" | "dynamic" | "default" | "flagged";
8445
8753
  defaultObject?: false | "redirect" | "redirect-warn";
8446
8754
  strictHarmonyModule?: boolean;
8755
+ treatAsCommonJs?: boolean;
8447
8756
  async?: boolean;
8448
8757
  sideEffectFree?: boolean;
8449
8758
  isCSSModule?: boolean;
@@ -8486,6 +8795,10 @@ declare interface KnownHooks {
8486
8795
  */
8487
8796
  result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
8488
8797
  }
8798
+ declare interface KnownMeta {
8799
+ importVarMap?: Map<Module, string>;
8800
+ deferredImportVarMap?: Map<Module, string>;
8801
+ }
8489
8802
  declare interface KnownNormalizedStatsOptions {
8490
8803
  context: string;
8491
8804
  requestShortener: RequestShortener;
@@ -8525,7 +8838,7 @@ declare interface KnownNormalizedStatsOptions {
8525
8838
  modulesSpace: number;
8526
8839
  chunkModulesSpace: number;
8527
8840
  nestedModulesSpace: number;
8528
- logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
8841
+ logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
8529
8842
  loggingDebug: ((value: string) => boolean)[];
8530
8843
  loggingTrace: boolean;
8531
8844
  }
@@ -8575,24 +8888,24 @@ declare interface KnownStatsChunk {
8575
8888
  hash: string;
8576
8889
  childrenByOrder: Record<string, ChunkId[]>;
8577
8890
  id?: string | number;
8578
- siblings?: (string | number)[];
8579
- parents?: (string | number)[];
8580
- children?: (string | number)[];
8891
+ siblings?: ChunkId[];
8892
+ parents?: ChunkId[];
8893
+ children?: ChunkId[];
8581
8894
  modules?: StatsModule[];
8582
8895
  filteredModules?: number;
8583
8896
  origins?: StatsChunkOrigin[];
8584
8897
  }
8585
8898
  declare interface KnownStatsChunkGroup {
8586
8899
  name?: null | string;
8587
- chunks?: (string | number)[];
8900
+ chunks?: ChunkId[];
8588
8901
  assets?: { name: string; size?: number }[];
8589
8902
  filteredAssets?: number;
8590
8903
  assetsSize?: number;
8591
8904
  auxiliaryAssets?: { name: string; size?: number }[];
8592
8905
  filteredAuxiliaryAssets?: number;
8593
8906
  auxiliaryAssetsSize?: number;
8594
- children?: { [index: string]: StatsChunkGroup[] };
8595
- childAssets?: { [index: string]: string[] };
8907
+ children?: Record<string, StatsChunkGroup[]>;
8908
+ childAssets?: Record<string, string[]>;
8596
8909
  isOverSizeLimit?: boolean;
8597
8910
  }
8598
8911
  declare interface KnownStatsChunkOrigin {
@@ -8650,14 +8963,14 @@ declare interface KnownStatsError {
8650
8963
  }
8651
8964
  declare interface KnownStatsFactoryContext {
8652
8965
  type: string;
8653
- makePathsRelative: (path: string) => string;
8654
8966
  compilation: Compilation;
8967
+ makePathsRelative: (path: string) => string;
8655
8968
  rootModules: Set<Module>;
8656
8969
  compilationFileToChunks: Map<string, Chunk[]>;
8657
8970
  compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
8658
8971
  runtime: RuntimeSpec;
8659
- cachedGetErrors: (compilation: Compilation) => WebpackError[];
8660
- cachedGetWarnings: (compilation: Compilation) => WebpackError[];
8972
+ cachedGetErrors: (compilation: Compilation) => Error[];
8973
+ cachedGetWarnings: (compilation: Compilation) => Error[];
8661
8974
  }
8662
8975
  declare interface KnownStatsLogging {
8663
8976
  entries: StatsLoggingEntry[];
@@ -8684,7 +8997,7 @@ declare interface KnownStatsModule {
8684
8997
  index2?: number;
8685
8998
  postOrderIndex?: number;
8686
8999
  size?: number;
8687
- sizes?: { [index: string]: number };
9000
+ sizes?: Record<string, number>;
8688
9001
  cacheable?: boolean;
8689
9002
  built?: boolean;
8690
9003
  codeGenerated?: boolean;
@@ -8694,8 +9007,8 @@ declare interface KnownStatsModule {
8694
9007
  orphan?: boolean;
8695
9008
  id?: string | number;
8696
9009
  issuerId?: null | string | number;
8697
- chunks?: (string | number)[];
8698
- assets?: (string | number)[];
9010
+ chunks?: ChunkId[];
9011
+ assets?: string[];
8699
9012
  dependent?: boolean;
8700
9013
  issuer?: null | string;
8701
9014
  issuerName?: null | string;
@@ -8890,7 +9203,10 @@ declare interface LazyCompilationDefaultBackendOptions {
8890
9203
  /**
8891
9204
  * Specifies where to listen to from the server.
8892
9205
  */
8893
- listen?: number | ListenOptions | ((server: Server) => void);
9206
+ listen?:
9207
+ | number
9208
+ | ListenOptions
9209
+ | ((server: ServerLazyCompilationBackend) => void);
8894
9210
 
8895
9211
  /**
8896
9212
  * Specifies the protocol the client should use to connect to the server.
@@ -8903,7 +9219,7 @@ declare interface LazyCompilationDefaultBackendOptions {
8903
9219
  server?:
8904
9220
  | ServerOptions<typeof IncomingMessage>
8905
9221
  | HttpsServerOptions
8906
- | (() => Server);
9222
+ | (() => ServerLazyCompilationBackend);
8907
9223
  }
8908
9224
 
8909
9225
  /**
@@ -8916,7 +9232,7 @@ declare interface LazyCompilationOptions {
8916
9232
  backend?:
8917
9233
  | ((
8918
9234
  compiler: Compiler,
8919
- callback: (err: null | Error, api?: BackendApi) => void
9235
+ callback: (err: null | Error, backendApi?: BackendApi) => void
8920
9236
  ) => void)
8921
9237
  | ((compiler: Compiler) => Promise<BackendApi>)
8922
9238
  | LazyCompilationDefaultBackendOptions;
@@ -9149,9 +9465,8 @@ declare interface LimitChunkCountPluginOptions {
9149
9465
  */
9150
9466
  maxChunks: number;
9151
9467
  }
9152
- type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
9153
9468
  declare interface LoadScriptCompilationHooks {
9154
- createScript: SyncWaterfallHook<[string, Chunk]>;
9469
+ createScript: SyncWaterfallHook<[string, Chunk], string>;
9155
9470
  }
9156
9471
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
9157
9472
  constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
@@ -9191,7 +9506,7 @@ type LoaderContextDeclarationsIndex<OptionsType> =
9191
9506
  LoaderRunnerLoaderContext<OptionsType> &
9192
9507
  LoaderPluginLoaderContext &
9193
9508
  HotModuleReplacementPluginLoaderContext;
9194
- type LoaderContextObject<T> = NormalModuleLoaderContext<T> &
9509
+ type LoaderContextVirtualUrlPlugin<T> = NormalModuleLoaderContext<T> &
9195
9510
  LoaderRunnerLoaderContext<T> &
9196
9511
  LoaderPluginLoaderContext &
9197
9512
  HotModuleReplacementPluginLoaderContext;
@@ -9220,8 +9535,8 @@ declare interface LoaderDefinitionFunction<
9220
9535
  declare interface LoaderItem {
9221
9536
  loader: string;
9222
9537
  options?: null | string | Record<string, any>;
9223
- ident: null | string;
9224
- type: null | string;
9538
+ ident?: null | string;
9539
+ type?: null | string;
9225
9540
  }
9226
9541
  declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
9227
9542
  default?:
@@ -9286,7 +9601,7 @@ declare interface LoaderPluginLoaderContext {
9286
9601
  importModule(
9287
9602
  request: string,
9288
9603
  options: undefined | ImportModuleOptions,
9289
- callback: (err?: null | Error, exports?: any) => any
9604
+ callback: (err?: null | Error, exports?: any) => void
9290
9605
  ): void;
9291
9606
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
9292
9607
  }
@@ -9455,8 +9770,8 @@ type LogTypeEnum =
9455
9770
  | "warn"
9456
9771
  | "info"
9457
9772
  | "log"
9458
- | "debug"
9459
9773
  | "profile"
9774
+ | "debug"
9460
9775
  | "trace"
9461
9776
  | "group"
9462
9777
  | "groupCollapsed"
@@ -9588,14 +9903,15 @@ declare abstract class MainTemplate {
9588
9903
  globalHash: { tap: () => void };
9589
9904
  hotBootstrap: { tap: () => never };
9590
9905
  bootstrap: SyncWaterfallHook<
9591
- [string, Chunk, string, ModuleTemplate, DependencyTemplates]
9906
+ [string, Chunk, string, ModuleTemplate, DependencyTemplates],
9907
+ string
9592
9908
  >;
9593
- localVars: SyncWaterfallHook<[string, Chunk, string]>;
9594
- requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
9595
- requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
9596
- get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
9597
- get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
9598
- get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
9909
+ localVars: SyncWaterfallHook<[string, Chunk, string], string>;
9910
+ requireExtensions: SyncWaterfallHook<[string, Chunk, string], string>;
9911
+ requireEnsure: SyncWaterfallHook<[string, Chunk, string, string], string>;
9912
+ get jsonpScript(): SyncWaterfallHook<[string, Chunk], string>;
9913
+ get linkPrefetch(): SyncWaterfallHook<[string, Chunk], string>;
9914
+ get linkPreload(): SyncWaterfallHook<[string, Chunk], string>;
9599
9915
  }>;
9600
9916
  renderCurrentHashCode: (hash: string, length?: number) => string;
9601
9917
  getPublicPath: (options: PathData) => string;
@@ -9623,11 +9939,40 @@ declare interface MapOptions {
9623
9939
  module?: boolean;
9624
9940
  }
9625
9941
  declare interface MatchObject {
9626
- test?: string | RegExp | (string | RegExp)[];
9627
- include?: string | RegExp | (string | RegExp)[];
9628
- exclude?: string | RegExp | (string | RegExp)[];
9942
+ test?:
9943
+ | string
9944
+ | RegExp
9945
+ | ((str: string) => boolean)
9946
+ | (string | RegExp | ((str: string) => boolean))[];
9947
+ include?:
9948
+ | string
9949
+ | RegExp
9950
+ | ((str: string) => boolean)
9951
+ | (string | RegExp | ((str: string) => boolean))[];
9952
+ exclude?:
9953
+ | string
9954
+ | RegExp
9955
+ | ((str: string) => boolean)
9956
+ | (string | RegExp | ((str: string) => boolean))[];
9957
+ }
9958
+ type Matcher =
9959
+ | string
9960
+ | RegExp
9961
+ | ((str: string) => boolean)
9962
+ | (string | RegExp | ((str: string) => boolean))[];
9963
+ declare interface MaybeMergeableInitFragment<GenerateContext> {
9964
+ key?: string;
9965
+ stage: number;
9966
+ position: number;
9967
+ getContent: (context: GenerateContext) => undefined | string | Source;
9968
+ getEndContent: (context: GenerateContext) => undefined | string | Source;
9969
+ merge?: (
9970
+ fragments: MaybeMergeableInitFragment<GenerateContext>
9971
+ ) => MaybeMergeableInitFragment<GenerateContext>;
9972
+ mergeAll?: (
9973
+ fragments: MaybeMergeableInitFragment<GenerateContext>[]
9974
+ ) => MaybeMergeableInitFragment<GenerateContext>[];
9629
9975
  }
9630
- type Matcher = string | RegExp | (string | RegExp)[];
9631
9976
  type Media = undefined | string;
9632
9977
 
9633
9978
  /**
@@ -9668,6 +10013,14 @@ declare interface MergeDuplicateChunksPluginOptions {
9668
10013
  */
9669
10014
  stage?: number;
9670
10015
  }
10016
+ type Meta = KnownMeta &
10017
+ Record<
10018
+ | typeof idsSymbolCommonJsExportRequireDependency
10019
+ | typeof idsSymbolHarmonyImportSpecifierDependency
10020
+ | typeof idsSymbolHarmonyExportImportedSpecifierDependency,
10021
+ string[]
10022
+ > &
10023
+ Record<string, any>;
9671
10024
  declare class MinChunkSizePlugin {
9672
10025
  constructor(options: MinChunkSizePluginOptions);
9673
10026
  options: MinChunkSizePluginOptions;
@@ -9820,7 +10173,7 @@ declare class Module extends DependenciesBlock {
9820
10173
  identifier(): string;
9821
10174
  readableIdentifier(requestShortener: RequestShortener): string;
9822
10175
  build(
9823
- options: WebpackOptionsNormalized,
10176
+ options: WebpackOptionsNormalizedWithDefaults,
9824
10177
  compilation: Compilation,
9825
10178
  resolver: ResolverWithOptions,
9826
10179
  fs: InputFileSystem,
@@ -9911,8 +10264,7 @@ declare class ModuleDependency extends Dependency {
9911
10264
  constructor(request: string);
9912
10265
  request: string;
9913
10266
  userRequest: string;
9914
- range: any;
9915
- assertions?: ImportAttributes;
10267
+ range?: [number, number];
9916
10268
  static Template: typeof DependencyTemplate;
9917
10269
  static NO_EXPORTS_REFERENCED: string[][];
9918
10270
  static EXPORTS_OBJECT_REFERENCED: string[][];
@@ -9926,10 +10278,14 @@ declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
9926
10278
  dependencyMeta?: ImportDependencyMeta,
9927
10279
  hashFunction?: string | typeof Hash
9928
10280
  );
10281
+ getImported(): Imported;
10282
+ setImported(imported: Imported): void;
9929
10283
  getNamespaceIdentifier(): string;
9930
- static addToSource<Context, T>(
10284
+ buildIdentifier(ident: string): string;
10285
+ buildImported(imported: Imported): Imported;
10286
+ static addToSource<Context>(
9931
10287
  source: Source,
9932
- initFragments: InitFragment<T>[],
10288
+ initFragments: MaybeMergeableInitFragment<Context>[],
9933
10289
  context: Context
9934
10290
  ): Source;
9935
10291
  static STAGE_CONSTANTS: number;
@@ -9955,7 +10311,7 @@ declare interface ModuleFactoryCreateData {
9955
10311
  }
9956
10312
  declare interface ModuleFactoryCreateDataContextInfo {
9957
10313
  issuer: string;
9958
- issuerLayer?: null | string;
10314
+ issuerLayer: IssuerLayer;
9959
10315
  compiler?: string;
9960
10316
  }
9961
10317
  declare interface ModuleFactoryResult {
@@ -10055,6 +10411,62 @@ declare interface ModuleFederationPluginOptions {
10055
10411
  */
10056
10412
  shared?: (string | SharedObject)[] | SharedObject;
10057
10413
  }
10414
+ declare interface ModuleFilenameTemplateContext {
10415
+ /**
10416
+ * the identifier of the module
10417
+ */
10418
+ identifier: string;
10419
+
10420
+ /**
10421
+ * the shortened identifier of the module
10422
+ */
10423
+ shortIdentifier: string;
10424
+
10425
+ /**
10426
+ * the resource of the module request
10427
+ */
10428
+ resource: string;
10429
+
10430
+ /**
10431
+ * the resource path of the module request
10432
+ */
10433
+ resourcePath: string;
10434
+
10435
+ /**
10436
+ * the absolute resource path of the module request
10437
+ */
10438
+ absoluteResourcePath: string;
10439
+
10440
+ /**
10441
+ * the loaders of the module request
10442
+ */
10443
+ loaders: string;
10444
+
10445
+ /**
10446
+ * the all loaders of the module request
10447
+ */
10448
+ allLoaders: string;
10449
+
10450
+ /**
10451
+ * the query of the module identifier
10452
+ */
10453
+ query: string;
10454
+
10455
+ /**
10456
+ * the module id of the module
10457
+ */
10458
+ moduleId: string;
10459
+
10460
+ /**
10461
+ * the hash of the module identifier
10462
+ */
10463
+ hash: string;
10464
+
10465
+ /**
10466
+ * the module namespace
10467
+ */
10468
+ namespace: string;
10469
+ }
10058
10470
  type ModuleFilterItemTypes =
10059
10471
  | string
10060
10472
  | RegExp
@@ -10111,13 +10523,18 @@ declare class ModuleGraph {
10111
10523
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
10112
10524
  getIncomingConnectionsByOriginModule(
10113
10525
  module: Module
10114
- ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
10526
+ ): ReadonlyMap<
10527
+ undefined | null | Module,
10528
+ ReadonlyArray<ModuleGraphConnection>
10529
+ >;
10115
10530
  getOutgoingConnectionsByModule(
10116
10531
  module: Module
10117
- ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10532
+ ):
10533
+ | undefined
10534
+ | ReadonlyMap<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10118
10535
  getProfile(module: Module): undefined | ModuleProfile;
10119
10536
  setProfile(module: Module, profile?: ModuleProfile): void;
10120
- getIssuer(module: Module): undefined | null | Module;
10537
+ getIssuer(module: Module): Issuer;
10121
10538
  setIssuer(module: Module, issuer: null | Module): void;
10122
10539
  setIssuerIfUnset(module: Module, issuer: null | Module): void;
10123
10540
  getOptimizationBailout(
@@ -10147,13 +10564,13 @@ declare class ModuleGraph {
10147
10564
  isAsync(module: Module): boolean;
10148
10565
  isDeferred(module: Module): boolean;
10149
10566
  setAsync(module: Module): void;
10150
- getMeta(thing: object): any;
10151
- getMetaIfExisting(thing: object): any;
10567
+ getMeta(thing: object): Meta;
10568
+ getMetaIfExisting(thing: object): undefined | Meta;
10152
10569
  freeze(cacheStage?: string): void;
10153
10570
  unfreeze(): void;
10154
- cached<T, R>(
10155
- fn: (moduleGraph: ModuleGraph, ...args: T[]) => R,
10156
- ...args: T[]
10571
+ cached<T extends any[], R>(
10572
+ fn: (moduleGraph: ModuleGraph, ...args: T) => R,
10573
+ ...args: T
10157
10574
  ): R;
10158
10575
  setModuleMemCaches(
10159
10576
  moduleMemCaches: Map<Module, WeakTupleMap<any[], any>>
@@ -10515,6 +10932,11 @@ declare interface ModuleSettings {
10515
10932
  */
10516
10933
  type?: string;
10517
10934
 
10935
+ /**
10936
+ * Enable/Disable extracting source map.
10937
+ */
10938
+ extractSourceMap?: boolean;
10939
+
10518
10940
  /**
10519
10941
  * Options for the resolver.
10520
10942
  */
@@ -10630,19 +11052,24 @@ declare class MultiCompiler {
10630
11052
  intermediateFileSystem: IntermediateFileSystem;
10631
11053
  getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
10632
11054
  setDependencies(compiler: Compiler, dependencies: string[]): void;
10633
- validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
11055
+ validateDependencies(
11056
+ callback: CallbackWebpackFunction_2<MultiStats, void>
11057
+ ): boolean;
10634
11058
  runWithDependencies(
10635
11059
  compilers: Compiler[],
10636
- fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
10637
- callback: CallbackFunction_1<Stats[]>
11060
+ fn: (
11061
+ compiler: Compiler,
11062
+ callback: CallbackWebpackFunction_2<MultiStats, void>
11063
+ ) => void,
11064
+ callback: CallbackWebpackFunction_2<Stats[], void>
10638
11065
  ): void;
10639
11066
  watch(
10640
11067
  watchOptions: WatchOptions | WatchOptions[],
10641
- handler: CallbackFunction_1<MultiStats>
10642
- ): MultiWatching;
10643
- run(callback: CallbackFunction_1<MultiStats>): void;
11068
+ handler: CallbackWebpackFunction_2<MultiStats, void>
11069
+ ): undefined | MultiWatching;
11070
+ run(callback: CallbackWebpackFunction_2<MultiStats, void>): void;
10644
11071
  purgeInputFileSystem(): void;
10645
- close(callback: CallbackFunction_1<void>): void;
11072
+ close(callback: (err: null | Error, result?: void) => void): void;
10646
11073
  }
10647
11074
  declare interface MultiCompilerOptions {
10648
11075
  /**
@@ -10650,7 +11077,8 @@ declare interface MultiCompilerOptions {
10650
11077
  */
10651
11078
  parallelism?: number;
10652
11079
  }
10653
- type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
11080
+ type MultiConfiguration = ReadonlyArray<WebpackOptionsNormalized> &
11081
+ MultiCompilerOptions;
10654
11082
  declare abstract class MultiStats {
10655
11083
  stats: Stats[];
10656
11084
  get hash(): string;
@@ -10665,10 +11093,10 @@ type MultiStatsOptions = Omit<StatsOptions, "children"> & {
10665
11093
  declare abstract class MultiWatching {
10666
11094
  watchings: Watching[];
10667
11095
  compiler: MultiCompiler;
10668
- invalidate(callback?: CallbackFunction_2<void>): void;
11096
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
10669
11097
  suspend(): void;
10670
11098
  resume(): void;
10671
- close(callback: CallbackFunction_2<void>): void;
11099
+ close(callback: (err: null | Error, result?: void) => void): void;
10672
11100
  }
10673
11101
  declare class NamedChunkIdsPlugin {
10674
11102
  constructor(options?: NamedChunkIdsPluginOptions);
@@ -10717,7 +11145,7 @@ declare class NaturalModuleIdsPlugin {
10717
11145
  declare interface NeedBuildContext {
10718
11146
  compilation: Compilation;
10719
11147
  fileSystemInfo: FileSystemInfo;
10720
- valueCacheVersions: Map<string, string | Set<string>>;
11148
+ valueCacheVersions: Map<string, ValueCacheVersion>;
10721
11149
  }
10722
11150
  declare interface NewContentCreateContextMap {
10723
11151
  [index: string]: string;
@@ -10801,6 +11229,7 @@ declare interface NodeTemplatePluginOptions {
10801
11229
  */
10802
11230
  asyncChunkLoading?: boolean;
10803
11231
  }
11232
+ type NonNullable<T> = T & {};
10804
11233
  declare class NormalModule extends Module {
10805
11234
  constructor(__0: NormalModuleCreateData);
10806
11235
  request: string;
@@ -10815,7 +11244,9 @@ declare class NormalModule extends Module {
10815
11244
  resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
10816
11245
  matchResource?: string;
10817
11246
  loaders: LoaderItem[];
11247
+ extractSourceMap?: boolean;
10818
11248
  error: null | WebpackError;
11249
+ getResource(): null | string;
10819
11250
 
10820
11251
  /**
10821
11252
  * restore unsafe cache data
@@ -10832,7 +11263,7 @@ declare class NormalModule extends Module {
10832
11263
  associatedObjectForCache?: object
10833
11264
  ): Source;
10834
11265
  getCurrentLoader(
10835
- loaderContext: LoaderContextObject<any>,
11266
+ loaderContext: AnyLoaderContext,
10836
11267
  index?: number
10837
11268
  ): null | LoaderItem;
10838
11269
  createSource(
@@ -10858,10 +11289,8 @@ declare class NormalModule extends Module {
10858
11289
  static deserialize(context: ObjectDeserializerContext): NormalModule;
10859
11290
  }
10860
11291
  declare interface NormalModuleCompilationHooks {
10861
- loader: SyncHook<[LoaderContextObject<any>, NormalModule]>;
10862
- beforeLoaders: SyncHook<
10863
- [LoaderItem[], NormalModule, LoaderContextObject<any>]
10864
- >;
11292
+ loader: SyncHook<[AnyLoaderContext, NormalModule]>;
11293
+ beforeLoaders: SyncHook<[LoaderItem[], NormalModule, AnyLoaderContext]>;
10865
11294
  beforeParse: SyncHook<[NormalModule]>;
10866
11295
  beforeSnapshot: SyncHook<[NormalModule]>;
10867
11296
  readResourceForScheme: HookMap<
@@ -10870,7 +11299,7 @@ declare interface NormalModuleCompilationHooks {
10870
11299
  >
10871
11300
  >;
10872
11301
  readResource: HookMap<
10873
- AsyncSeriesBailHook<[LoaderContextObject<any>], null | string | Buffer>
11302
+ AsyncSeriesBailHook<[AnyLoaderContext], null | string | Buffer>
10874
11303
  >;
10875
11304
  processResult: SyncWaterfallHook<
10876
11305
  [
@@ -10880,6 +11309,11 @@ declare interface NormalModuleCompilationHooks {
10880
11309
  undefined | PreparsedAst
10881
11310
  ],
10882
11311
  NormalModule
11312
+ ],
11313
+ [
11314
+ string | Buffer,
11315
+ undefined | string | RawSourceMap,
11316
+ undefined | PreparsedAst
10883
11317
  ]
10884
11318
  >;
10885
11319
  needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
@@ -10959,6 +11393,11 @@ declare interface NormalModuleCreateData {
10959
11393
  * options used for resolving requests from this module
10960
11394
  */
10961
11395
  resolveOptions?: ResolveOptions;
11396
+
11397
+ /**
11398
+ * enable/disable extracting source map
11399
+ */
11400
+ extractSourceMap?: boolean;
10962
11401
  }
10963
11402
  declare abstract class NormalModuleFactory extends ModuleFactory {
10964
11403
  hooks: Readonly<{
@@ -10984,14 +11423,228 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10984
11423
  Module,
10985
11424
  Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
10986
11425
  ResolveData
10987
- ]
11426
+ ],
11427
+ Module
10988
11428
  >;
10989
- createParser: HookMap<SyncBailHook<[ParserOptions], void | ParserClass>>;
10990
- parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
10991
- createGenerator: HookMap<
10992
- SyncBailHook<[GeneratorOptions], void | Generator>
11429
+ createParser: TypedHookMap<
11430
+ Record<
11431
+ "javascript/auto",
11432
+ SyncBailHook<[JavascriptParserOptions], JavascriptParser>
11433
+ > &
11434
+ Record<
11435
+ "javascript/dynamic",
11436
+ SyncBailHook<[JavascriptParserOptions], JavascriptParser>
11437
+ > &
11438
+ Record<
11439
+ "javascript/esm",
11440
+ SyncBailHook<[JavascriptParserOptions], JavascriptParser>
11441
+ > &
11442
+ Record<"json", SyncBailHook<[JsonParserOptions], JsonParser>> &
11443
+ Record<"asset", SyncBailHook<[AssetParserOptions], AssetParser>> &
11444
+ Record<
11445
+ "asset/inline",
11446
+ SyncBailHook<[EmptyParserOptions], AssetParser>
11447
+ > &
11448
+ Record<
11449
+ "asset/resource",
11450
+ SyncBailHook<[EmptyParserOptions], AssetParser>
11451
+ > &
11452
+ Record<
11453
+ "asset/source",
11454
+ SyncBailHook<[EmptyParserOptions], AssetSourceParser>
11455
+ > &
11456
+ Record<
11457
+ "asset/bytes",
11458
+ SyncBailHook<[EmptyParserOptions], AssetBytesParser>
11459
+ > &
11460
+ Record<
11461
+ "webassembly/async",
11462
+ SyncBailHook<[EmptyParserOptions], AsyncWebAssemblyParser>
11463
+ > &
11464
+ Record<
11465
+ "webassembly/sync",
11466
+ SyncBailHook<[EmptyParserOptions], WebAssemblyParser>
11467
+ > &
11468
+ Record<"css", SyncBailHook<[CssParserOptions], CssParser>> &
11469
+ Record<"css/auto", SyncBailHook<[CssAutoParserOptions], CssParser>> &
11470
+ Record<
11471
+ "css/module",
11472
+ SyncBailHook<[CssModuleParserOptions], CssParser>
11473
+ > &
11474
+ Record<
11475
+ "css/global",
11476
+ SyncBailHook<[CssGlobalParserOptions], CssParser>
11477
+ > &
11478
+ Record<string, SyncBailHook<[ParserOptions], ParserClass>>
11479
+ >;
11480
+ parser: TypedHookMap<
11481
+ Record<
11482
+ "javascript/auto",
11483
+ SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
11484
+ > &
11485
+ Record<
11486
+ "javascript/dynamic",
11487
+ SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
11488
+ > &
11489
+ Record<
11490
+ "javascript/esm",
11491
+ SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
11492
+ > &
11493
+ Record<"json", SyncBailHook<[JsonParser, JsonParserOptions], void>> &
11494
+ Record<"asset", SyncBailHook<[AssetParser, AssetParserOptions], void>> &
11495
+ Record<
11496
+ "asset/inline",
11497
+ SyncBailHook<[AssetParser, EmptyParserOptions], void>
11498
+ > &
11499
+ Record<
11500
+ "asset/resource",
11501
+ SyncBailHook<[AssetParser, EmptyParserOptions], void>
11502
+ > &
11503
+ Record<
11504
+ "asset/source",
11505
+ SyncBailHook<[AssetSourceParser, EmptyParserOptions], void>
11506
+ > &
11507
+ Record<
11508
+ "asset/bytes",
11509
+ SyncBailHook<[AssetBytesParser, EmptyParserOptions], void>
11510
+ > &
11511
+ Record<
11512
+ "webassembly/async",
11513
+ SyncBailHook<[AsyncWebAssemblyParser, EmptyParserOptions], void>
11514
+ > &
11515
+ Record<
11516
+ "webassembly/sync",
11517
+ SyncBailHook<[WebAssemblyParser, EmptyParserOptions], void>
11518
+ > &
11519
+ Record<"css", SyncBailHook<[CssParser, CssParserOptions], void>> &
11520
+ Record<
11521
+ "css/auto",
11522
+ SyncBailHook<[CssParser, CssAutoParserOptions], void>
11523
+ > &
11524
+ Record<
11525
+ "css/module",
11526
+ SyncBailHook<[CssParser, CssModuleParserOptions], void>
11527
+ > &
11528
+ Record<
11529
+ "css/global",
11530
+ SyncBailHook<[CssParser, CssGlobalParserOptions], void>
11531
+ > &
11532
+ Record<string, SyncBailHook<[ParserClass, ParserOptions], void>>
11533
+ >;
11534
+ createGenerator: TypedHookMap<
11535
+ Record<
11536
+ "javascript/auto",
11537
+ SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
11538
+ > &
11539
+ Record<
11540
+ "javascript/dynamic",
11541
+ SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
11542
+ > &
11543
+ Record<
11544
+ "javascript/esm",
11545
+ SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
11546
+ > &
11547
+ Record<"json", SyncBailHook<[JsonGeneratorOptions], JsonGenerator>> &
11548
+ Record<"asset", SyncBailHook<[AssetGeneratorOptions], AssetGenerator>> &
11549
+ Record<
11550
+ "asset/inline",
11551
+ SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
11552
+ > &
11553
+ Record<
11554
+ "asset/resource",
11555
+ SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
11556
+ > &
11557
+ Record<
11558
+ "asset/source",
11559
+ SyncBailHook<[EmptyGeneratorOptions], AssetSourceGenerator>
11560
+ > &
11561
+ Record<
11562
+ "asset/bytes",
11563
+ SyncBailHook<[EmptyGeneratorOptions], AssetBytesGenerator>
11564
+ > &
11565
+ Record<
11566
+ "webassembly/async",
11567
+ SyncBailHook<[EmptyParserOptions], Generator>
11568
+ > &
11569
+ Record<
11570
+ "webassembly/sync",
11571
+ SyncBailHook<[EmptyParserOptions], Generator>
11572
+ > &
11573
+ Record<"css", SyncBailHook<[CssGeneratorOptions], CssGenerator>> &
11574
+ Record<
11575
+ "css/auto",
11576
+ SyncBailHook<[CssAutoGeneratorOptions], CssGenerator>
11577
+ > &
11578
+ Record<
11579
+ "css/module",
11580
+ SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
11581
+ > &
11582
+ Record<
11583
+ "css/global",
11584
+ SyncBailHook<[CssGlobalGeneratorOptions], CssGenerator>
11585
+ > &
11586
+ Record<string, SyncBailHook<[GeneratorOptions], Generator>>
11587
+ >;
11588
+ generator: TypedHookMap<
11589
+ Record<
11590
+ "javascript/auto",
11591
+ SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
11592
+ > &
11593
+ Record<
11594
+ "javascript/dynamic",
11595
+ SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
11596
+ > &
11597
+ Record<
11598
+ "javascript/esm",
11599
+ SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
11600
+ > &
11601
+ Record<
11602
+ "json",
11603
+ SyncBailHook<[JsonGenerator, JsonGeneratorOptions], void>
11604
+ > &
11605
+ Record<
11606
+ "asset",
11607
+ SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
11608
+ > &
11609
+ Record<
11610
+ "asset/inline",
11611
+ SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
11612
+ > &
11613
+ Record<
11614
+ "asset/resource",
11615
+ SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
11616
+ > &
11617
+ Record<
11618
+ "asset/source",
11619
+ SyncBailHook<[AssetSourceGenerator, EmptyGeneratorOptions], void>
11620
+ > &
11621
+ Record<
11622
+ "asset/bytes",
11623
+ SyncBailHook<[AssetBytesGenerator, EmptyGeneratorOptions], void>
11624
+ > &
11625
+ Record<
11626
+ "webassembly/async",
11627
+ SyncBailHook<[Generator, EmptyParserOptions], void>
11628
+ > &
11629
+ Record<
11630
+ "webassembly/sync",
11631
+ SyncBailHook<[Generator, EmptyParserOptions], void>
11632
+ > &
11633
+ Record<"css", SyncBailHook<[CssGenerator, CssGeneratorOptions], void>> &
11634
+ Record<
11635
+ "css/auto",
11636
+ SyncBailHook<[CssGenerator, CssAutoGeneratorOptions], void>
11637
+ > &
11638
+ Record<
11639
+ "css/module",
11640
+ SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
11641
+ > &
11642
+ Record<
11643
+ "css/global",
11644
+ SyncBailHook<[CssGenerator, CssGlobalGeneratorOptions], void>
11645
+ > &
11646
+ Record<string, SyncBailHook<[Generator, GeneratorOptions], void>>
10993
11647
  >;
10994
- generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
10995
11648
  createModuleClass: HookMap<
10996
11649
  SyncBailHook<
10997
11650
  [
@@ -11027,7 +11680,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11027
11680
  array: LoaderItem[],
11028
11681
  resolver: ResolverWithOptions,
11029
11682
  resolveContext: ResolveContext,
11030
- callback: CallbackNormalModuleFactory<LoaderItem[]>
11683
+ callback: CallbackWebpackFunction_1<LoaderItem[]>
11031
11684
  ): void;
11032
11685
  getParser(type: string, parserOptions?: ParserOptions): ParserClass;
11033
11686
  createParser(type: string, parserOptions?: ParserOptions): ParserClass;
@@ -11057,7 +11710,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11057
11710
  res?: string | false,
11058
11711
  req?: ResolveRequest
11059
11712
  ) => void
11060
- ): any;
11713
+ ): void;
11061
11714
  getResolve(options?: ResolveOptionsWithDependencyType): {
11062
11715
  (
11063
11716
  context: string,
@@ -11088,9 +11741,9 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11088
11741
  mode: "none" | "development" | "production";
11089
11742
  webpack?: boolean;
11090
11743
  hashFunction: HashFunction;
11091
- hashDigest: string;
11744
+ hashDigest: HashDigest;
11092
11745
  hashDigestLength: number;
11093
- hashSalt: string;
11746
+ hashSalt?: string;
11094
11747
  _module?: NormalModule;
11095
11748
  _compilation?: Compilation;
11096
11749
  _compiler?: Compiler;
@@ -11174,21 +11827,18 @@ declare interface ObjectDeserializerContext {
11174
11827
  declare interface ObjectEncodingOptions {
11175
11828
  encoding?:
11176
11829
  | null
11177
- | "ascii"
11830
+ | "base64"
11831
+ | "base64url"
11832
+ | "hex"
11833
+ | "binary"
11178
11834
  | "utf8"
11179
11835
  | "utf-8"
11180
11836
  | "utf16le"
11181
11837
  | "utf-16le"
11182
- | "ucs2"
11183
- | "ucs-2"
11184
- | "base64"
11185
- | "base64url"
11186
11838
  | "latin1"
11187
- | "binary"
11188
- | "hex";
11189
- }
11190
- declare interface ObjectForExtract {
11191
- [index: string]: any;
11839
+ | "ascii"
11840
+ | "ucs2"
11841
+ | "ucs-2";
11192
11842
  }
11193
11843
  declare interface ObjectSerializer {
11194
11844
  serialize: (value: any, context: ObjectSerializerContext) => void;
@@ -11479,11 +12129,6 @@ declare interface OptimizationNormalized {
11479
12129
  * Minimizer(s) to use for minimizing the output.
11480
12130
  */
11481
12131
  minimizer?: (
11482
- | undefined
11483
- | null
11484
- | false
11485
- | ""
11486
- | 0
11487
12132
  | ((this: Compiler, compiler: Compiler) => void)
11488
12133
  | WebpackPluginInstance
11489
12134
  | "..."
@@ -11556,32 +12201,91 @@ declare interface OptimizationNormalized {
11556
12201
  */
11557
12202
  usedExports?: boolean | "global";
11558
12203
  }
11559
-
11560
- /**
11561
- * Options object for describing behavior of a cache group selecting modules that should be cached together.
11562
- */
11563
- declare interface OptimizationSplitChunksCacheGroup {
11564
- /**
11565
- * Sets the name delimiter for created chunks.
11566
- */
11567
- automaticNameDelimiter?: string;
11568
-
11569
- /**
11570
- * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
11571
- */
11572
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
11573
-
11574
- /**
11575
- * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
11576
- */
11577
- enforce?: boolean;
11578
-
11579
- /**
11580
- * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
11581
- */
11582
- enforceSizeThreshold?: number | { [index: string]: number };
11583
-
11584
- /**
12204
+ type OptimizationNormalizedWithDefaults = OptimizationNormalized & {
12205
+ runtimeChunk: NonNullable<
12206
+ | undefined
12207
+ | false
12208
+ | {
12209
+ /**
12210
+ * The name factory for the runtime chunks.
12211
+ */
12212
+ name?: (entrypoint: { name: string }) => string;
12213
+ }
12214
+ >;
12215
+ splitChunks: NonNullable<undefined | false | OptimizationSplitChunksOptions>;
12216
+ mergeDuplicateChunks: NonNullable<undefined | boolean>;
12217
+ removeAvailableModules: NonNullable<undefined | boolean>;
12218
+ removeEmptyChunks: NonNullable<undefined | boolean>;
12219
+ flagIncludedChunks: NonNullable<undefined | boolean>;
12220
+ moduleIds: NonNullable<
12221
+ | undefined
12222
+ | false
12223
+ | "natural"
12224
+ | "named"
12225
+ | "deterministic"
12226
+ | "size"
12227
+ | "hashed"
12228
+ >;
12229
+ chunkIds: NonNullable<
12230
+ | undefined
12231
+ | false
12232
+ | "natural"
12233
+ | "named"
12234
+ | "deterministic"
12235
+ | "size"
12236
+ | "total-size"
12237
+ >;
12238
+ sideEffects: NonNullable<undefined | boolean | "flag">;
12239
+ providedExports: NonNullable<undefined | boolean>;
12240
+ usedExports: NonNullable<undefined | boolean | "global">;
12241
+ mangleExports: NonNullable<undefined | boolean | "deterministic" | "size">;
12242
+ innerGraph: NonNullable<undefined | boolean>;
12243
+ concatenateModules: NonNullable<undefined | boolean>;
12244
+ avoidEntryIife: NonNullable<undefined | boolean>;
12245
+ emitOnErrors: NonNullable<undefined | boolean>;
12246
+ checkWasmTypes: NonNullable<undefined | boolean>;
12247
+ mangleWasmImports: NonNullable<undefined | boolean>;
12248
+ portableRecords: NonNullable<undefined | boolean>;
12249
+ realContentHash: NonNullable<undefined | boolean>;
12250
+ minimize: NonNullable<undefined | boolean>;
12251
+ minimizer: (
12252
+ | ((this: Compiler, compiler: Compiler) => void)
12253
+ | WebpackPluginInstance
12254
+ | "..."
12255
+ )[];
12256
+ nodeEnv: NonNullable<undefined | string | false>;
12257
+ };
12258
+
12259
+ /**
12260
+ * Options object for describing behavior of a cache group selecting modules that should be cached together.
12261
+ */
12262
+ declare interface OptimizationSplitChunksCacheGroup {
12263
+ /**
12264
+ * Sets the name delimiter for created chunks.
12265
+ */
12266
+ automaticNameDelimiter?: string;
12267
+
12268
+ /**
12269
+ * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
12270
+ */
12271
+ chunks?:
12272
+ | RegExp
12273
+ | "all"
12274
+ | "initial"
12275
+ | "async"
12276
+ | ((chunk: Chunk) => undefined | boolean);
12277
+
12278
+ /**
12279
+ * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
12280
+ */
12281
+ enforce?: boolean;
12282
+
12283
+ /**
12284
+ * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
12285
+ */
12286
+ enforceSizeThreshold?: number | { [index: string]: number };
12287
+
12288
+ /**
11585
12289
  * Sets the template for the filename for created chunks.
11586
12290
  */
11587
12291
  filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
@@ -11707,7 +12411,12 @@ declare interface OptimizationSplitChunksOptions {
11707
12411
  /**
11708
12412
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11709
12413
  */
11710
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12414
+ chunks?:
12415
+ | RegExp
12416
+ | "all"
12417
+ | "initial"
12418
+ | "async"
12419
+ | ((chunk: Chunk) => undefined | boolean);
11711
12420
 
11712
12421
  /**
11713
12422
  * Sets the size types which are used when a number is used for sizes.
@@ -11730,7 +12439,12 @@ declare interface OptimizationSplitChunksOptions {
11730
12439
  /**
11731
12440
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11732
12441
  */
11733
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12442
+ chunks?:
12443
+ | RegExp
12444
+ | "all"
12445
+ | "initial"
12446
+ | "async"
12447
+ | ((chunk: Chunk) => undefined | boolean);
11734
12448
  /**
11735
12449
  * Maximal size hint for the on-demand chunks.
11736
12450
  */
@@ -11859,9 +12573,9 @@ declare interface Options {
11859
12573
  }
11860
12574
  declare abstract class OptionsApply {
11861
12575
  process(
11862
- options: WebpackOptionsNormalized,
12576
+ options: WebpackOptionsNormalizedWithDefaults,
11863
12577
  compiler: Compiler
11864
- ): WebpackOptionsNormalized;
12578
+ ): WebpackOptionsNormalizedWithDefaults;
11865
12579
  }
11866
12580
  declare interface OriginRecord {
11867
12581
  module: null | Module;
@@ -11981,12 +12695,16 @@ declare interface Output {
11981
12695
  /**
11982
12696
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
11983
12697
  */
11984
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
12698
+ devtoolFallbackModuleFilenameTemplate?:
12699
+ | string
12700
+ | ((context: ModuleFilenameTemplateContext) => string);
11985
12701
 
11986
12702
  /**
11987
12703
  * Filename template string of function for the sources array in a generated SourceMap.
11988
12704
  */
11989
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
12705
+ devtoolModuleFilenameTemplate?:
12706
+ | string
12707
+ | ((context: ModuleFilenameTemplateContext) => string);
11990
12708
 
11991
12709
  /**
11992
12710
  * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
@@ -12024,9 +12742,21 @@ declare interface Output {
12024
12742
  globalObject?: string;
12025
12743
 
12026
12744
  /**
12027
- * Digest type used for the hash.
12745
+ * Digest types used for the hash.
12028
12746
  */
12029
- hashDigest?: string;
12747
+ hashDigest?:
12748
+ | "base64"
12749
+ | "base64url"
12750
+ | "hex"
12751
+ | "binary"
12752
+ | "utf8"
12753
+ | "utf-8"
12754
+ | "utf16le"
12755
+ | "utf-16le"
12756
+ | "latin1"
12757
+ | "ascii"
12758
+ | "ucs2"
12759
+ | "ucs-2";
12030
12760
 
12031
12761
  /**
12032
12762
  * Number of chars which are used for the hash.
@@ -12179,10 +12909,10 @@ declare interface Output {
12179
12909
  workerWasmLoading?: string | false;
12180
12910
  }
12181
12911
  declare interface OutputFileSystem {
12182
- writeFile: WriteFile;
12183
12912
  mkdir: Mkdir;
12184
12913
  readdir?: ReaddirFs;
12185
12914
  rmdir?: Rmdir;
12915
+ writeFile: WriteFile;
12186
12916
  unlink?: (
12187
12917
  pathLike: PathLikeFs,
12188
12918
  callback: (err: null | NodeJS.ErrnoException) => void
@@ -12190,6 +12920,23 @@ declare interface OutputFileSystem {
12190
12920
  stat: StatFs;
12191
12921
  lstat?: LStatFs;
12192
12922
  readFile: ReadFileFs;
12923
+ createReadStream?: (
12924
+ path: PathLikeFs,
12925
+ options?:
12926
+ | "base64"
12927
+ | "base64url"
12928
+ | "hex"
12929
+ | "binary"
12930
+ | "utf8"
12931
+ | "utf-8"
12932
+ | "utf16le"
12933
+ | "utf-16le"
12934
+ | "latin1"
12935
+ | "ascii"
12936
+ | "ucs2"
12937
+ | "ucs-2"
12938
+ | ReadStreamOptions
12939
+ ) => NodeJS.ReadableStream;
12193
12940
  join?: (path1: string, path2: string) => string;
12194
12941
  relative?: (from: string, to: string) => string;
12195
12942
  dirname?: (dirname: string) => string;
@@ -12275,12 +13022,16 @@ declare interface OutputNormalized {
12275
13022
  /**
12276
13023
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
12277
13024
  */
12278
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
13025
+ devtoolFallbackModuleFilenameTemplate?:
13026
+ | string
13027
+ | ((context: ModuleFilenameTemplateContext) => string);
12279
13028
 
12280
13029
  /**
12281
13030
  * Filename template string of function for the sources array in a generated SourceMap.
12282
13031
  */
12283
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
13032
+ devtoolModuleFilenameTemplate?:
13033
+ | string
13034
+ | ((context: ModuleFilenameTemplateContext) => string);
12284
13035
 
12285
13036
  /**
12286
13037
  * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
@@ -12318,9 +13069,21 @@ declare interface OutputNormalized {
12318
13069
  globalObject?: string;
12319
13070
 
12320
13071
  /**
12321
- * Digest type used for the hash.
13072
+ * Digest types used for the hash.
12322
13073
  */
12323
- hashDigest?: string;
13074
+ hashDigest?:
13075
+ | "base64"
13076
+ | "base64url"
13077
+ | "hex"
13078
+ | "binary"
13079
+ | "utf8"
13080
+ | "utf-8"
13081
+ | "utf16le"
13082
+ | "utf-16le"
13083
+ | "latin1"
13084
+ | "ascii"
13085
+ | "ucs2"
13086
+ | "ucs-2";
12324
13087
 
12325
13088
  /**
12326
13089
  * Number of chars which are used for the hash.
@@ -12457,6 +13220,75 @@ declare interface OutputNormalized {
12457
13220
  */
12458
13221
  workerWasmLoading?: string | false;
12459
13222
  }
13223
+ type OutputNormalizedWithDefaults = OutputNormalized & {
13224
+ uniqueName: string;
13225
+ filename: NonNullable<
13226
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13227
+ >;
13228
+ cssFilename: NonNullable<
13229
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13230
+ >;
13231
+ chunkFilename: NonNullable<
13232
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13233
+ >;
13234
+ cssChunkFilename: NonNullable<
13235
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13236
+ >;
13237
+ hotUpdateChunkFilename: string;
13238
+ hotUpdateGlobal: string;
13239
+ assetModuleFilename: NonNullable<
13240
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13241
+ >;
13242
+ webassemblyModuleFilename: string;
13243
+ sourceMapFilename: string;
13244
+ hotUpdateMainFilename: string;
13245
+ devtoolNamespace: string;
13246
+ publicPath: NonNullable<
13247
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
13248
+ >;
13249
+ workerPublicPath: string;
13250
+ workerWasmLoading: NonNullable<undefined | string | false>;
13251
+ workerChunkLoading: NonNullable<undefined | string | false>;
13252
+ chunkFormat: NonNullable<undefined | string | false>;
13253
+ module: NonNullable<undefined | boolean>;
13254
+ asyncChunks: NonNullable<undefined | boolean>;
13255
+ charset: NonNullable<undefined | boolean>;
13256
+ iife: NonNullable<undefined | boolean>;
13257
+ globalObject: string;
13258
+ scriptType: NonNullable<undefined | false | "module" | "text/javascript">;
13259
+ path: string;
13260
+ pathinfo: NonNullable<undefined | boolean | "verbose">;
13261
+ hashFunction: NonNullable<undefined | string | typeof Hash>;
13262
+ hashDigest: NonNullable<
13263
+ | undefined
13264
+ | "base64"
13265
+ | "base64url"
13266
+ | "hex"
13267
+ | "binary"
13268
+ | "utf8"
13269
+ | "utf-8"
13270
+ | "utf16le"
13271
+ | "utf-16le"
13272
+ | "latin1"
13273
+ | "ascii"
13274
+ | "ucs2"
13275
+ | "ucs-2"
13276
+ >;
13277
+ hashDigestLength: number;
13278
+ chunkLoadTimeout: number;
13279
+ chunkLoading: NonNullable<undefined | string | false>;
13280
+ chunkLoadingGlobal: string;
13281
+ compareBeforeEmit: NonNullable<undefined | boolean>;
13282
+ strictModuleErrorHandling: NonNullable<undefined | boolean>;
13283
+ strictModuleExceptionHandling: NonNullable<undefined | boolean>;
13284
+ importFunctionName: string;
13285
+ importMetaName: string;
13286
+ environment: RecursiveNonNullable<Environment>;
13287
+ crossOriginLoading: NonNullable<
13288
+ undefined | false | "anonymous" | "use-credentials"
13289
+ >;
13290
+ wasmLoading: NonNullable<undefined | string | false>;
13291
+ };
12460
13292
  declare interface ParameterizedComparator<TArg extends object, T> {
12461
13293
  (tArg: TArg): Comparator<T>;
12462
13294
  }
@@ -12518,6 +13350,11 @@ declare interface ParserOptionsByModuleTypeKnown {
12518
13350
  */
12519
13351
  asset?: AssetParserOptions;
12520
13352
 
13353
+ /**
13354
+ * No parser options are supported for this module type.
13355
+ */
13356
+ "asset/bytes"?: EmptyParserOptions;
13357
+
12521
13358
  /**
12522
13359
  * No parser options are supported for this module type.
12523
13360
  */
@@ -12591,7 +13428,7 @@ declare interface ParserStateBase {
12591
13428
  current: NormalModule;
12592
13429
  module: NormalModule;
12593
13430
  compilation: Compilation;
12594
- options: WebpackOptionsNormalized;
13431
+ options: WebpackOptionsNormalizedWithDefaults;
12595
13432
  }
12596
13433
  declare interface PathData {
12597
13434
  chunkGraph?: ChunkGraph;
@@ -12718,6 +13555,10 @@ declare interface PnpApi {
12718
13555
  options: { considerBuiltins: boolean }
12719
13556
  ) => null | string;
12720
13557
  }
13558
+ declare interface Position {
13559
+ line: number;
13560
+ column: number;
13561
+ }
12721
13562
  declare class PrefetchPlugin {
12722
13563
  constructor(context: string, request?: string);
12723
13564
  context: null | string;
@@ -12729,7 +13570,7 @@ declare class PrefetchPlugin {
12729
13570
  apply(compiler: Compiler): void;
12730
13571
  }
12731
13572
  declare class PrefixSource extends Source {
12732
- constructor(prefix: string, source: string | Source | Buffer);
13573
+ constructor(prefix: string, source: string | Buffer | Source);
12733
13574
  getPrefix(): string;
12734
13575
  original(): Source;
12735
13576
  streamChunks(
@@ -12773,7 +13614,7 @@ type ProblemType =
12773
13614
  | "multiple-values-unexpected"
12774
13615
  | "invalid-value";
12775
13616
  declare interface ProcessAssetsAdditionalOptions {
12776
- additionalAssets?: any;
13617
+ additionalAssets?: boolean | ((assets: CompilationAssets) => void);
12777
13618
  }
12778
13619
  declare class Profiler {
12779
13620
  constructor(inspector: Inspector);
@@ -12783,7 +13624,7 @@ declare class Profiler {
12783
13624
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
12784
13625
  sendCommand(method: string, params?: object): Promise<any>;
12785
13626
  destroy(): Promise<void>;
12786
- stopProfiling(): Promise<{ profile: any }>;
13627
+ stopProfiling(): Promise<{ profile: { startTime: number; endTime: number } }>;
12787
13628
  }
12788
13629
  declare class ProfilingPlugin {
12789
13630
  constructor(options?: ProfilingPluginOptions);
@@ -13124,19 +13965,19 @@ declare interface ReadFileFs {
13124
13965
  (
13125
13966
  path: PathOrFileDescriptorFs,
13126
13967
  options:
13127
- | ({ encoding: BufferEncoding; flag?: string } & Abortable)
13128
- | "ascii"
13968
+ | "base64"
13969
+ | "base64url"
13970
+ | "hex"
13971
+ | "binary"
13129
13972
  | "utf8"
13130
13973
  | "utf-8"
13131
13974
  | "utf16le"
13132
13975
  | "utf-16le"
13976
+ | "latin1"
13977
+ | "ascii"
13133
13978
  | "ucs2"
13134
13979
  | "ucs-2"
13135
- | "base64"
13136
- | "base64url"
13137
- | "latin1"
13138
- | "binary"
13139
- | "hex",
13980
+ | ({ encoding: BufferEncoding; flag?: string } & Abortable),
13140
13981
  callback: (err: null | NodeJS.ErrnoException, result?: string) => void
13141
13982
  ): void;
13142
13983
  (
@@ -13144,18 +13985,18 @@ declare interface ReadFileFs {
13144
13985
  options:
13145
13986
  | undefined
13146
13987
  | null
13147
- | "ascii"
13988
+ | "base64"
13989
+ | "base64url"
13990
+ | "hex"
13991
+ | "binary"
13148
13992
  | "utf8"
13149
13993
  | "utf-8"
13150
13994
  | "utf16le"
13151
13995
  | "utf-16le"
13996
+ | "latin1"
13997
+ | "ascii"
13152
13998
  | "ucs2"
13153
13999
  | "ucs-2"
13154
- | "base64"
13155
- | "base64url"
13156
- | "latin1"
13157
- | "binary"
13158
- | "hex"
13159
14000
  | (ObjectEncodingOptions & { flag?: string } & Abortable),
13160
14001
  callback: (
13161
14002
  err: null | NodeJS.ErrnoException,
@@ -13175,36 +14016,36 @@ declare interface ReadFileSync {
13175
14016
  (
13176
14017
  path: PathOrFileDescriptorFs,
13177
14018
  options:
13178
- | "ascii"
14019
+ | "base64"
14020
+ | "base64url"
14021
+ | "hex"
14022
+ | "binary"
13179
14023
  | "utf8"
13180
14024
  | "utf-8"
13181
14025
  | "utf16le"
13182
14026
  | "utf-16le"
14027
+ | "latin1"
14028
+ | "ascii"
13183
14029
  | "ucs2"
13184
14030
  | "ucs-2"
13185
- | "base64"
13186
- | "base64url"
13187
- | "latin1"
13188
- | "binary"
13189
- | "hex"
13190
14031
  | { encoding: BufferEncoding; flag?: string }
13191
14032
  ): string;
13192
14033
  (
13193
14034
  path: PathOrFileDescriptorFs,
13194
14035
  options?:
13195
14036
  | null
13196
- | "ascii"
14037
+ | "base64"
14038
+ | "base64url"
14039
+ | "hex"
14040
+ | "binary"
13197
14041
  | "utf8"
13198
14042
  | "utf-8"
13199
14043
  | "utf16le"
13200
14044
  | "utf-16le"
14045
+ | "latin1"
14046
+ | "ascii"
13201
14047
  | "ucs2"
13202
14048
  | "ucs-2"
13203
- | "base64"
13204
- | "base64url"
13205
- | "latin1"
13206
- | "binary"
13207
- | "hex"
13208
14049
  | (ObjectEncodingOptions & { flag?: string })
13209
14050
  ): string | Buffer;
13210
14051
  }
@@ -13220,18 +14061,18 @@ declare interface ReadFileTypes {
13220
14061
  (
13221
14062
  path: PathOrFileDescriptorTypes,
13222
14063
  options:
13223
- | "ascii"
14064
+ | "base64"
14065
+ | "base64url"
14066
+ | "hex"
14067
+ | "binary"
13224
14068
  | "utf8"
13225
14069
  | "utf-8"
13226
14070
  | "utf16le"
13227
14071
  | "utf-16le"
14072
+ | "latin1"
14073
+ | "ascii"
13228
14074
  | "ucs2"
13229
14075
  | "ucs-2"
13230
- | "base64"
13231
- | "base64url"
13232
- | "latin1"
13233
- | "binary"
13234
- | "hex"
13235
14076
  | ({ encoding: BufferEncoding; flag?: string } & Abortable),
13236
14077
  callback: (err: null | NodeJS.ErrnoException, result?: string) => void
13237
14078
  ): void;
@@ -13240,18 +14081,18 @@ declare interface ReadFileTypes {
13240
14081
  options:
13241
14082
  | undefined
13242
14083
  | null
13243
- | "ascii"
14084
+ | "base64"
14085
+ | "base64url"
14086
+ | "hex"
14087
+ | "binary"
13244
14088
  | "utf8"
13245
14089
  | "utf-8"
13246
14090
  | "utf16le"
13247
14091
  | "utf-16le"
14092
+ | "latin1"
14093
+ | "ascii"
13248
14094
  | "ucs2"
13249
14095
  | "ucs-2"
13250
- | "base64"
13251
- | "base64url"
13252
- | "latin1"
13253
- | "binary"
13254
- | "hex"
13255
14096
  | (ObjectEncodingOptions & { flag?: string } & Abortable),
13256
14097
  callback: (
13257
14098
  err: null | NodeJS.ErrnoException,
@@ -13263,39 +14104,43 @@ declare interface ReadFileTypes {
13263
14104
  callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
13264
14105
  ): void;
13265
14106
  }
14107
+ type ReadStreamOptions = StreamOptions & {
14108
+ fs?: null | CreateReadStreamFSImplementation;
14109
+ end?: number;
14110
+ };
13266
14111
  declare interface ReaddirFs {
13267
14112
  (
13268
14113
  path: PathLikeFs,
13269
14114
  options:
13270
14115
  | undefined
13271
14116
  | null
13272
- | "ascii"
14117
+ | "base64"
14118
+ | "base64url"
14119
+ | "hex"
14120
+ | "binary"
13273
14121
  | "utf8"
13274
14122
  | "utf-8"
13275
14123
  | "utf16le"
13276
14124
  | "utf-16le"
14125
+ | "latin1"
14126
+ | "ascii"
13277
14127
  | "ucs2"
13278
14128
  | "ucs-2"
13279
- | "base64"
13280
- | "base64url"
13281
- | "latin1"
13282
- | "binary"
13283
- | "hex"
13284
14129
  | {
13285
14130
  encoding:
13286
14131
  | null
13287
- | "ascii"
14132
+ | "base64"
14133
+ | "base64url"
14134
+ | "hex"
14135
+ | "binary"
13288
14136
  | "utf8"
13289
14137
  | "utf-8"
13290
14138
  | "utf16le"
13291
14139
  | "utf-16le"
13292
- | "ucs2"
13293
- | "ucs-2"
13294
- | "base64"
13295
- | "base64url"
13296
14140
  | "latin1"
13297
- | "binary"
13298
- | "hex";
14141
+ | "ascii"
14142
+ | "ucs2"
14143
+ | "ucs-2";
13299
14144
  withFileTypes?: false;
13300
14145
  recursive?: boolean;
13301
14146
  },
@@ -13313,18 +14158,18 @@ declare interface ReaddirFs {
13313
14158
  options:
13314
14159
  | undefined
13315
14160
  | null
13316
- | "ascii"
14161
+ | "base64"
14162
+ | "base64url"
14163
+ | "hex"
14164
+ | "binary"
13317
14165
  | "utf8"
13318
14166
  | "utf-8"
13319
14167
  | "utf16le"
13320
14168
  | "utf-16le"
14169
+ | "latin1"
14170
+ | "ascii"
13321
14171
  | "ucs2"
13322
14172
  | "ucs-2"
13323
- | "base64"
13324
- | "base64url"
13325
- | "latin1"
13326
- | "binary"
13327
- | "hex"
13328
14173
  | (ObjectEncodingOptions & {
13329
14174
  withFileTypes?: false;
13330
14175
  recursive?: boolean;
@@ -13363,33 +14208,33 @@ declare interface ReaddirSync {
13363
14208
  path: PathLikeFs,
13364
14209
  options?:
13365
14210
  | null
13366
- | "ascii"
14211
+ | "base64"
14212
+ | "base64url"
14213
+ | "hex"
14214
+ | "binary"
13367
14215
  | "utf8"
13368
14216
  | "utf-8"
13369
14217
  | "utf16le"
13370
14218
  | "utf-16le"
14219
+ | "latin1"
14220
+ | "ascii"
13371
14221
  | "ucs2"
13372
14222
  | "ucs-2"
13373
- | "base64"
13374
- | "base64url"
13375
- | "latin1"
13376
- | "binary"
13377
- | "hex"
13378
14223
  | {
13379
14224
  encoding:
13380
14225
  | null
13381
- | "ascii"
14226
+ | "base64"
14227
+ | "base64url"
14228
+ | "hex"
14229
+ | "binary"
13382
14230
  | "utf8"
13383
14231
  | "utf-8"
13384
14232
  | "utf16le"
13385
14233
  | "utf-16le"
13386
- | "ucs2"
13387
- | "ucs-2"
13388
- | "base64"
13389
- | "base64url"
13390
14234
  | "latin1"
13391
- | "binary"
13392
- | "hex";
14235
+ | "ascii"
14236
+ | "ucs2"
14237
+ | "ucs-2";
13393
14238
  withFileTypes?: false;
13394
14239
  recursive?: boolean;
13395
14240
  }
@@ -13404,18 +14249,18 @@ declare interface ReaddirSync {
13404
14249
  path: PathLikeFs,
13405
14250
  options?:
13406
14251
  | null
13407
- | "ascii"
14252
+ | "base64"
14253
+ | "base64url"
14254
+ | "hex"
14255
+ | "binary"
13408
14256
  | "utf8"
13409
14257
  | "utf-8"
13410
14258
  | "utf16le"
13411
14259
  | "utf-16le"
14260
+ | "latin1"
14261
+ | "ascii"
13412
14262
  | "ucs2"
13413
14263
  | "ucs-2"
13414
- | "base64"
13415
- | "base64url"
13416
- | "latin1"
13417
- | "binary"
13418
- | "hex"
13419
14264
  | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
13420
14265
  ): string[] | Buffer[];
13421
14266
  (
@@ -13436,33 +14281,33 @@ declare interface ReaddirTypes {
13436
14281
  options:
13437
14282
  | undefined
13438
14283
  | null
13439
- | "ascii"
14284
+ | "base64"
14285
+ | "base64url"
14286
+ | "hex"
14287
+ | "binary"
13440
14288
  | "utf8"
13441
14289
  | "utf-8"
13442
14290
  | "utf16le"
13443
14291
  | "utf-16le"
14292
+ | "latin1"
14293
+ | "ascii"
13444
14294
  | "ucs2"
13445
14295
  | "ucs-2"
13446
- | "base64"
13447
- | "base64url"
13448
- | "latin1"
13449
- | "binary"
13450
- | "hex"
13451
14296
  | {
13452
14297
  encoding:
13453
14298
  | null
13454
- | "ascii"
14299
+ | "base64"
14300
+ | "base64url"
14301
+ | "hex"
14302
+ | "binary"
13455
14303
  | "utf8"
13456
14304
  | "utf-8"
13457
14305
  | "utf16le"
13458
14306
  | "utf-16le"
13459
- | "ucs2"
13460
- | "ucs-2"
13461
- | "base64"
13462
- | "base64url"
13463
14307
  | "latin1"
13464
- | "binary"
13465
- | "hex";
14308
+ | "ascii"
14309
+ | "ucs2"
14310
+ | "ucs-2";
13466
14311
  withFileTypes?: false;
13467
14312
  recursive?: boolean;
13468
14313
  },
@@ -13480,18 +14325,18 @@ declare interface ReaddirTypes {
13480
14325
  options:
13481
14326
  | undefined
13482
14327
  | null
13483
- | "ascii"
14328
+ | "base64"
14329
+ | "base64url"
14330
+ | "hex"
14331
+ | "binary"
13484
14332
  | "utf8"
13485
14333
  | "utf-8"
13486
14334
  | "utf16le"
13487
14335
  | "utf-16le"
14336
+ | "latin1"
14337
+ | "ascii"
13488
14338
  | "ucs2"
13489
14339
  | "ucs-2"
13490
- | "base64"
13491
- | "base64url"
13492
- | "latin1"
13493
- | "binary"
13494
- | "hex"
13495
14340
  | (ObjectEncodingOptions & {
13496
14341
  withFileTypes?: false;
13497
14342
  recursive?: boolean;
@@ -13593,12 +14438,12 @@ declare interface RealContentHashPluginOptions {
13593
14438
  /**
13594
14439
  * the hash function to use
13595
14440
  */
13596
- hashFunction: string | typeof Hash;
14441
+ hashFunction: HashFunction;
13597
14442
 
13598
14443
  /**
13599
14444
  * the hash digest to use
13600
14445
  */
13601
- hashDigest?: string;
14446
+ hashDigest: HashDigest;
13602
14447
  }
13603
14448
  declare interface RealDependencyLocation {
13604
14449
  start: SourcePosition;
@@ -13674,6 +14519,7 @@ type RecursiveArrayOrRecord<T> =
13674
14519
  | { [index: string]: RecursiveArrayOrRecord<T> }
13675
14520
  | RecursiveArrayOrRecord<T>[]
13676
14521
  | T;
14522
+ declare interface RecursiveNonNullable<T> {}
13677
14523
  type ReferenceableItem = string | object;
13678
14524
  declare interface ReferencedExport {
13679
14525
  /**
@@ -13839,7 +14685,7 @@ declare interface RenderManifestOptions {
13839
14685
  chunk: Chunk;
13840
14686
  hash: string;
13841
14687
  fullHash: string;
13842
- outputOptions: Output;
14688
+ outputOptions: OutputNormalizedWithDefaults;
13843
14689
  codeGenerationResults: CodeGenerationResults;
13844
14690
  moduleTemplates: { javascript: ModuleTemplate };
13845
14691
  dependencyTemplates: DependencyTemplates;
@@ -13951,7 +14797,7 @@ declare interface ResolveData {
13951
14797
  resolveOptions?: ResolveOptions;
13952
14798
  context: string;
13953
14799
  request: string;
13954
- assertions?: ImportAttributes;
14800
+ attributes?: ImportAttributes;
13955
14801
  dependencies: ModuleDependency[];
13956
14802
  dependencyType: string;
13957
14803
  createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
@@ -14543,7 +15389,10 @@ declare interface ResolverCache {
14543
15389
  declare abstract class ResolverFactory {
14544
15390
  hooks: Readonly<{
14545
15391
  resolveOptions: HookMap<
14546
- SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
15392
+ SyncWaterfallHook<
15393
+ [ResolveOptionsWithDependencyType],
15394
+ ResolveOptionsWithDependencyType
15395
+ >
14547
15396
  >;
14548
15397
  resolver: HookMap<
14549
15398
  SyncHook<
@@ -14622,7 +15471,7 @@ declare interface Rmdir {
14622
15471
  callback: (err: null | NodeJS.ErrnoException) => void
14623
15472
  ): void;
14624
15473
  }
14625
- type Rule = string | RegExp;
15474
+ type Rule = string | RegExp | ((str: string) => boolean);
14626
15475
  declare interface RuleSet {
14627
15476
  /**
14628
15477
  * map of references in the rule set (may grow over time)
@@ -14753,6 +15602,11 @@ declare interface RuleSetRule {
14753
15602
  | RuleSetLogicalConditionsAbsolute
14754
15603
  | RuleSetConditionAbsolute[];
14755
15604
 
15605
+ /**
15606
+ * Enable/Disable extracting source map.
15607
+ */
15608
+ extractSourceMap?: boolean;
15609
+
14756
15610
  /**
14757
15611
  * The options for the module generator.
14758
15612
  */
@@ -15046,9 +15900,6 @@ type RuleSetUseItem =
15046
15900
  */
15047
15901
  options?: string | { [index: string]: any };
15048
15902
  };
15049
- declare interface RunCallback<T> {
15050
- (err: null | Error, result?: T): any;
15051
- }
15052
15903
  declare class RuntimeChunkPlugin {
15053
15904
  constructor(options?: {
15054
15905
  /**
@@ -15064,6 +15915,7 @@ declare class RuntimeChunkPlugin {
15064
15915
  apply(compiler: Compiler): void;
15065
15916
  }
15066
15917
  type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
15918
+ type RuntimeId = string | number;
15067
15919
  declare class RuntimeModule extends Module {
15068
15920
  constructor(name: string, stage?: number);
15069
15921
  name: string;
@@ -15131,25 +15983,26 @@ declare class RuntimeSpecSet {
15131
15983
  }
15132
15984
  declare abstract class RuntimeTemplate {
15133
15985
  compilation: Compilation;
15134
- outputOptions: OutputNormalized;
15986
+ outputOptions: OutputNormalizedWithDefaults;
15135
15987
  requestShortener: RequestShortener;
15136
15988
  globalObject: string;
15137
15989
  contentHashReplacement: string;
15138
- isIIFE(): undefined | boolean;
15139
- isModule(): undefined | boolean;
15990
+ isIIFE(): boolean;
15991
+ isModule(): boolean;
15140
15992
  isNeutralPlatform(): boolean;
15141
- supportsConst(): undefined | boolean;
15142
- supportsArrowFunction(): undefined | boolean;
15143
- supportsAsyncFunction(): undefined | boolean;
15144
- supportsOptionalChaining(): undefined | boolean;
15145
- supportsForOf(): undefined | boolean;
15146
- supportsDestructuring(): undefined | boolean;
15147
- supportsBigIntLiteral(): undefined | boolean;
15148
- supportsDynamicImport(): undefined | boolean;
15149
- supportsEcmaScriptModuleSyntax(): undefined | boolean;
15150
- supportTemplateLiteral(): undefined | boolean;
15151
- supportNodePrefixForCoreModules(): undefined | boolean;
15993
+ supportsConst(): boolean;
15994
+ supportsArrowFunction(): boolean;
15995
+ supportsAsyncFunction(): boolean;
15996
+ supportsOptionalChaining(): boolean;
15997
+ supportsForOf(): boolean;
15998
+ supportsDestructuring(): boolean;
15999
+ supportsBigIntLiteral(): boolean;
16000
+ supportsDynamicImport(): boolean;
16001
+ supportsEcmaScriptModuleSyntax(): boolean;
16002
+ supportTemplateLiteral(): boolean;
16003
+ supportNodePrefixForCoreModules(): boolean;
15152
16004
  renderNodePrefixForCoreModule(mod: string): string;
16005
+ renderConst(): "var" | "const";
15153
16006
  returningFunction(returnValue: string, args?: string): string;
15154
16007
  basicFunction(args: string, body: string | string[]): string;
15155
16008
  concatenation(...args: (string | { expr: string })[]): string;
@@ -15556,7 +16409,7 @@ declare abstract class RuntimeValue {
15556
16409
  get fileDependencies(): true | string[];
15557
16410
  exec(
15558
16411
  parser: JavascriptParser,
15559
- valueCacheVersions: Map<string, string | Set<string>>,
16412
+ valueCacheVersions: Map<string, ValueCacheVersion>,
15560
16413
  key: string
15561
16414
  ): CodeValuePrimitive;
15562
16415
  getCacheVersion(): undefined | string;
@@ -15614,6 +16467,9 @@ declare abstract class SerializerMiddleware<
15614
16467
  context: Context
15615
16468
  ): DeserializedType | Promise<DeserializedType>;
15616
16469
  }
16470
+ type ServerLazyCompilationBackend =
16471
+ | ServerImportHttp<typeof IncomingMessage>
16472
+ | ServerImportHttps<typeof IncomingMessage>;
15617
16473
  declare interface SetIterator<T> extends IteratorObject<T, undefined> {
15618
16474
  [Symbol.iterator](): SetIterator<T>;
15619
16475
  [Symbol.dispose](): void;
@@ -15708,10 +16564,11 @@ declare class SideEffectsFlagPlugin {
15708
16564
  apply(compiler: Compiler): void;
15709
16565
  static moduleHasSideEffects(
15710
16566
  moduleName: string,
15711
- flagValue: undefined | string | boolean | string[],
16567
+ flagValue: SideEffectsFlagValue,
15712
16568
  cache: Map<string, RegExp>
15713
16569
  ): undefined | boolean;
15714
16570
  }
16571
+ type SideEffectsFlagValue = undefined | string | boolean | string[];
15715
16572
  type SimpleType = "string" | "number" | "boolean";
15716
16573
  declare class SizeOnlySource extends Source {
15717
16574
  constructor(size: number);
@@ -15768,6 +16625,51 @@ declare abstract class Snapshot {
15768
16625
  getContextIterable(): Iterable<string>;
15769
16626
  getMissingIterable(): Iterable<string>;
15770
16627
  }
16628
+ type SnapshotNormalizedWithDefaults = SnapshotOptionsWebpackOptions & {
16629
+ managedPaths: (string | RegExp)[];
16630
+ unmanagedPaths: (string | RegExp)[];
16631
+ immutablePaths: (string | RegExp)[];
16632
+ resolveBuildDependencies: {
16633
+ /**
16634
+ * Use hashes of the content of the files/directories to determine invalidation.
16635
+ */
16636
+ hash?: boolean;
16637
+ /**
16638
+ * Use timestamps of the files/directories to determine invalidation.
16639
+ */
16640
+ timestamp?: boolean;
16641
+ };
16642
+ buildDependencies: {
16643
+ /**
16644
+ * Use hashes of the content of the files/directories to determine invalidation.
16645
+ */
16646
+ hash?: boolean;
16647
+ /**
16648
+ * Use timestamps of the files/directories to determine invalidation.
16649
+ */
16650
+ timestamp?: boolean;
16651
+ };
16652
+ module: {
16653
+ /**
16654
+ * Use hashes of the content of the files/directories to determine invalidation.
16655
+ */
16656
+ hash?: boolean;
16657
+ /**
16658
+ * Use timestamps of the files/directories to determine invalidation.
16659
+ */
16660
+ timestamp?: boolean;
16661
+ };
16662
+ resolve: {
16663
+ /**
16664
+ * Use hashes of the content of the files/directories to determine invalidation.
16665
+ */
16666
+ hash?: boolean;
16667
+ /**
16668
+ * Use timestamps of the files/directories to determine invalidation.
16669
+ */
16670
+ timestamp?: boolean;
16671
+ };
16672
+ };
15771
16673
  declare interface SnapshotOptionsFileSystemInfo {
15772
16674
  /**
15773
16675
  * should use hash to snapshot
@@ -15798,6 +16700,20 @@ declare interface SnapshotOptionsWebpackOptions {
15798
16700
  timestamp?: boolean;
15799
16701
  };
15800
16702
 
16703
+ /**
16704
+ * Options for snapshotting the context module to determine if it needs to be built again.
16705
+ */
16706
+ contextModule?: {
16707
+ /**
16708
+ * Use hashes of the content of the files/directories to determine invalidation.
16709
+ */
16710
+ hash?: boolean;
16711
+ /**
16712
+ * Use timestamps of the files/directories to determine invalidation.
16713
+ */
16714
+ timestamp?: boolean;
16715
+ };
16716
+
15801
16717
  /**
15802
16718
  * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
15803
16719
  */
@@ -15934,8 +16850,12 @@ declare class SourceMapDevToolPlugin {
15934
16850
  | string
15935
16851
  | false
15936
16852
  | ((pathData: PathData, assetInfo?: AssetInfo) => string);
15937
- moduleFilenameTemplate: string | ((context?: any) => string);
15938
- fallbackModuleFilenameTemplate: string | ((context?: any) => string);
16853
+ moduleFilenameTemplate:
16854
+ | string
16855
+ | ((context: ModuleFilenameTemplateContext) => string);
16856
+ fallbackModuleFilenameTemplate:
16857
+ | string
16858
+ | ((context: ModuleFilenameTemplateContext) => string);
15939
16859
  namespace: string;
15940
16860
  options: SourceMapDevToolPluginOptions;
15941
16861
 
@@ -15967,12 +16887,14 @@ declare interface SourceMapDevToolPluginOptions {
15967
16887
  /**
15968
16888
  * Exclude modules that match the given value from source map generation.
15969
16889
  */
15970
- exclude?: string | RegExp | Rule[];
16890
+ exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
15971
16891
 
15972
16892
  /**
15973
16893
  * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
15974
16894
  */
15975
- fallbackModuleFilenameTemplate?: string | ((context?: any) => string);
16895
+ fallbackModuleFilenameTemplate?:
16896
+ | string
16897
+ | ((context: ModuleFilenameTemplateContext) => string);
15976
16898
 
15977
16899
  /**
15978
16900
  * Path prefix to which the [file] placeholder is relative to.
@@ -15987,7 +16909,7 @@ declare interface SourceMapDevToolPluginOptions {
15987
16909
  /**
15988
16910
  * Include source maps for module paths that match the given value.
15989
16911
  */
15990
- include?: string | RegExp | Rule[];
16912
+ include?: string | RegExp | Rule[] | ((str: string) => boolean);
15991
16913
 
15992
16914
  /**
15993
16915
  * Indicates whether SourceMaps from loaders should be used (defaults to true).
@@ -15997,7 +16919,9 @@ declare interface SourceMapDevToolPluginOptions {
15997
16919
  /**
15998
16920
  * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
15999
16921
  */
16000
- moduleFilenameTemplate?: string | ((context?: any) => string);
16922
+ moduleFilenameTemplate?:
16923
+ | string
16924
+ | ((context: ModuleFilenameTemplateContext) => string);
16001
16925
 
16002
16926
  /**
16003
16927
  * Namespace prefix to allow multiple webpack roots in the devtools.
@@ -16022,7 +16946,7 @@ declare interface SourceMapDevToolPluginOptions {
16022
16946
  /**
16023
16947
  * Include source maps for modules based on their extension (defaults to .js and .css).
16024
16948
  */
16025
- test?: string | RegExp | Rule[];
16949
+ test?: string | RegExp | Rule[] | ((str: string) => boolean);
16026
16950
  }
16027
16951
  declare class SourceMapSource extends Source {
16028
16952
  constructor(
@@ -16266,9 +17190,9 @@ type Statement =
16266
17190
  | ForInStatement
16267
17191
  | ForOfStatement;
16268
17192
  type StatementPathItem =
16269
- | ImportDeclarationJavascriptParser
16270
- | ExportNamedDeclarationJavascriptParser
16271
- | ExportAllDeclarationJavascriptParser
17193
+ | ImportDeclaration
17194
+ | ExportNamedDeclaration
17195
+ | ExportAllDeclaration
16272
17196
  | ImportExpressionImport
16273
17197
  | UnaryExpression
16274
17198
  | ArrayExpression
@@ -16348,9 +17272,7 @@ declare abstract class StatsFactory {
16348
17272
  }
16349
17273
  type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
16350
17274
  declare interface StatsFactoryHooks {
16351
- extract: HookMap<
16352
- SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], void>
16353
- >;
17275
+ extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
16354
17276
  filter: HookMap<
16355
17277
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16356
17278
  >;
@@ -16364,7 +17286,7 @@ declare interface StatsFactoryHooks {
16364
17286
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16365
17287
  >;
16366
17288
  groupResults: HookMap<
16367
- SyncBailHook<[GroupConfig[], StatsFactoryContext], void>
17289
+ SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
16368
17290
  >;
16369
17291
  sortResults: HookMap<
16370
17292
  SyncBailHook<
@@ -16438,7 +17360,18 @@ declare interface StatsOptions {
16438
17360
  /**
16439
17361
  * Add children information.
16440
17362
  */
16441
- children?: boolean;
17363
+ children?:
17364
+ | boolean
17365
+ | StatsOptions
17366
+ | "none"
17367
+ | "summary"
17368
+ | "errors-only"
17369
+ | "errors-warnings"
17370
+ | "minimal"
17371
+ | "normal"
17372
+ | "detailed"
17373
+ | "verbose"
17374
+ | StatsValue[];
16442
17375
 
16443
17376
  /**
16444
17377
  * Display auxiliary assets in chunk groups.
@@ -16692,7 +17625,7 @@ declare interface StatsOptions {
16692
17625
  /**
16693
17626
  * Add logging output.
16694
17627
  */
16695
- logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
17628
+ logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
16696
17629
 
16697
17630
  /**
16698
17631
  * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
@@ -16841,7 +17774,7 @@ declare interface StatsOptions {
16841
17774
  | string
16842
17775
  | RegExp
16843
17776
  | WarningFilterItemTypes[]
16844
- | ((warning: StatsError, value: string) => boolean);
17777
+ | ((warning: StatsError, warningString: string) => boolean);
16845
17778
 
16846
17779
  /**
16847
17780
  * Space to display warnings (value is in number of lines).
@@ -16866,7 +17799,7 @@ declare interface StatsPrintHooks {
16866
17799
  print: HookMap<
16867
17800
  SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
16868
17801
  >;
16869
- result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
17802
+ result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
16870
17803
  }
16871
17804
  declare abstract class StatsPrinter {
16872
17805
  hooks: StatsPrintHooks;
@@ -16885,18 +17818,40 @@ type StatsValue =
16885
17818
  | boolean
16886
17819
  | StatsOptions
16887
17820
  | "none"
16888
- | "verbose"
16889
17821
  | "summary"
16890
17822
  | "errors-only"
16891
17823
  | "errors-warnings"
16892
17824
  | "minimal"
16893
17825
  | "normal"
16894
- | "detailed";
17826
+ | "detailed"
17827
+ | "verbose";
16895
17828
  declare interface StreamChunksOptions {
16896
17829
  source?: boolean;
16897
17830
  finalSource?: boolean;
16898
17831
  columns?: boolean;
16899
17832
  }
17833
+ declare interface StreamOptions {
17834
+ flags?: string;
17835
+ encoding?:
17836
+ | "base64"
17837
+ | "base64url"
17838
+ | "hex"
17839
+ | "binary"
17840
+ | "utf8"
17841
+ | "utf-8"
17842
+ | "utf16le"
17843
+ | "utf-16le"
17844
+ | "latin1"
17845
+ | "ascii"
17846
+ | "ucs2"
17847
+ | "ucs-2";
17848
+ fd?: any;
17849
+ mode?: number;
17850
+ autoClose?: boolean;
17851
+ emitClose?: boolean;
17852
+ start?: number;
17853
+ signal?: null | AbortSignal;
17854
+ }
16900
17855
  type Supports = undefined | string;
16901
17856
  declare class SyncModuleIdsPlugin {
16902
17857
  constructor(__0: SyncModuleIdsPluginOptions);
@@ -16934,12 +17889,15 @@ declare interface SyntheticDependencyLocation {
16934
17889
  declare const TOMBSTONE: unique symbol;
16935
17890
  declare const TRANSITIVE: unique symbol;
16936
17891
  declare const TRANSITIVE_ONLY: unique symbol;
16937
- declare interface TagData {
16938
- [index: string]: any;
16939
- }
16940
17892
  declare interface TagInfo {
16941
17893
  tag: symbol;
16942
- data?: TagData;
17894
+ data?:
17895
+ | Record<string, any>
17896
+ | TopLevelSymbol
17897
+ | HarmonySettings
17898
+ | ImportSettings
17899
+ | CommonJsImportSettings
17900
+ | CompatibilitySettings;
16943
17901
  next?: TagInfo;
16944
17902
  }
16945
17903
  declare interface TargetItemWithConnection {
@@ -17028,6 +17986,7 @@ declare interface UpdateHashContextGenerator {
17028
17986
  runtime: RuntimeSpec;
17029
17987
  runtimeTemplate?: RuntimeTemplate;
17030
17988
  }
17989
+ type Usage = string | true | TopLevelSymbol;
17031
17990
  type UsageStateType = 0 | 1 | 2 | 3 | 4;
17032
17991
  type UsedName = string | false | string[];
17033
17992
  type Value = string | number | boolean | RegExp;
@@ -17052,23 +18011,27 @@ declare class VariableInfo {
17052
18011
  type VariableInfoFlagsType = 0 | 1 | 2 | 4;
17053
18012
  declare interface VirtualModuleConfig {
17054
18013
  /**
17055
- * - The module type
18014
+ * the module type
17056
18015
  */
17057
18016
  type?: string;
17058
18017
 
17059
18018
  /**
17060
- * - The source function
18019
+ * the source function
17061
18020
  */
17062
- source: (loaderContext: LoaderContextObject<any>) => string | Promise<string>;
18021
+ source: (
18022
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
18023
+ ) => string | Buffer | Promise<string | Buffer>;
17063
18024
 
17064
18025
  /**
17065
- * - Optional version function or value
18026
+ * optional version function or value
17066
18027
  */
17067
18028
  version?: string | true | (() => string);
17068
18029
  }
17069
18030
  type VirtualModuleInput =
17070
18031
  | string
17071
- | ((loaderContext: LoaderContextObject<any>) => string | Promise<string>)
18032
+ | ((
18033
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
18034
+ ) => string | Buffer | Promise<string | Buffer>)
17072
18035
  | VirtualModuleConfig;
17073
18036
  declare interface VirtualModules {
17074
18037
  [index: string]: VirtualModuleInput;
@@ -17093,7 +18056,7 @@ declare class VirtualUrlPlugin {
17093
18056
  type WarningFilterItemTypes =
17094
18057
  | string
17095
18058
  | RegExp
17096
- | ((warning: StatsError, value: string) => boolean);
18059
+ | ((warning: StatsError, warningString: string) => boolean);
17097
18060
  declare interface WatchFileSystem {
17098
18061
  watch: (
17099
18062
  files: Iterable<string>,
@@ -17216,8 +18179,8 @@ declare interface WatcherInfo {
17216
18179
  declare abstract class Watching {
17217
18180
  startTime: null | number;
17218
18181
  invalid: boolean;
17219
- handler: CallbackFunction_1<Stats>;
17220
- callbacks: CallbackFunction_1<void>[];
18182
+ handler: CallbackWebpackFunction_2<Stats, void>;
18183
+ callbacks: ((err: null | Error, result?: void) => void)[];
17221
18184
  closed: boolean;
17222
18185
  suspended: boolean;
17223
18186
  blocked: boolean;
@@ -17232,10 +18195,10 @@ declare abstract class Watching {
17232
18195
  dirs: Iterable<string>,
17233
18196
  missing: Iterable<string>
17234
18197
  ): void;
17235
- invalidate(callback?: CallbackFunction_1<void>): void;
18198
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
17236
18199
  suspend(): void;
17237
18200
  resume(): void;
17238
- close(callback: CallbackFunction_1<void>): void;
18201
+ close(callback: (err: null | Error, result?: void) => void): void;
17239
18202
  }
17240
18203
  declare abstract class WeakTupleMap<K extends any[], V> {
17241
18204
  set(...args: [K, ...V[]]): void;
@@ -17245,6 +18208,7 @@ declare abstract class WeakTupleMap<K extends any[], V> {
17245
18208
  delete(...args: K): void;
17246
18209
  clear(): void;
17247
18210
  }
18211
+ declare abstract class WebAssemblyParser extends ParserClass {}
17248
18212
  declare interface WebAssemblyRenderContext {
17249
18213
  /**
17250
18214
  * the chunk
@@ -17528,11 +18492,6 @@ declare interface WebpackOptionsNormalized {
17528
18492
  * Add additional plugins to the compiler.
17529
18493
  */
17530
18494
  plugins: (
17531
- | undefined
17532
- | null
17533
- | false
17534
- | ""
17535
- | 0
17536
18495
  | ((this: Compiler, compiler: Compiler) => void)
17537
18496
  | WebpackPluginInstance
17538
18497
  )[];
@@ -17587,6 +18546,49 @@ declare interface WebpackOptionsNormalized {
17587
18546
  */
17588
18547
  watchOptions: WatchOptions;
17589
18548
  }
18549
+ type WebpackOptionsNormalizedWithDefaults = WebpackOptionsNormalized & {
18550
+ context: string;
18551
+ } & { infrastructureLogging: InfrastructureLoggingNormalizedWithDefaults } & {
18552
+ target: NonNullable<undefined | string | false | string[]>;
18553
+ } & { output: OutputNormalizedWithDefaults } & {
18554
+ optimization: OptimizationNormalizedWithDefaults;
18555
+ } & { devtool: NonNullable<undefined | string | false> } & {
18556
+ stats: NonNullable<StatsValue>;
18557
+ } & { node: NonNullable<Node> } & {
18558
+ profile: NonNullable<undefined | boolean>;
18559
+ } & { parallelism: number } & { snapshot: SnapshotNormalizedWithDefaults } & {
18560
+ externalsPresets: ExternalsPresetsNormalizedWithDefaults;
18561
+ } & {
18562
+ externalsType: NonNullable<
18563
+ | undefined
18564
+ | "import"
18565
+ | "var"
18566
+ | "module"
18567
+ | "assign"
18568
+ | "this"
18569
+ | "window"
18570
+ | "self"
18571
+ | "global"
18572
+ | "commonjs"
18573
+ | "commonjs2"
18574
+ | "commonjs-module"
18575
+ | "commonjs-static"
18576
+ | "amd"
18577
+ | "amd-require"
18578
+ | "umd"
18579
+ | "umd2"
18580
+ | "jsonp"
18581
+ | "system"
18582
+ | "promise"
18583
+ | "module-import"
18584
+ | "script"
18585
+ | "node-commonjs"
18586
+ >;
18587
+ } & { watch: NonNullable<undefined | boolean> } & {
18588
+ performance: NonNullable<undefined | false | PerformanceOptions>;
18589
+ } & { recordsInputPath: NonNullable<undefined | string | false> } & {
18590
+ recordsOutputPath: NonNullable<undefined | string | false>;
18591
+ };
17590
18592
 
17591
18593
  /**
17592
18594
  * Plugin instance.
@@ -17631,64 +18633,48 @@ declare interface WriteFile {
17631
18633
  }
17632
18634
  type WriteFileOptions =
17633
18635
  | null
17634
- | "ascii"
18636
+ | "base64"
18637
+ | "base64url"
18638
+ | "hex"
18639
+ | "binary"
17635
18640
  | "utf8"
17636
18641
  | "utf-8"
17637
18642
  | "utf16le"
17638
18643
  | "utf-16le"
18644
+ | "latin1"
18645
+ | "ascii"
17639
18646
  | "ucs2"
17640
18647
  | "ucs-2"
17641
- | "base64"
17642
- | "base64url"
17643
- | "latin1"
17644
- | "binary"
17645
- | "hex"
17646
18648
  | (ObjectEncodingOptions &
17647
18649
  Abortable & { mode?: string | number; flag?: string; flush?: boolean });
17648
18650
  declare interface WriteOnlySet<T> {
17649
18651
  add: (item: T) => void;
17650
18652
  }
17651
-
17652
- declare interface WriteStreamOptions {
17653
- flags?: string;
17654
- encoding?:
17655
- | "ascii"
17656
- | "utf8"
17657
- | "utf-8"
17658
- | "utf16le"
17659
- | "utf-16le"
17660
- | "ucs2"
17661
- | "ucs-2"
17662
- | "base64"
17663
- | "base64url"
17664
- | "latin1"
17665
- | "binary"
17666
- | "hex";
17667
- fd?: any;
17668
- mode?: number;
17669
- autoClose?: boolean;
17670
- emitClose?: boolean;
17671
- start?: number;
17672
- signal?: null | AbortSignal;
18653
+ type WriteStreamOptions = StreamOptions & {
17673
18654
  fs?: null | CreateWriteStreamFSImplementation;
18655
+ flush?: boolean;
18656
+ };
18657
+ declare interface chunkModuleHashMap {
18658
+ [index: number]: string;
18659
+ [index: string]: string;
17674
18660
  }
17675
18661
  declare function exports(
17676
18662
  options: Configuration,
17677
- callback?: CallbackWebpack<Stats>
18663
+ callback?: CallbackWebpackFunction_2<Stats, void>
17678
18664
  ): null | Compiler;
17679
18665
  declare function exports(
17680
18666
  options: MultiConfiguration,
17681
- callback?: CallbackWebpack<MultiStats>
18667
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17682
18668
  ): null | MultiCompiler;
17683
18669
  declare namespace exports {
17684
18670
  export const webpack: {
17685
18671
  (
17686
18672
  options: Configuration,
17687
- callback?: CallbackWebpack<Stats>
18673
+ callback?: CallbackWebpackFunction_2<Stats, void>
17688
18674
  ): null | Compiler;
17689
18675
  (
17690
18676
  options: MultiConfiguration,
17691
- callback?: CallbackWebpack<MultiStats>
18677
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17692
18678
  ): null | MultiCompiler;
17693
18679
  };
17694
18680
  export const validate: (
@@ -17772,7 +18758,9 @@ declare namespace exports {
17772
18758
  module: string | Module,
17773
18759
  options: {
17774
18760
  namespace?: string;
17775
- moduleFilenameTemplate?: string | ((context?: any) => string);
18761
+ moduleFilenameTemplate?:
18762
+ | string
18763
+ | ((context: ModuleFilenameTemplateContext) => string);
17776
18764
  },
17777
18765
  __2: {
17778
18766
  requestShortener: RequestShortener;
@@ -17874,6 +18862,7 @@ declare namespace exports {
17874
18862
  export let system: "__webpack_require__.System";
17875
18863
  export let systemContext: "__webpack_require__.y";
17876
18864
  export let thisAsExports: "top-level-this-exports";
18865
+ export let toBinary: "__webpack_require__.tb";
17877
18866
  export let uncaughtErrorHandler: "__webpack_require__.oe";
17878
18867
  export let wasmInstances: "__webpack_require__.w";
17879
18868
  }
@@ -17929,12 +18918,12 @@ declare namespace exports {
17929
18918
  export let addUsage: (
17930
18919
  state: ParserState,
17931
18920
  symbol: null | TopLevelSymbol,
17932
- usage: string | true | TopLevelSymbol
18921
+ usage: Usage
17933
18922
  ) => void;
17934
18923
  export let addVariableUsage: (
17935
18924
  parser: JavascriptParser,
17936
18925
  name: string,
17937
- usage: string | true | TopLevelSymbol
18926
+ usage: Usage
17938
18927
  ) => void;
17939
18928
  export let bailout: (parserState: ParserState) => void;
17940
18929
  export let enable: (parserState: ParserState) => void;
@@ -17955,7 +18944,7 @@ declare namespace exports {
17955
18944
  export let inferDependencyUsage: (state: ParserState) => void;
17956
18945
  export let isDependencyUsedByExports: (
17957
18946
  dependency: Dependency,
17958
- usedByExports: boolean | Set<string>,
18947
+ usedByExports: undefined | boolean | Set<string>,
17959
18948
  moduleGraph: ModuleGraph,
17960
18949
  runtime: RuntimeSpec
17961
18950
  ) => boolean;
@@ -18223,42 +19212,6 @@ declare namespace exports {
18223
19212
  export { SyncModuleIdsPlugin };
18224
19213
  }
18225
19214
  }
18226
- export type ExternalItemFunctionCallback = (
18227
- data: ExternalItemFunctionData,
18228
- callback: (
18229
- err?: null | Error,
18230
- result?: string | boolean | string[] | { [index: string]: any }
18231
- ) => void
18232
- ) => void;
18233
- export type ExternalItemFunctionDataGetResolve = (
18234
- options?: ResolveOptions
18235
- ) =>
18236
- | ((
18237
- context: string,
18238
- request: string,
18239
- callback: (
18240
- err?: null | Error,
18241
- result?: string | false,
18242
- resolveRequest?: ResolveRequest
18243
- ) => void
18244
- ) => void)
18245
- | ((context: string, request: string) => Promise<string>);
18246
- export type ExternalItemFunctionDataGetResolveCallbackResult = (
18247
- context: string,
18248
- request: string,
18249
- callback: (
18250
- err?: null | Error,
18251
- result?: string | false,
18252
- resolveRequest?: ResolveRequest
18253
- ) => void
18254
- ) => void;
18255
- export type ExternalItemFunctionDataGetResolveResult = (
18256
- context: string,
18257
- request: string
18258
- ) => Promise<string>;
18259
- export type ExternalItemFunctionPromise = (
18260
- data: ExternalItemFunctionData
18261
- ) => Promise<ExternalItemValue>;
18262
19215
  export type RuleSetUseFunction = (data: EffectData) =>
18263
19216
  | string
18264
19217
  | RuleSetUseFunction
@@ -18302,6 +19255,42 @@ declare namespace exports {
18302
19255
  this: Compiler,
18303
19256
  compiler: Compiler
18304
19257
  ) => void;
19258
+ export type ExternalItemFunctionCallback = (
19259
+ data: ExternalItemFunctionData,
19260
+ callback: (
19261
+ err?: null | Error,
19262
+ result?: string | boolean | string[] | { [index: string]: any }
19263
+ ) => void
19264
+ ) => void;
19265
+ export type ExternalItemFunctionDataGetResolve = (
19266
+ options?: ResolveOptions
19267
+ ) =>
19268
+ | ((
19269
+ context: string,
19270
+ request: string,
19271
+ callback: (
19272
+ err?: null | Error,
19273
+ result?: string | false,
19274
+ resolveRequest?: ResolveRequest
19275
+ ) => void
19276
+ ) => void)
19277
+ | ((context: string, request: string) => Promise<string>);
19278
+ export type ExternalItemFunctionDataGetResolveCallbackResult = (
19279
+ context: string,
19280
+ request: string,
19281
+ callback: (
19282
+ err?: null | Error,
19283
+ result?: string | false,
19284
+ resolveRequest?: ResolveRequest
19285
+ ) => void
19286
+ ) => void;
19287
+ export type ExternalItemFunctionDataGetResolveResult = (
19288
+ context: string,
19289
+ request: string
19290
+ ) => Promise<string>;
19291
+ export type ExternalItemFunctionPromise = (
19292
+ data: ExternalItemFunctionData
19293
+ ) => Promise<ExternalItemValue>;
18305
19294
  export {
18306
19295
  AutomaticPrefetchPlugin,
18307
19296
  AsyncDependenciesBlock,
@@ -18367,7 +19356,6 @@ declare namespace exports {
18367
19356
  EntryObject,
18368
19357
  ExternalItem,
18369
19358
  ExternalItemFunction,
18370
- ExternalItemFunctionData,
18371
19359
  ExternalItemObjectKnown,
18372
19360
  ExternalItemObjectUnknown,
18373
19361
  ExternalItemValue,
@@ -18389,12 +19377,14 @@ declare namespace exports {
18389
19377
  WebpackOptionsNormalized,
18390
19378
  WebpackPluginInstance,
18391
19379
  ChunkGroup,
19380
+ AssetEmittedInfo,
18392
19381
  Asset,
18393
19382
  AssetInfo,
18394
19383
  EntryOptions,
18395
19384
  PathData,
18396
- AssetEmittedInfo,
19385
+ CodeGenerationResults,
18397
19386
  Entrypoint,
19387
+ ExternalItemFunctionData,
18398
19388
  MultiCompilerOptions,
18399
19389
  MultiConfiguration,
18400
19390
  MultiStats,
@@ -18438,6 +19428,9 @@ declare namespace exports {
18438
19428
  LoaderContextDeclarationsIndex as LoaderContext
18439
19429
  };
18440
19430
  }
19431
+ declare const idsSymbolCommonJsExportRequireDependency: unique symbol;
19432
+ declare const idsSymbolHarmonyExportImportedSpecifierDependency: unique symbol;
19433
+ declare const idsSymbolHarmonyImportSpecifierDependency: unique symbol;
18441
19434
  declare const topLevelSymbolTag: unique symbol;
18442
19435
 
18443
19436
  export = exports;