webpack 5.101.3 → 5.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) 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 +35 -25
  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 +2 -1
  13. package/lib/CompatibilityPlugin.js +29 -12
  14. package/lib/Compilation.js +204 -185
  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 +22 -20
  21. package/lib/ContextModuleFactory.js +30 -11
  22. package/lib/ContextReplacementPlugin.js +38 -15
  23. package/lib/DefinePlugin.js +4 -8
  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 +1 -3
  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 +96 -78
  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 +41 -24
  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 +145 -88
  63. package/lib/NormalModuleFactory.js +59 -40
  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 +12 -11
  75. package/lib/SourceMapDevToolModuleOptionsPlugin.js +2 -2
  76. package/lib/SourceMapDevToolPlugin.js +6 -11
  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 +166 -0
  85. package/lib/asset/AssetBytesParser.js +37 -0
  86. package/lib/asset/AssetGenerator.js +20 -34
  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/config/defaults.js +155 -21
  98. package/lib/config/normalization.js +18 -3
  99. package/lib/container/ContainerEntryDependency.js +0 -1
  100. package/lib/container/ContainerEntryModule.js +3 -7
  101. package/lib/container/ContainerPlugin.js +1 -2
  102. package/lib/container/ContainerReferencePlugin.js +0 -1
  103. package/lib/container/FallbackDependency.js +2 -1
  104. package/lib/container/FallbackModule.js +6 -7
  105. package/lib/container/ModuleFederationPlugin.js +0 -1
  106. package/lib/container/RemoteModule.js +8 -8
  107. package/lib/container/RemoteRuntimeModule.js +2 -2
  108. package/lib/css/CssGenerator.js +3 -6
  109. package/lib/css/CssLoadingRuntimeModule.js +6 -9
  110. package/lib/css/CssModulesPlugin.js +11 -13
  111. package/lib/css/CssParser.js +3 -3
  112. package/lib/css/walkCssTokens.js +1 -1
  113. package/lib/debug/ProfilingPlugin.js +35 -8
  114. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +12 -17
  115. package/lib/dependencies/AMDPlugin.js +2 -2
  116. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -2
  117. package/lib/dependencies/CachedConstDependency.js +0 -4
  118. package/lib/dependencies/CommonJsExportRequireDependency.js +20 -14
  119. package/lib/dependencies/CommonJsExportsDependency.js +2 -1
  120. package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -5
  121. package/lib/dependencies/CommonJsFullRequireDependency.js +6 -4
  122. package/lib/dependencies/CommonJsImportsParserPlugin.js +16 -7
  123. package/lib/dependencies/CommonJsRequireContextDependency.js +1 -1
  124. package/lib/dependencies/CommonJsSelfReferenceDependency.js +4 -4
  125. package/lib/dependencies/ConstDependency.js +2 -2
  126. package/lib/dependencies/ContextDependency.js +9 -4
  127. package/lib/dependencies/ContextDependencyHelpers.js +2 -2
  128. package/lib/dependencies/ContextDependencyTemplateAsId.js +9 -9
  129. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +9 -9
  130. package/lib/dependencies/ContextElementDependency.js +22 -11
  131. package/lib/dependencies/CssIcssImportDependency.js +0 -2
  132. package/lib/dependencies/CssIcssSymbolDependency.js +2 -2
  133. package/lib/dependencies/CssImportDependency.js +0 -8
  134. package/lib/dependencies/CssLocalIdentifierDependency.js +3 -4
  135. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -2
  136. package/lib/dependencies/CssUrlDependency.js +0 -6
  137. package/lib/dependencies/ExportsInfoDependency.js +7 -9
  138. package/lib/dependencies/ExternalModuleDependency.js +0 -3
  139. package/lib/dependencies/ExternalModuleInitFragment.js +1 -1
  140. package/lib/dependencies/HarmonyAcceptDependency.js +1 -1
  141. package/lib/dependencies/HarmonyAcceptImportDependency.js +0 -4
  142. package/lib/dependencies/HarmonyCompatibilityDependency.js +0 -1
  143. package/lib/dependencies/HarmonyDetectionParserPlugin.js +0 -14
  144. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -3
  145. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -1
  146. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +29 -35
  147. package/lib/dependencies/HarmonyImportDependency.js +30 -14
  148. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +20 -23
  149. package/lib/dependencies/HarmonyImportSideEffectDependency.js +0 -4
  150. package/lib/dependencies/HarmonyImportSpecifierDependency.js +46 -31
  151. package/lib/dependencies/HarmonyModulesPlugin.js +3 -3
  152. package/lib/dependencies/ImportDependency.js +18 -6
  153. package/lib/dependencies/ImportEagerDependency.js +2 -3
  154. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -5
  155. package/lib/dependencies/ImportMetaContextPlugin.js +0 -1
  156. package/lib/dependencies/ImportMetaPlugin.js +2 -1
  157. package/lib/dependencies/ImportParserPlugin.js +288 -45
  158. package/lib/dependencies/ImportWeakDependency.js +2 -3
  159. package/lib/dependencies/JsonExportsDependency.js +0 -1
  160. package/lib/dependencies/LoaderDependency.js +0 -3
  161. package/lib/dependencies/LoaderImportDependency.js +0 -3
  162. package/lib/dependencies/LoaderPlugin.js +11 -5
  163. package/lib/dependencies/ModuleDecoratorDependency.js +2 -4
  164. package/lib/dependencies/ModuleDependency.js +3 -9
  165. package/lib/dependencies/NullDependency.js +2 -0
  166. package/lib/dependencies/ProvidedDependency.js +6 -8
  167. package/lib/dependencies/PureExpressionDependency.js +0 -1
  168. package/lib/dependencies/RequireEnsureDependenciesBlock.js +0 -1
  169. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -2
  170. package/lib/dependencies/RequireIncludeDependency.js +2 -2
  171. package/lib/dependencies/RequireResolveDependency.js +2 -2
  172. package/lib/dependencies/RuntimeRequirementsDependency.js +2 -3
  173. package/lib/dependencies/StaticExportsDependency.js +3 -5
  174. package/lib/dependencies/URLDependency.js +2 -7
  175. package/lib/dependencies/URLPlugin.js +1 -2
  176. package/lib/dependencies/WebAssemblyExportImportedDependency.js +2 -2
  177. package/lib/dependencies/WebAssemblyImportDependency.js +2 -2
  178. package/lib/dependencies/WebpackIsIncludedDependency.js +2 -3
  179. package/lib/dependencies/WorkerDependency.js +2 -3
  180. package/lib/dependencies/WorkerPlugin.js +3 -9
  181. package/lib/dependencies/processExportInfo.js +2 -3
  182. package/lib/esm/ModuleChunkFormatPlugin.js +0 -3
  183. package/lib/esm/ModuleChunkLoadingPlugin.js +2 -1
  184. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -7
  185. package/lib/hmr/LazyCompilationPlugin.js +6 -4
  186. package/lib/hmr/lazyCompilationBackend.js +13 -10
  187. package/lib/ids/DeterministicChunkIdsPlugin.js +0 -1
  188. package/lib/ids/NamedChunkIdsPlugin.js +1 -6
  189. package/lib/ids/NamedModuleIdsPlugin.js +1 -5
  190. package/lib/ids/NaturalChunkIdsPlugin.js +0 -1
  191. package/lib/ids/NaturalModuleIdsPlugin.js +0 -1
  192. package/lib/ids/OccurrenceChunkIdsPlugin.js +0 -1
  193. package/lib/ids/OccurrenceModuleIdsPlugin.js +0 -1
  194. package/lib/ids/SyncModuleIdsPlugin.js +4 -3
  195. package/lib/index.js +8 -7
  196. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -1
  197. package/lib/javascript/BasicEvaluatedExpression.js +13 -6
  198. package/lib/javascript/ChunkFormatHelpers.js +1 -1
  199. package/lib/javascript/CommonJsChunkFormatPlugin.js +0 -1
  200. package/lib/javascript/JavascriptGenerator.js +2 -3
  201. package/lib/javascript/JavascriptModulesPlugin.js +44 -21
  202. package/lib/javascript/JavascriptParser.js +119 -54
  203. package/lib/javascript/JavascriptParserHelpers.js +2 -2
  204. package/lib/javascript/StartupHelpers.js +2 -4
  205. package/lib/json/JsonData.js +1 -1
  206. package/lib/json/JsonGenerator.js +4 -5
  207. package/lib/json/JsonModulesPlugin.js +0 -3
  208. package/lib/json/JsonParser.js +4 -2
  209. package/lib/library/AbstractLibraryPlugin.js +2 -2
  210. package/lib/library/AmdLibraryPlugin.js +0 -1
  211. package/lib/library/AssignLibraryPlugin.js +23 -12
  212. package/lib/library/EnableLibraryPlugin.js +7 -11
  213. package/lib/library/ExportPropertyLibraryPlugin.js +8 -20
  214. package/lib/library/JsonpLibraryPlugin.js +5 -2
  215. package/lib/library/ModuleLibraryPlugin.js +88 -43
  216. package/lib/library/SystemLibraryPlugin.js +0 -1
  217. package/lib/library/UmdLibraryPlugin.js +12 -18
  218. package/lib/logging/Logger.js +12 -10
  219. package/lib/logging/createConsoleLogger.js +15 -14
  220. package/lib/logging/truncateArgs.js +1 -1
  221. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
  222. package/lib/node/NodeWatchFileSystem.js +4 -4
  223. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
  224. package/lib/node/RequireChunkLoadingRuntimeModule.js +5 -2
  225. package/lib/node/nodeConsole.js +2 -2
  226. package/lib/optimize/AggressiveSplittingPlugin.js +2 -0
  227. package/lib/optimize/ConcatenatedModule.js +142 -100
  228. package/lib/optimize/InnerGraph.js +17 -11
  229. package/lib/optimize/InnerGraphPlugin.js +0 -3
  230. package/lib/optimize/ModuleConcatenationPlugin.js +3 -4
  231. package/lib/optimize/RuntimeChunkPlugin.js +0 -1
  232. package/lib/optimize/SideEffectsFlagPlugin.js +3 -10
  233. package/lib/optimize/SplitChunksPlugin.js +46 -40
  234. package/lib/performance/SizeLimitsPlugin.js +2 -1
  235. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +5 -7
  236. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +0 -2
  237. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +0 -1
  238. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +2 -2
  239. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +2 -2
  240. package/lib/rules/BasicMatcherRulePlugin.js +0 -2
  241. package/lib/rules/ObjectMatcherRulePlugin.js +0 -1
  242. package/lib/rules/RuleSetCompiler.js +8 -6
  243. package/lib/runtime/BaseUriRuntimeModule.js +2 -2
  244. package/lib/runtime/CompatRuntimeModule.js +0 -1
  245. package/lib/runtime/GetChunkFilenameRuntimeModule.js +8 -9
  246. package/lib/runtime/LoadScriptRuntimeModule.js +0 -2
  247. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  248. package/lib/runtime/PublicPathRuntimeModule.js +2 -2
  249. package/lib/runtime/StartupEntrypointRuntimeModule.js +0 -1
  250. package/lib/runtime/SystemContextRuntimeModule.js +0 -2
  251. package/lib/runtime/ToBinaryRuntimeModule.js +64 -0
  252. package/lib/schemes/DataUriPlugin.js +2 -28
  253. package/lib/schemes/FileUriPlugin.js +5 -2
  254. package/lib/schemes/HttpUriPlugin.js +4 -2
  255. package/lib/schemes/VirtualUrlPlugin.js +11 -11
  256. package/lib/serialization/NullPrototypeObjectSerializer.js +5 -3
  257. package/lib/serialization/ObjectMiddleware.js +30 -19
  258. package/lib/serialization/SerializerMiddleware.js +1 -3
  259. package/lib/serialization/types.js +1 -1
  260. package/lib/sharing/ConsumeSharedModule.js +3 -5
  261. package/lib/sharing/ConsumeSharedPlugin.js +2 -4
  262. package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -6
  263. package/lib/sharing/ProvideSharedModule.js +3 -7
  264. package/lib/sharing/SharePlugin.js +0 -2
  265. package/lib/sharing/ShareRuntimeModule.js +4 -1
  266. package/lib/sharing/resolveMatchedConfigs.js +14 -6
  267. package/lib/sharing/utils.js +0 -6
  268. package/lib/stats/DefaultStatsFactoryPlugin.js +178 -94
  269. package/lib/stats/DefaultStatsPresetPlugin.js +15 -9
  270. package/lib/stats/DefaultStatsPrinterPlugin.js +77 -113
  271. package/lib/stats/StatsFactory.js +14 -11
  272. package/lib/url/URLParserPlugin.js +2 -4
  273. package/lib/util/ArrayHelpers.js +4 -4
  274. package/lib/util/AsyncQueue.js +1 -0
  275. package/lib/util/LazySet.js +2 -2
  276. package/lib/util/StackedCacheMap.js +0 -2
  277. package/lib/util/TupleSet.js +9 -4
  278. package/lib/util/URLAbsoluteSpecifier.js +0 -1
  279. package/lib/util/WeakTupleMap.js +1 -1
  280. package/lib/util/chainedImports.js +3 -1
  281. package/lib/util/cleverMerge.js +15 -18
  282. package/lib/util/comparators.js +2 -4
  283. package/lib/util/compileBooleanMatcher.js +11 -9
  284. package/lib/util/concatenate.js +1 -2
  285. package/lib/util/create-schema-validation.js +0 -1
  286. package/lib/util/dataURL.js +39 -0
  287. package/lib/util/deprecation.js +29 -31
  288. package/lib/util/deterministicGrouping.js +34 -30
  289. package/lib/util/extractSourceMap.js +319 -0
  290. package/lib/util/findGraphRoots.js +15 -5
  291. package/lib/util/fs.js +29 -8
  292. package/lib/util/semver.js +9 -8
  293. package/lib/util/smartGrouping.js +41 -26
  294. package/lib/util/traverseDestructuringAssignmentProperties.js +45 -0
  295. package/lib/wasm/EnableWasmLoadingPlugin.js +3 -2
  296. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
  297. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +2 -13
  298. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -9
  299. package/lib/wasm-async/AsyncWebAssemblyParser.js +2 -1
  300. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +6 -4
  301. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -3
  302. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -4
  303. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -7
  304. package/lib/wasm-sync/WebAssemblyParser.js +1 -4
  305. package/lib/web/JsonpChunkLoadingPlugin.js +2 -1
  306. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  307. package/lib/web/JsonpTemplatePlugin.js +0 -1
  308. package/lib/webpack.js +21 -8
  309. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -1
  310. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  311. package/package.json +12 -12
  312. package/schemas/WebpackOptions.check.js +1 -1
  313. package/schemas/WebpackOptions.json +77 -93
  314. package/schemas/plugins/BannerPlugin.check.js +1 -1
  315. package/schemas/plugins/BannerPlugin.json +4 -0
  316. package/schemas/plugins/IgnorePlugin.json +1 -1
  317. package/schemas/plugins/ProgressPlugin.json +1 -1
  318. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  319. package/schemas/plugins/SourceMapDevToolPlugin.json +5 -1
  320. package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
  321. package/types.d.ts +1129 -530
  322. package/SECURITY.md +0 -9
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,
@@ -32,9 +31,9 @@ import {
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,13 +87,18 @@ 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";
101
+ import { ListenOptions } from "net";
98
102
  import { validate as validateFunction } from "schema-utils";
99
103
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
100
104
  import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
@@ -189,6 +193,20 @@ declare interface AdditionalData {
189
193
  [index: string]: any;
190
194
  webpackAST: object;
191
195
  }
196
+ type AfterContextResolveData = ContextResolveData &
197
+ ContextOptions & {
198
+ resource: string | string[];
199
+ resourceQuery?: string;
200
+ resourceFragment?: string;
201
+ resolveDependencies: (
202
+ fs: InputFileSystem,
203
+ options: ContextModuleOptions,
204
+ callback: (
205
+ err: null | Error,
206
+ dependencies?: ContextElementDependency[]
207
+ ) => void
208
+ ) => void;
209
+ };
192
210
  declare class AggressiveMergingPlugin {
193
211
  constructor(options?: AggressiveMergingPluginOptions);
194
212
  options: AggressiveMergingPluginOptions;
@@ -245,6 +263,10 @@ type AliasOptionNewRequest = string | false | string[];
245
263
  declare interface AliasOptions {
246
264
  [index: string]: AliasOptionNewRequest;
247
265
  }
266
+ type AnyLoaderContext = NormalModuleLoaderContext<any> &
267
+ LoaderRunnerLoaderContext<any> &
268
+ LoaderPluginLoaderContext &
269
+ HotModuleReplacementPluginLoaderContext;
248
270
  declare interface Argument {
249
271
  description?: string;
250
272
  simpleType: SimpleType;
@@ -494,7 +516,7 @@ declare interface BannerPluginOptions {
494
516
  /**
495
517
  * Exclude all modules matching any of these conditions.
496
518
  */
497
- exclude?: string | RegExp | Rule[];
519
+ exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
498
520
 
499
521
  /**
500
522
  * If true, banner will be placed at the end of the output.
@@ -504,7 +526,7 @@ declare interface BannerPluginOptions {
504
526
  /**
505
527
  * Include all modules matching any of these conditions.
506
528
  */
507
- include?: string | RegExp | Rule[];
529
+ include?: string | RegExp | Rule[] | ((str: string) => boolean);
508
530
 
509
531
  /**
510
532
  * If true, banner will not be wrapped in a comment.
@@ -519,7 +541,7 @@ declare interface BannerPluginOptions {
519
541
  /**
520
542
  * Include all modules that pass test assertion.
521
543
  */
522
- test?: string | RegExp | Rule[];
544
+ test?: string | RegExp | Rule[] | ((str: string) => boolean);
523
545
  }
524
546
  declare interface BaseResolveRequest {
525
547
  /**
@@ -604,9 +626,9 @@ declare abstract class BasicEvaluatedExpression {
604
626
  getMemberRanges?: () => [number, number][];
605
627
  expression?:
606
628
  | Program
607
- | ImportDeclarationImport
608
- | ExportNamedDeclarationImport
609
- | ExportAllDeclarationImport
629
+ | ImportDeclaration
630
+ | ExportNamedDeclaration
631
+ | ExportAllDeclaration
610
632
  | ImportExpressionImport
611
633
  | UnaryExpression
612
634
  | ArrayExpression
@@ -835,9 +857,9 @@ declare abstract class BasicEvaluatedExpression {
835
857
  setExpression(
836
858
  expression?:
837
859
  | Program
838
- | ImportDeclarationImport
839
- | ExportNamedDeclarationImport
840
- | ExportAllDeclarationImport
860
+ | ImportDeclaration
861
+ | ExportNamedDeclaration
862
+ | ExportAllDeclaration
841
863
  | ImportExpressionImport
842
864
  | UnaryExpression
843
865
  | ArrayExpression
@@ -910,6 +932,7 @@ declare abstract class BasicEvaluatedExpression {
910
932
  | TemplateElement
911
933
  ): BasicEvaluatedExpression;
912
934
  }
935
+ type BeforeContextResolveData = ContextResolveData & ContextOptions;
913
936
  declare interface Bootstrap {
914
937
  header: string[];
915
938
  beforeStartup: string[];
@@ -985,14 +1008,7 @@ declare const CIRCULAR_CONNECTION: unique symbol;
985
1008
  declare class CacheClass {
986
1009
  constructor();
987
1010
  hooks: {
988
- get: AsyncSeriesBailHook<
989
- [
990
- string,
991
- null | Etag,
992
- ((result: any, callback: (err?: Error) => void) => void)[]
993
- ],
994
- any
995
- >;
1011
+ get: AsyncSeriesBailHook<[string, null | Etag, GotHandler<any>[]], any>;
996
1012
  store: AsyncParallelHook<[string, null | Etag, any]>;
997
1013
  storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
998
1014
  beginIdle: SyncHook<[]>;
@@ -1162,7 +1178,7 @@ declare interface CallExpressionInfo {
1162
1178
  getMemberRanges: () => [number, number][];
1163
1179
  }
1164
1180
  declare interface CallbackAsyncQueue<T> {
1165
- (err?: null | WebpackError, result?: null | T): any;
1181
+ (err?: null | WebpackError, result?: null | T): void;
1166
1182
  }
1167
1183
  declare interface CallbackCacheCache<T> {
1168
1184
  (err: null | WebpackError, result?: T): void;
@@ -1170,20 +1186,14 @@ declare interface CallbackCacheCache<T> {
1170
1186
  declare interface CallbackCacheCacheFacade<T> {
1171
1187
  (err?: null | Error, result?: null | T): void;
1172
1188
  }
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
1189
  declare interface CallbackNormalErrorCache<T> {
1180
1190
  (err?: null | Error, result?: T): void;
1181
1191
  }
1182
- declare interface CallbackNormalModuleFactory<T> {
1183
- (err?: null | Error, stats?: T): void;
1192
+ declare interface CallbackWebpackFunction_1<T> {
1193
+ (err: null | Error, result?: T): void;
1184
1194
  }
1185
- declare interface CallbackWebpack<T> {
1186
- (err: null | Error, stats?: T): void;
1195
+ declare interface CallbackWebpackFunction_2<T, R = void> {
1196
+ (err: null | Error, result?: T): R;
1187
1197
  }
1188
1198
  type Cell<T> = undefined | T;
1189
1199
  type ChildrenStatsOptions = undefined | string | boolean | StatsOptions;
@@ -1262,7 +1272,7 @@ declare class Chunk {
1262
1272
  chunkGraph: ChunkGraph,
1263
1273
  includeDirectChildren?: boolean,
1264
1274
  filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1265
- ): Record<string | number, Record<string, (string | number)[]>>;
1275
+ ): ChunkChildIdsByOrdersMapByData;
1266
1276
  hasChildByOrder(
1267
1277
  chunkGraph: ChunkGraph,
1268
1278
  type: string,
@@ -1270,6 +1280,12 @@ declare class Chunk {
1270
1280
  filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1271
1281
  ): boolean;
1272
1282
  }
1283
+ declare interface ChunkChildIdsByOrdersMap {
1284
+ [index: string]: ChunkId[];
1285
+ }
1286
+ declare interface ChunkChildIdsByOrdersMapByData {
1287
+ [index: string]: ChunkChildIdsByOrdersMap;
1288
+ }
1273
1289
  declare class ChunkGraph {
1274
1290
  constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
1275
1291
  moduleGraph: ModuleGraph;
@@ -1327,17 +1343,17 @@ declare class ChunkGraph {
1327
1343
  chunk: Chunk,
1328
1344
  filterFn: (m: Module) => boolean,
1329
1345
  includeAllChunks?: boolean
1330
- ): Record<string | number, (string | number)[]>;
1346
+ ): ChunkModuleIdMapEs5Alias_2;
1331
1347
  getChunkModuleRenderedHashMap(
1332
1348
  chunk: Chunk,
1333
1349
  filterFn: (m: Module) => boolean,
1334
1350
  hashLength?: number,
1335
1351
  includeAllChunks?: boolean
1336
- ): Record<string | number, Record<string | number, string>>;
1352
+ ): ChunkModuleHashMap;
1337
1353
  getChunkConditionMap(
1338
1354
  chunk: Chunk,
1339
1355
  filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1340
- ): Record<string | number, boolean>;
1356
+ ): Record<ChunkId, boolean>;
1341
1357
  hasModuleInGraph(
1342
1358
  chunk: Chunk,
1343
1359
  filterFn: (m: Module) => boolean,
@@ -1397,8 +1413,8 @@ declare class ChunkGraph {
1397
1413
  disconnectChunkGroup(chunkGroup: ChunkGroup): void;
1398
1414
  getModuleId(module: Module): null | string | number;
1399
1415
  setModuleId(module: Module, id: ModuleId): void;
1400
- getRuntimeId(runtime: string): string | number;
1401
- setRuntimeId(runtime: string, id: string | number): void;
1416
+ getRuntimeId(runtime: string): RuntimeId;
1417
+ setRuntimeId(runtime: string, id: RuntimeId): void;
1402
1418
  hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
1403
1419
  getModuleHash(module: Module, runtime: RuntimeSpec): string;
1404
1420
  getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
@@ -1580,13 +1596,25 @@ declare interface ChunkHashes {
1580
1596
  }
1581
1597
  type ChunkId = string | number;
1582
1598
  declare interface ChunkMaps {
1583
- hash: Record<string | number, string>;
1584
- contentHash: Record<string | number, Record<string, string>>;
1585
- name: Record<string | number, string>;
1599
+ hash: Record<ChunkId, string>;
1600
+ contentHash: Record<ChunkId, Record<string, string>>;
1601
+ name: Record<ChunkId, string>;
1602
+ }
1603
+ declare interface ChunkModuleHashMap {
1604
+ [index: number]: IdToHashMap;
1605
+ [index: string]: IdToHashMap;
1586
1606
  }
1587
1607
  declare interface ChunkModuleHashes {
1588
1608
  [index: string]: string;
1589
1609
  }
1610
+ declare interface ChunkModuleIdMapEs5Alias_1 {
1611
+ [index: number]: ChunkId[];
1612
+ [index: string]: ChunkId[];
1613
+ }
1614
+ declare interface ChunkModuleIdMapEs5Alias_2 {
1615
+ [index: number]: ModuleId[];
1616
+ [index: string]: ModuleId[];
1617
+ }
1590
1618
  declare class ChunkModuleIdRangePlugin {
1591
1619
  constructor(options: ChunkModuleIdRangePluginOptions);
1592
1620
  options: ChunkModuleIdRangePluginOptions;
@@ -1622,8 +1650,8 @@ declare interface ChunkModuleIds {
1622
1650
  [index: string]: ModuleId[];
1623
1651
  }
1624
1652
  declare interface ChunkModuleMaps {
1625
- id: Record<string | number, (string | number)[]>;
1626
- hash: Record<string | number, string>;
1653
+ id: ChunkModuleIdMapEs5Alias_1;
1654
+ hash: chunkModuleHashMap;
1627
1655
  }
1628
1656
  type ChunkName = null | string;
1629
1657
  declare interface ChunkPathData {
@@ -1786,7 +1814,7 @@ declare abstract class ChunkTemplate {
1786
1814
  ) => void;
1787
1815
  };
1788
1816
  }>;
1789
- get outputOptions(): Output;
1817
+ get outputOptions(): OutputNormalizedWithDefaults;
1790
1818
  }
1791
1819
 
1792
1820
  /**
@@ -1801,7 +1829,7 @@ declare interface CleanOptions {
1801
1829
  /**
1802
1830
  * Keep these assets.
1803
1831
  */
1804
- keep?: string | RegExp | ((filename: string) => boolean);
1832
+ keep?: string | RegExp | ((path: string) => undefined | boolean);
1805
1833
  }
1806
1834
  declare class CleanPlugin {
1807
1835
  constructor(options?: CleanOptions);
@@ -1813,7 +1841,7 @@ declare class CleanPlugin {
1813
1841
  /**
1814
1842
  * Keep these assets.
1815
1843
  */
1816
- keep?: string | RegExp | ((filename: string) => boolean);
1844
+ keep?: string | RegExp | ((path: string) => undefined | boolean);
1817
1845
  };
1818
1846
 
1819
1847
  /**
@@ -1891,7 +1919,7 @@ declare interface CodeGenerationResult {
1891
1919
  /**
1892
1920
  * the resulting data for all source types
1893
1921
  */
1894
- data?: Map<string, any>;
1922
+ data?: CodeGenerationResultData;
1895
1923
 
1896
1924
  /**
1897
1925
  * the runtime requirements
@@ -1903,6 +1931,14 @@ declare interface CodeGenerationResult {
1903
1931
  */
1904
1932
  hash?: string;
1905
1933
  }
1934
+ type CodeGenerationResultData = Map<"topLevelDeclarations", Set<string>> &
1935
+ Map<"chunkInitFragments", InitFragment<any>[]> &
1936
+ Map<"url", { "css-url": string }> &
1937
+ Map<"filename", string> &
1938
+ Map<"assetInfo", AssetInfo> &
1939
+ Map<"fullContentHash", string> &
1940
+ Map<"share-init", [{ shareScope: string; initStage: number; init: string }]> &
1941
+ Map<string, any>;
1906
1942
  declare abstract class CodeGenerationResults {
1907
1943
  map: Map<Module, RuntimeSpecMap<CodeGenerationResult, CodeGenerationResult>>;
1908
1944
  get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
@@ -2008,6 +2044,10 @@ declare interface ColorsOptions {
2008
2044
  */
2009
2045
  useColor?: boolean;
2010
2046
  }
2047
+ declare interface CommonJsImportSettings {
2048
+ name?: string;
2049
+ context: string;
2050
+ }
2011
2051
  declare interface Comparator<T> {
2012
2052
  (a: T, b: T): 0 | 1 | -1;
2013
2053
  }
@@ -2015,6 +2055,15 @@ declare class CompatSource extends Source {
2015
2055
  constructor(sourceLike: SourceLike);
2016
2056
  static from(sourceLike: SourceLike): Source;
2017
2057
  }
2058
+ declare interface CompatibilitySettings {
2059
+ name: string;
2060
+ declaration: CompatibilitySettingsDeclaration;
2061
+ }
2062
+ declare interface CompatibilitySettingsDeclaration {
2063
+ updated: boolean;
2064
+ loc: DependencyLocation;
2065
+ range: [number, number];
2066
+ }
2018
2067
  declare class Compilation {
2019
2068
  /**
2020
2069
  * Creates an instance of Compilation.
@@ -2030,7 +2079,8 @@ declare class Compilation {
2030
2079
  failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
2031
2080
  succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
2032
2081
  dependencyReferencedExports: SyncWaterfallHook<
2033
- [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
2082
+ [(string[] | ReferencedExport)[], Dependency, RuntimeSpec],
2083
+ (string[] | ReferencedExport)[]
2034
2084
  >;
2035
2085
  executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
2036
2086
  prepareModuleExecution: AsyncParallelHook<
@@ -2146,18 +2196,22 @@ declare class Compilation {
2146
2196
  needAdditionalSeal: SyncBailHook<[], boolean | void>;
2147
2197
  afterSeal: AsyncSeriesHook<[]>;
2148
2198
  renderManifest: SyncWaterfallHook<
2149
- [RenderManifestEntry[], RenderManifestOptions]
2199
+ [RenderManifestEntry[], RenderManifestOptions],
2200
+ RenderManifestEntry[]
2150
2201
  >;
2151
2202
  fullHash: SyncHook<[Hash]>;
2152
2203
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
2153
2204
  moduleAsset: SyncHook<[Module, string]>;
2154
2205
  chunkAsset: SyncHook<[Chunk, string]>;
2155
- assetPath: SyncWaterfallHook<[string, PathData, undefined | AssetInfo]>;
2206
+ assetPath: SyncWaterfallHook<
2207
+ [string, PathData, undefined | AssetInfo],
2208
+ string
2209
+ >;
2156
2210
  needAdditionalPass: SyncBailHook<[], boolean | void>;
2157
2211
  childCompiler: SyncHook<[Compiler, string, number]>;
2158
2212
  log: SyncBailHook<[string, LogEntry], boolean | void>;
2159
- processWarnings: SyncWaterfallHook<[Error[]]>;
2160
- processErrors: SyncWaterfallHook<[Error[]]>;
2213
+ processWarnings: SyncWaterfallHook<[Error[]], Error[]>;
2214
+ processErrors: SyncWaterfallHook<[Error[]], Error[]>;
2161
2215
  statsPreset: HookMap<
2162
2216
  SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
2163
2217
  >;
@@ -2166,9 +2220,7 @@ declare class Compilation {
2166
2220
  >;
2167
2221
  statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
2168
2222
  statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
2169
- get normalModuleLoader(): SyncHook<
2170
- [LoaderContextObject<any>, NormalModule]
2171
- >;
2223
+ get normalModuleLoader(): SyncHook<[AnyLoaderContext, NormalModule]>;
2172
2224
  }>;
2173
2225
  name?: string;
2174
2226
  startTime?: number;
@@ -2177,12 +2229,12 @@ declare class Compilation {
2177
2229
  resolverFactory: ResolverFactory;
2178
2230
  inputFileSystem: InputFileSystem;
2179
2231
  fileSystemInfo: FileSystemInfo;
2180
- valueCacheVersions: Map<string, string | Set<string>>;
2232
+ valueCacheVersions: Map<string, ValueCacheVersion>;
2181
2233
  requestShortener: RequestShortener;
2182
2234
  compilerPath: string;
2183
2235
  logger: WebpackLogger;
2184
- options: WebpackOptionsNormalized;
2185
- outputOptions: OutputNormalized;
2236
+ options: WebpackOptionsNormalizedWithDefaults;
2237
+ outputOptions: OutputNormalizedWithDefaults;
2186
2238
  bail: boolean;
2187
2239
  profile: boolean;
2188
2240
  params: CompilationParams;
@@ -2194,7 +2246,7 @@ declare class Compilation {
2194
2246
  moduleMemCaches2?: Map<Module, WeakTupleMap<any[], any>>;
2195
2247
  moduleGraph: ModuleGraph;
2196
2248
  chunkGraph: ChunkGraph;
2197
- codeGenerationResults: CodeGenerationResults;
2249
+ codeGenerationResults?: CodeGenerationResults;
2198
2250
  processDependenciesQueue: AsyncQueue<Module, Module, Module>;
2199
2251
  addModuleQueue: AsyncQueue<Module, string, Module>;
2200
2252
  factorizeQueue: AsyncQueue<
@@ -2228,10 +2280,10 @@ declare class Compilation {
2228
2280
  warnings: Error[];
2229
2281
  children: Compilation[];
2230
2282
  logging: Map<string, LogEntry[]>;
2231
- dependencyFactories: Map<DepConstructor, ModuleFactory>;
2283
+ dependencyFactories: Map<DependencyConstructor, ModuleFactory>;
2232
2284
  dependencyTemplates: DependencyTemplates;
2233
2285
  childrenCounters: Record<string, number>;
2234
- usedChunkIds: null | Set<string | number>;
2286
+ usedChunkIds: null | Set<number>;
2235
2287
  usedModuleIds: null | Set<number>;
2236
2288
  needAdditionalPass: boolean;
2237
2289
  builtModules: WeakSet<Module>;
@@ -2280,6 +2332,17 @@ declare class Compilation {
2280
2332
  callback: (err?: null | WebpackError, result?: null | Module) => void
2281
2333
  ): void;
2282
2334
  processModuleDependenciesNonRecursive(module: Module): void;
2335
+ factorizeModule(
2336
+ options: FactorizeModuleOptions & { factoryResult?: false },
2337
+ callback: (err?: null | WebpackError, result?: null | Module) => void
2338
+ ): void;
2339
+ factorizeModule(
2340
+ options: FactorizeModuleOptions & { factoryResult: true },
2341
+ callback: (
2342
+ err?: null | WebpackError,
2343
+ result?: null | ModuleFactoryResult
2344
+ ) => void
2345
+ ): void;
2283
2346
  handleModuleCreation(
2284
2347
  __0: HandleModuleCreationOptions,
2285
2348
  callback: (err?: null | WebpackError, result?: null | Module) => void
@@ -2436,6 +2499,11 @@ declare class Compilation {
2436
2499
  name: string,
2437
2500
  outputOptions?: Partial<OutputNormalized>,
2438
2501
  plugins?: (
2502
+ | undefined
2503
+ | null
2504
+ | false
2505
+ | ""
2506
+ | 0
2439
2507
  | ((this: Compiler, compiler: Compiler) => void)
2440
2508
  | WebpackPluginInstance
2441
2509
  )[]
@@ -2443,22 +2511,12 @@ declare class Compilation {
2443
2511
  executeModule(
2444
2512
  module: Module,
2445
2513
  options: ExecuteModuleOptions,
2446
- callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
2514
+ callback: (
2515
+ err?: null | WebpackError,
2516
+ result?: null | ExecuteModuleResult
2517
+ ) => void
2447
2518
  ): void;
2448
2519
  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
2520
 
2463
2521
  /**
2464
2522
  * Add additional assets to the compilation.
@@ -2546,31 +2604,51 @@ declare interface CompilationAssets {
2546
2604
  }
2547
2605
  declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
2548
2606
  renderModuleContent: SyncWaterfallHook<
2549
- [Source, Module, WebAssemblyRenderContext]
2607
+ [Source, Module, WebAssemblyRenderContext],
2608
+ Source
2550
2609
  >;
2551
2610
  }
2552
2611
  declare interface CompilationHooksCssModulesPlugin {
2553
2612
  renderModulePackage: SyncWaterfallHook<
2554
- [Source, Module, ChunkRenderContextCssModulesPlugin]
2613
+ [Source, Module, ChunkRenderContextCssModulesPlugin],
2614
+ Source
2555
2615
  >;
2556
2616
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
2557
2617
  }
2558
2618
  declare interface CompilationHooksJavascriptModulesPlugin {
2559
- renderModuleContent: SyncWaterfallHook<[Source, Module, ModuleRenderContext]>;
2619
+ renderModuleContent: SyncWaterfallHook<
2620
+ [Source, Module, ModuleRenderContext],
2621
+ Source
2622
+ >;
2560
2623
  renderModuleContainer: SyncWaterfallHook<
2561
- [Source, Module, ModuleRenderContext]
2624
+ [Source, Module, ModuleRenderContext],
2625
+ Source
2626
+ >;
2627
+ renderModulePackage: SyncWaterfallHook<
2628
+ [Source, Module, ModuleRenderContext],
2629
+ Source
2562
2630
  >;
2563
- renderModulePackage: SyncWaterfallHook<[Source, Module, ModuleRenderContext]>;
2564
2631
  renderChunk: SyncWaterfallHook<
2565
- [Source, RenderContextJavascriptModulesPlugin]
2632
+ [Source, RenderContextJavascriptModulesPlugin],
2633
+ Source
2634
+ >;
2635
+ renderMain: SyncWaterfallHook<
2636
+ [Source, RenderContextJavascriptModulesPlugin],
2637
+ Source
2566
2638
  >;
2567
- renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
2568
2639
  renderContent: SyncWaterfallHook<
2569
- [Source, RenderContextJavascriptModulesPlugin]
2640
+ [Source, RenderContextJavascriptModulesPlugin],
2641
+ Source
2570
2642
  >;
2571
- render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
2572
- renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
2573
- renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
2643
+ render: SyncWaterfallHook<
2644
+ [Source, RenderContextJavascriptModulesPlugin],
2645
+ Source
2646
+ >;
2647
+ renderStartup: SyncWaterfallHook<
2648
+ [Source, Module, StartupRenderContext],
2649
+ Source
2650
+ >;
2651
+ renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext], string>;
2574
2652
  inlineInRuntimeBailout: SyncBailHook<
2575
2653
  [Module, Partial<RenderBootstrapContext>],
2576
2654
  string | void
@@ -2678,28 +2756,39 @@ declare class Compiler {
2678
2756
  watchMode: boolean;
2679
2757
  getCache(name: string): CacheFacade;
2680
2758
  getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
2681
- watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
2682
- run(callback: RunCallback<Stats>): void;
2759
+ watch(
2760
+ watchOptions: WatchOptions,
2761
+ handler: CallbackWebpackFunction_2<Stats, void>
2762
+ ): undefined | Watching;
2763
+ run(callback: CallbackWebpackFunction_2<Stats, void>): void;
2683
2764
  runAsChild(
2684
2765
  callback: (
2685
2766
  err: null | Error,
2686
2767
  entries?: Chunk[],
2687
2768
  compilation?: Compilation
2688
- ) => any
2769
+ ) => void
2689
2770
  ): void;
2690
2771
  purgeInputFileSystem(): void;
2691
2772
  emitAssets(
2692
2773
  compilation: Compilation,
2693
- callback: CallbackFunction_2<void>
2774
+ callback: (err: null | Error, result?: void) => void
2694
2775
  ): void;
2695
- emitRecords(callback: CallbackFunction_2<void>): void;
2696
- readRecords(callback: CallbackFunction_2<void>): void;
2776
+ emitRecords(callback: (err: null | Error, result?: void) => void): void;
2777
+ readRecords(callback: (err: null | Error, result?: void) => void): void;
2697
2778
  createChildCompiler(
2698
2779
  compilation: Compilation,
2699
2780
  compilerName: string,
2700
2781
  compilerIndex: number,
2701
2782
  outputOptions?: Partial<OutputNormalized>,
2702
- plugins?: WebpackPluginInstance[]
2783
+ plugins?: (
2784
+ | undefined
2785
+ | null
2786
+ | false
2787
+ | ""
2788
+ | 0
2789
+ | ((this: Compiler, compiler: Compiler) => void)
2790
+ | WebpackPluginInstance
2791
+ )[]
2703
2792
  ): Compiler;
2704
2793
  isChild(): boolean;
2705
2794
  createCompilation(params: CompilationParams): Compilation;
@@ -2710,8 +2799,8 @@ declare class Compiler {
2710
2799
  normalModuleFactory: NormalModuleFactory;
2711
2800
  contextModuleFactory: ContextModuleFactory;
2712
2801
  };
2713
- compile(callback: RunCallback<Compilation>): void;
2714
- close(callback: RunCallback<void>): void;
2802
+ compile(callback: CallbackWebpackFunction_2<Compilation, void>): void;
2803
+ close(callback: (err: null | Error, result?: void) => void): void;
2715
2804
  }
2716
2805
  declare class ConcatSource extends Source {
2717
2806
  constructor(...args: ConcatSourceChild[]);
@@ -2821,6 +2910,7 @@ declare class ConcatenationScope {
2821
2910
  ): null | (ModuleReferenceOptions & { index: number });
2822
2911
  static DEFAULT_EXPORT: string;
2823
2912
  static NAMESPACE_OBJECT_EXPORT: string;
2913
+ static chunkUsedNames: WeakMap<Chunk, Set<string>>;
2824
2914
  }
2825
2915
 
2826
2916
  /**
@@ -3052,13 +3142,13 @@ declare interface Configuration {
3052
3142
  | boolean
3053
3143
  | StatsOptions
3054
3144
  | "none"
3055
- | "verbose"
3056
3145
  | "summary"
3057
3146
  | "errors-only"
3058
3147
  | "errors-warnings"
3059
3148
  | "minimal"
3060
3149
  | "normal"
3061
- | "detailed";
3150
+ | "detailed"
3151
+ | "verbose";
3062
3152
 
3063
3153
  /**
3064
3154
  * Environment to build for. An array of environments to build for all of them when possible.
@@ -3243,8 +3333,21 @@ declare interface ContextAlternativeRequest {
3243
3333
  context: string;
3244
3334
  request: string;
3245
3335
  }
3336
+ declare abstract class ContextDependency extends Dependency {
3337
+ options: ContextDependencyOptions;
3338
+ userRequest: string;
3339
+ critical?: string | false;
3340
+ hadGlobalOrStickyRegExp: boolean;
3341
+ request?: string;
3342
+ range?: [number, number];
3343
+ valueRange?: [number, number];
3344
+ inShorthand?: string | boolean;
3345
+ replaces?: { value: string; range: [number, number] }[];
3346
+ }
3347
+ type ContextDependencyOptions = ContextOptions & { request: string };
3246
3348
  declare abstract class ContextElementDependency extends ModuleDependency {
3247
3349
  referencedExports?: null | string[][];
3350
+ attributes?: ImportAttributes;
3248
3351
  }
3249
3352
  declare class ContextExclusionPlugin {
3250
3353
  constructor(negativeMatcher: RegExp);
@@ -3275,17 +3378,27 @@ type ContextMode =
3275
3378
  | "async-weak";
3276
3379
  declare abstract class ContextModuleFactory extends ModuleFactory {
3277
3380
  hooks: Readonly<{
3278
- beforeResolve: AsyncSeriesWaterfallHook<[any]>;
3279
- afterResolve: AsyncSeriesWaterfallHook<[any]>;
3280
- contextModuleFiles: SyncWaterfallHook<[string[]]>;
3381
+ beforeResolve: AsyncSeriesWaterfallHook<
3382
+ [BeforeContextResolveData],
3383
+ false | void | BeforeContextResolveData
3384
+ >;
3385
+ afterResolve: AsyncSeriesWaterfallHook<
3386
+ [AfterContextResolveData],
3387
+ false | void | AfterContextResolveData
3388
+ >;
3389
+ contextModuleFiles: SyncWaterfallHook<[string[]], string[]>;
3281
3390
  alternatives: FakeHook<
3282
3391
  Pick<
3283
- AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
3392
+ AsyncSeriesWaterfallHook<
3393
+ [ContextAlternativeRequest[]],
3394
+ ContextAlternativeRequest[]
3395
+ >,
3284
3396
  "name" | "tap" | "tapAsync" | "tapPromise"
3285
3397
  >
3286
3398
  >;
3287
3399
  alternativeRequests: AsyncSeriesWaterfallHook<
3288
- [ContextAlternativeRequest[], ContextModuleOptions]
3400
+ [ContextAlternativeRequest[], ContextModuleOptions],
3401
+ ContextAlternativeRequest[]
3289
3402
  >;
3290
3403
  }>;
3291
3404
  resolverFactory: ResolverFactory;
@@ -3295,14 +3408,20 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
3295
3408
  callback: (
3296
3409
  err: null | Error,
3297
3410
  dependencies?: ContextElementDependency[]
3298
- ) => any
3411
+ ) => void
3299
3412
  ): void;
3300
3413
  }
3301
-
3302
- declare interface ContextModuleOptions {
3414
+ type ContextModuleOptions = ContextOptions & ContextModuleOptionsExtras;
3415
+ declare interface ContextModuleOptionsExtras {
3416
+ resource: string | false | string[];
3417
+ resourceQuery?: string;
3418
+ resourceFragment?: string;
3419
+ resolveOptions?: ResolveOptions;
3420
+ }
3421
+ declare interface ContextOptions {
3303
3422
  mode: ContextMode;
3304
3423
  recursive: boolean;
3305
- regExp: RegExp;
3424
+ regExp: null | false | RegExp;
3306
3425
  namespaceObject?: boolean | "strict";
3307
3426
  addon?: string;
3308
3427
  chunkName?: null | string;
@@ -3316,22 +3435,24 @@ declare interface ContextModuleOptions {
3316
3435
  * exports referenced from modules (won't be mangled)
3317
3436
  */
3318
3437
  referencedExports?: null | string[][];
3319
- layer?: string;
3438
+ layer?: null | string;
3320
3439
  attributes?: ImportAttributes;
3321
- resource: string | false | string[];
3322
- resourceQuery?: string;
3323
- resourceFragment?: string;
3324
- resolveOptions?: ResolveOptions;
3325
3440
  }
3326
3441
  declare class ContextReplacementPlugin {
3327
3442
  constructor(
3328
3443
  resourceRegExp: RegExp,
3329
- newContentResource?: string | boolean | RegExp | ((context?: any) => void),
3444
+ newContentResource?:
3445
+ | string
3446
+ | boolean
3447
+ | RegExp
3448
+ | ((context: BeforeContextResolveData | AfterContextResolveData) => void),
3330
3449
  newContentRecursive?: boolean | RegExp | NewContentCreateContextMap,
3331
3450
  newContentRegExp?: RegExp
3332
3451
  );
3333
3452
  resourceRegExp: RegExp;
3334
- newContentCallback?: (context?: any) => void;
3453
+ newContentCallback?: (
3454
+ context: BeforeContextResolveData | AfterContextResolveData
3455
+ ) => void;
3335
3456
  newContentResource?: string;
3336
3457
  newContentCreateContextMap?: (
3337
3458
  fs: InputFileSystem,
@@ -3348,6 +3469,15 @@ declare class ContextReplacementPlugin {
3348
3469
  */
3349
3470
  apply(compiler: Compiler): void;
3350
3471
  }
3472
+ declare interface ContextResolveData {
3473
+ context: string;
3474
+ request: string;
3475
+ resolveOptions?: ResolveOptions;
3476
+ fileDependencies: LazySet<string>;
3477
+ missingDependencies: LazySet<string>;
3478
+ contextDependencies: LazySet<string>;
3479
+ dependencies: ContextDependency[];
3480
+ }
3351
3481
  type ContextTimestamp = null | ContextFileSystemInfoEntry | "ignore";
3352
3482
  declare interface ContextTimestampAndHash {
3353
3483
  safeTime: number;
@@ -3356,6 +3486,9 @@ declare interface ContextTimestampAndHash {
3356
3486
  resolved?: ResolvedContextTimestampAndHash;
3357
3487
  symlinks?: Set<string>;
3358
3488
  }
3489
+ type CreateReadStreamFSImplementation = FSImplementation & {
3490
+ read: (...args: any[]) => any;
3491
+ };
3359
3492
  type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
3360
3493
  Record<string, any>;
3361
3494
  type CreateWriteStreamFSImplementation = FSImplementation & {
@@ -3524,9 +3657,9 @@ declare class CssLoadingRuntimeModule extends RuntimeModule {
3524
3657
  static STAGE_TRIGGER: number;
3525
3658
  }
3526
3659
  declare interface CssLoadingRuntimeModulePluginHooks {
3527
- createStylesheet: SyncWaterfallHook<[string, Chunk]>;
3528
- linkPreload: SyncWaterfallHook<[string, Chunk]>;
3529
- linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
3660
+ createStylesheet: SyncWaterfallHook<[string, Chunk], string>;
3661
+ linkPreload: SyncWaterfallHook<[string, Chunk], string>;
3662
+ linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
3530
3663
  }
3531
3664
  declare abstract class CssModule extends NormalModule {
3532
3665
  cssLayer: CssLayer;
@@ -3616,7 +3749,7 @@ declare class CssModulesPlugin {
3616
3749
  ): CompilationHooksCssModulesPlugin;
3617
3750
  static getChunkFilenameTemplate(
3618
3751
  chunk: Chunk,
3619
- outputOptions: OutputNormalized
3752
+ outputOptions: OutputNormalizedWithDefaults
3620
3753
  ): TemplatePath;
3621
3754
  static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
3622
3755
  }
@@ -3670,9 +3803,6 @@ declare class DelegatedPlugin {
3670
3803
  */
3671
3804
  apply(compiler: Compiler): void;
3672
3805
  }
3673
- declare interface DepConstructor {
3674
- new (...args: any[]): Dependency;
3675
- }
3676
3806
  declare abstract class DependenciesBlock {
3677
3807
  dependencies: Dependency[];
3678
3808
  blocks: AsyncDependenciesBlock[];
@@ -3702,7 +3832,6 @@ declare interface DependenciesBlockLike {
3702
3832
  declare class Dependency {
3703
3833
  constructor();
3704
3834
  weak: boolean;
3705
- defer?: boolean;
3706
3835
  optional?: boolean;
3707
3836
  get type(): string;
3708
3837
  get category(): string;
@@ -3872,7 +4001,8 @@ declare abstract class DependencyTemplates {
3872
4001
  */
3873
4002
  declare interface DestructuringAssignmentProperty {
3874
4003
  id: string;
3875
- range?: [number, number];
4004
+ range: [number, number];
4005
+ pattern?: Set<DestructuringAssignmentProperty>;
3876
4006
  shorthand: string | boolean;
3877
4007
  }
3878
4008
  declare class DeterministicChunkIdsPlugin {
@@ -3935,7 +4065,9 @@ declare interface DeterministicModuleIdsPluginOptions {
3935
4065
  */
3936
4066
  failOnConflict?: boolean;
3937
4067
  }
3938
- type DevtoolModuleFilenameTemplate = string | ((context?: any) => string);
4068
+ type DevtoolModuleFilenameTemplate =
4069
+ | string
4070
+ | ((context: ModuleFilenameTemplateContext) => string);
3939
4071
  declare interface Dirent<T extends string | Buffer = string> {
3940
4072
  /**
3941
4073
  * true when is file, otherwise false
@@ -4225,10 +4357,10 @@ declare interface EffectData {
4225
4357
  resourceQuery?: string;
4226
4358
  resourceFragment?: string;
4227
4359
  scheme?: string;
4228
- assertions?: ImportAttributes;
4360
+ attributes?: ImportAttributes;
4229
4361
  mimetype?: string;
4230
4362
  dependency: string;
4231
- descriptionData?: Record<string, any>;
4363
+ descriptionData?: JsonObjectTypes;
4232
4364
  compiler?: string;
4233
4365
  issuer: string;
4234
4366
  issuerLayer: string;
@@ -4661,12 +4793,16 @@ declare interface EvalDevToolModulePluginOptions {
4661
4793
  /**
4662
4794
  * module filename template
4663
4795
  */
4664
- moduleFilenameTemplate?: string | ((context?: any) => string);
4796
+ moduleFilenameTemplate?:
4797
+ | string
4798
+ | ((context: ModuleFilenameTemplateContext) => string);
4665
4799
  }
4666
4800
  declare class EvalSourceMapDevToolPlugin {
4667
- constructor(inputOptions: string | SourceMapDevToolPluginOptions);
4801
+ constructor(inputOptions?: string | SourceMapDevToolPluginOptions);
4668
4802
  sourceMapComment: string;
4669
- moduleFilenameTemplate: string | ((context?: any) => string);
4803
+ moduleFilenameTemplate:
4804
+ | string
4805
+ | ((context: ModuleFilenameTemplateContext) => string);
4670
4806
  namespace: string;
4671
4807
  options: SourceMapDevToolPluginOptions;
4672
4808
 
@@ -4679,7 +4815,6 @@ type ExcludeModulesType = "module" | "chunk" | "root-of-chunk" | "nested";
4679
4815
  declare interface ExecuteModuleArgument {
4680
4816
  module: Module;
4681
4817
  moduleObject?: ExecuteModuleObject;
4682
- preparedInfo: any;
4683
4818
  codeGenerationResult: CodeGenerationResult;
4684
4819
  }
4685
4820
  declare interface ExecuteModuleContext {
@@ -4763,11 +4898,6 @@ declare interface ExperimentsCommon {
4763
4898
  */
4764
4899
  futureDefaults?: boolean;
4765
4900
 
4766
- /**
4767
- * Enable module layers.
4768
- */
4769
- layers?: boolean;
4770
-
4771
4901
  /**
4772
4902
  * Allow output javascript files as module source type.
4773
4903
  */
@@ -4777,17 +4907,14 @@ declare interface ExperimentsCommon {
4777
4907
  * Support WebAssembly as synchronous EcmaScript Module (outdated).
4778
4908
  */
4779
4909
  syncWebAssembly?: boolean;
4780
-
4781
- /**
4782
- * Allow using top-level-await in EcmaScript Modules.
4783
- */
4784
- topLevelAwait?: boolean;
4785
4910
  }
4786
4911
 
4787
4912
  /**
4788
4913
  * Enables/Disables experiments (experimental features with relax SemVer compatibility).
4789
4914
  */
4790
4915
  declare interface ExperimentsExtra {
4916
+ [index: string]: any;
4917
+
4791
4918
  /**
4792
4919
  * Build http(s): urls using a lockfile and resource content cache.
4793
4920
  */
@@ -4834,9 +4961,6 @@ declare interface ExperimentsNormalizedExtra {
4834
4961
  */
4835
4962
  lazyCompilation?: false | LazyCompilationOptions;
4836
4963
  }
4837
- type ExportAllDeclarationJavascriptParser = ExportAllDeclarationImport & {
4838
- attributes?: ImportAttribute[];
4839
- };
4840
4964
  declare abstract class ExportInfo {
4841
4965
  name: string;
4842
4966
 
@@ -4936,9 +5060,6 @@ declare abstract class ExportInfo {
4936
5060
  | "not provided";
4937
5061
  getRenameInfo(): string;
4938
5062
  }
4939
- type ExportNamedDeclarationJavascriptParser = ExportNamedDeclarationImport & {
4940
- attributes?: ImportAttribute[];
4941
- };
4942
5063
  type ExportPresenceMode = false | 0 | 1 | 2 | 3;
4943
5064
  declare interface ExportSpec {
4944
5065
  /**
@@ -5154,30 +5275,26 @@ type ExternalItemFunction =
5154
5275
  ) => void
5155
5276
  ) => void)
5156
5277
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
5157
-
5158
- /**
5159
- * Data object passed as argument when a function is set for 'externals'.
5160
- */
5161
5278
  declare interface ExternalItemFunctionData {
5162
5279
  /**
5163
- * The directory in which the request is placed.
5280
+ * the directory in which the request is placed
5164
5281
  */
5165
- context?: string;
5282
+ context: string;
5166
5283
 
5167
5284
  /**
5168
- * Contextual information.
5285
+ * contextual information
5169
5286
  */
5170
- contextInfo?: ModuleFactoryCreateDataContextInfo;
5287
+ contextInfo: ModuleFactoryCreateDataContextInfo;
5171
5288
 
5172
5289
  /**
5173
- * The category of the referencing dependencies.
5290
+ * the category of the referencing dependency
5174
5291
  */
5175
- dependencyType?: string;
5292
+ dependencyType: string;
5176
5293
 
5177
5294
  /**
5178
- * Get a resolve function with the current resolver options.
5295
+ * get a resolve function with the current resolver options
5179
5296
  */
5180
- getResolve?: (
5297
+ getResolve: (
5181
5298
  options?: ResolveOptions
5182
5299
  ) =>
5183
5300
  | ((
@@ -5192,9 +5309,9 @@ declare interface ExternalItemFunctionData {
5192
5309
  | ((context: string, request: string) => Promise<string>);
5193
5310
 
5194
5311
  /**
5195
- * The request as written by the user in the require/import expression/statement.
5312
+ * the request as written by the user in the require/import expression/statement
5196
5313
  */
5197
- request?: string;
5314
+ request: string;
5198
5315
  }
5199
5316
 
5200
5317
  /**
@@ -5218,7 +5335,7 @@ declare interface ExternalItemObjectUnknown {
5218
5335
  type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
5219
5336
  declare class ExternalModule extends Module {
5220
5337
  constructor(
5221
- request: string | string[] | RequestRecord,
5338
+ request: ExternalModuleRequest,
5222
5339
  type: string,
5223
5340
  userRequest: string,
5224
5341
  dependencyMeta?:
@@ -5226,7 +5343,7 @@ declare class ExternalModule extends Module {
5226
5343
  | CssImportDependencyMeta
5227
5344
  | AssetDependencyMeta
5228
5345
  );
5229
- request: string | string[] | Record<string, string | string[]>;
5346
+ request: ExternalModuleRequest;
5230
5347
  externalType: string;
5231
5348
  userRequest: string;
5232
5349
  dependencyMeta?:
@@ -5242,6 +5359,9 @@ declare class ExternalModule extends Module {
5242
5359
  normalModuleFactory: NormalModuleFactory
5243
5360
  ): void;
5244
5361
  static ModuleExternalInitFragment: typeof ModuleExternalInitFragment;
5362
+ static getExternalModuleNodeCommonjsInitFragment: (
5363
+ runtimeTemplate: RuntimeTemplate
5364
+ ) => InitFragment<ChunkRenderContextJavascriptModulesPlugin>;
5245
5365
  }
5246
5366
  declare interface ExternalModuleInfo {
5247
5367
  type: "external";
@@ -5304,6 +5424,7 @@ declare interface ExternalModuleInfo {
5304
5424
  */
5305
5425
  interopDefaultAccessName?: string;
5306
5426
  }
5427
+ type ExternalModuleRequest = string | string[] | RequestRecord;
5307
5428
  type Externals =
5308
5429
  | string
5309
5430
  | RegExp
@@ -5318,8 +5439,8 @@ type Externals =
5318
5439
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
5319
5440
  | ExternalItem[];
5320
5441
  declare class ExternalsPlugin {
5321
- constructor(type: undefined | string, externals: Externals);
5322
- type?: string;
5442
+ constructor(type: string, externals: Externals);
5443
+ type: string;
5323
5444
  externals: Externals;
5324
5445
 
5325
5446
  /**
@@ -5372,6 +5493,15 @@ declare interface ExternalsPresets {
5372
5493
  */
5373
5494
  webAsync?: boolean;
5374
5495
  }
5496
+ type ExternalsPresetsNormalizedWithDefaults = ExternalsPresets & {
5497
+ web: NonNullable<undefined | boolean>;
5498
+ node: NonNullable<undefined | boolean>;
5499
+ nwjs: NonNullable<undefined | boolean>;
5500
+ electron: NonNullable<undefined | boolean>;
5501
+ electronMain: NonNullable<undefined | boolean>;
5502
+ electronPreload: NonNullable<undefined | boolean>;
5503
+ electronRenderer: NonNullable<undefined | boolean>;
5504
+ };
5375
5505
  type ExternalsType =
5376
5506
  | "import"
5377
5507
  | "var"
@@ -5743,15 +5873,8 @@ declare interface GenerateContext {
5743
5873
  /**
5744
5874
  * get access to the code generation data
5745
5875
  */
5746
- getData?: () => GenerateContextData;
5876
+ getData?: () => CodeGenerationResultData;
5747
5877
  }
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
5878
  declare interface GeneratedSourceInfo {
5756
5879
  /**
5757
5880
  * generated line
@@ -5795,6 +5918,11 @@ declare interface GeneratorOptionsByModuleTypeKnown {
5795
5918
  */
5796
5919
  asset?: AssetGeneratorOptions;
5797
5920
 
5921
+ /**
5922
+ * No generator options are supported for this module type.
5923
+ */
5924
+ "asset/bytes"?: EmptyGeneratorOptions;
5925
+
5798
5926
  /**
5799
5927
  * Generator options for asset/inline modules.
5800
5928
  */
@@ -5805,6 +5933,11 @@ declare interface GeneratorOptionsByModuleTypeKnown {
5805
5933
  */
5806
5934
  "asset/resource"?: AssetResourceGeneratorOptions;
5807
5935
 
5936
+ /**
5937
+ * No generator options are supported for this module type.
5938
+ */
5939
+ "asset/source"?: EmptyGeneratorOptions;
5940
+
5808
5941
  /**
5809
5942
  * Generator options for css modules.
5810
5943
  */
@@ -5897,10 +6030,13 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
5897
6030
  */
5898
6031
  static STAGE_TRIGGER: number;
5899
6032
  }
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;
6033
+ declare interface GotHandler<T> {
6034
+ (result: T, callback: () => void): void;
6035
+ }
6036
+ declare interface GroupConfig<T, R> {
6037
+ getKeys: (item: T) => undefined | string[];
6038
+ getOptions?: (name: string, items: T[]) => GroupOptions;
6039
+ createGroup: (key: string, children: T[], items: T[]) => R;
5904
6040
  }
5905
6041
  declare interface GroupOptions {
5906
6042
  groupChildren?: boolean;
@@ -5976,6 +6112,8 @@ declare class HarmonyImportDependency extends ModuleDependency {
5976
6112
  defer?: boolean
5977
6113
  );
5978
6114
  sourceOrder: number;
6115
+ attributes?: ImportAttributes;
6116
+ defer?: boolean;
5979
6117
  getImportVar(moduleGraph: ModuleGraph): string;
5980
6118
  getModuleExports(__0: DependencyTemplateContext): string;
5981
6119
  getImportStatement(
@@ -6006,6 +6144,15 @@ declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
6006
6144
  referencedModule: Module
6007
6145
  ): undefined | string | boolean | SortableSet<string>;
6008
6146
  }
6147
+ declare interface HarmonySettings {
6148
+ ids: string[];
6149
+ source: string;
6150
+ sourceOrder: number;
6151
+ name: string;
6152
+ await: boolean;
6153
+ attributes?: ImportAttributes;
6154
+ defer?: boolean;
6155
+ }
6009
6156
  declare class Hash {
6010
6157
  constructor();
6011
6158
 
@@ -6190,6 +6337,10 @@ declare interface IStatsBase<T> {
6190
6337
  ctime: Date;
6191
6338
  birthtime: Date;
6192
6339
  }
6340
+ declare interface IdToHashMap {
6341
+ [index: number]: string;
6342
+ [index: string]: string;
6343
+ }
6193
6344
  declare class IgnorePlugin {
6194
6345
  constructor(options: IgnorePluginOptions);
6195
6346
  options: IgnorePluginOptions;
@@ -6197,7 +6348,9 @@ declare class IgnorePlugin {
6197
6348
  /**
6198
6349
  * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
6199
6350
  */
6200
- checkIgnore(resolveData: ResolveData): undefined | false;
6351
+ checkIgnore(
6352
+ resolveData: ResolveData | BeforeContextResolveData
6353
+ ): undefined | false;
6201
6354
 
6202
6355
  /**
6203
6356
  * Apply the plugin
@@ -6221,16 +6374,7 @@ type IgnorePluginOptions =
6221
6374
  */
6222
6375
  checkResource: (resource: string, context: string) => boolean;
6223
6376
  };
6224
- type ImportAttribute = BaseNode & {
6225
- type: "ImportAttribute";
6226
- key: Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral;
6227
- value: Literal;
6228
- };
6229
6377
  type ImportAttributes = Record<string, string> & {};
6230
- type ImportDeclarationJavascriptParser = ImportDeclarationImport & {
6231
- attributes?: ImportAttribute[];
6232
- phase?: "defer";
6233
- };
6234
6378
  declare interface ImportDependencyMeta {
6235
6379
  attributes?: ImportAttributes;
6236
6380
  externalType?: "import" | "module";
@@ -6283,6 +6427,10 @@ declare interface ImportModuleOptions {
6283
6427
  */
6284
6428
  baseUri?: string;
6285
6429
  }
6430
+ declare interface ImportSettings {
6431
+ references: string[][];
6432
+ expression: ImportExpressionJavascriptParser;
6433
+ }
6286
6434
  type ImportSource =
6287
6435
  | undefined
6288
6436
  | null
@@ -6324,7 +6472,7 @@ declare interface InfrastructureLogging {
6324
6472
  /**
6325
6473
  * Log level.
6326
6474
  */
6327
- level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
6475
+ level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
6328
6476
 
6329
6477
  /**
6330
6478
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
@@ -6335,6 +6483,26 @@ declare interface InfrastructureLogging {
6335
6483
  rows?: number;
6336
6484
  };
6337
6485
  }
6486
+ type InfrastructureLoggingNormalizedWithDefaults = InfrastructureLogging & {
6487
+ stream: NodeJS.WritableStream & {
6488
+ isTTY?: boolean;
6489
+ columns?: number;
6490
+ rows?: number;
6491
+ };
6492
+ level: NonNullable<
6493
+ undefined | "none" | "verbose" | "error" | "warn" | "info" | "log"
6494
+ >;
6495
+ debug: NonNullable<
6496
+ | undefined
6497
+ | string
6498
+ | boolean
6499
+ | RegExp
6500
+ | FilterItemTypes[]
6501
+ | ((value: string) => boolean)
6502
+ >;
6503
+ colors: NonNullable<undefined | boolean>;
6504
+ appendOnly: NonNullable<undefined | boolean>;
6505
+ };
6338
6506
  declare class InitFragment<GenerateContext> {
6339
6507
  constructor(
6340
6508
  content: undefined | string | Source,
@@ -6352,12 +6520,9 @@ declare class InitFragment<GenerateContext> {
6352
6520
  getEndContent(context: GenerateContext): undefined | string | Source;
6353
6521
  serialize(context: ObjectSerializerContext): void;
6354
6522
  deserialize(context: ObjectDeserializerContext): void;
6355
- merge: any;
6356
- getImported: any;
6357
- setImported: any;
6358
- static addToSource<Context, T>(
6523
+ static addToSource<Context>(
6359
6524
  source: Source,
6360
- initFragments: InitFragment<T>[],
6525
+ initFragments: MaybeMergeableInitFragment<Context>[],
6361
6526
  context: Context
6362
6527
  ): Source;
6363
6528
  static STAGE_CONSTANTS: number;
@@ -6436,6 +6601,8 @@ declare interface InterpolatedPathAndAssetInfo {
6436
6601
  path: string;
6437
6602
  info: AssetInfo;
6438
6603
  }
6604
+ type Issuer = undefined | null | Module;
6605
+ type IssuerLayer = null | string;
6439
6606
  declare interface Item<T> {
6440
6607
  [index: string]: string | string[] | T;
6441
6608
  }
@@ -6505,7 +6672,7 @@ declare class JavascriptModulesPlugin {
6505
6672
  ): CompilationHooksJavascriptModulesPlugin;
6506
6673
  static getChunkFilenameTemplate(
6507
6674
  chunk: Chunk,
6508
- outputOptions: Output
6675
+ outputOptions: OutputNormalizedWithDefaults
6509
6676
  ): TemplatePath;
6510
6677
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
6511
6678
  }
@@ -6627,9 +6794,9 @@ declare class JavascriptParser extends ParserClass {
6627
6794
  >;
6628
6795
  preStatement: SyncBailHook<
6629
6796
  [
6630
- | ImportDeclarationJavascriptParser
6631
- | ExportNamedDeclarationJavascriptParser
6632
- | ExportAllDeclarationJavascriptParser
6797
+ | ImportDeclaration
6798
+ | ExportNamedDeclaration
6799
+ | ExportAllDeclaration
6633
6800
  | FunctionDeclaration
6634
6801
  | MaybeNamedFunctionDeclaration
6635
6802
  | VariableDeclaration
@@ -6660,9 +6827,9 @@ declare class JavascriptParser extends ParserClass {
6660
6827
  >;
6661
6828
  blockPreStatement: SyncBailHook<
6662
6829
  [
6663
- | ImportDeclarationJavascriptParser
6664
- | ExportNamedDeclarationJavascriptParser
6665
- | ExportAllDeclarationJavascriptParser
6830
+ | ImportDeclaration
6831
+ | ExportNamedDeclaration
6832
+ | ExportAllDeclaration
6666
6833
  | FunctionDeclaration
6667
6834
  | MaybeNamedFunctionDeclaration
6668
6835
  | VariableDeclaration
@@ -6693,9 +6860,9 @@ declare class JavascriptParser extends ParserClass {
6693
6860
  >;
6694
6861
  statement: SyncBailHook<
6695
6862
  [
6696
- | ImportDeclarationJavascriptParser
6697
- | ExportNamedDeclarationJavascriptParser
6698
- | ExportAllDeclarationJavascriptParser
6863
+ | ImportDeclaration
6864
+ | ExportNamedDeclaration
6865
+ | ExportAllDeclaration
6699
6866
  | FunctionDeclaration
6700
6867
  | MaybeNamedFunctionDeclaration
6701
6868
  | VariableDeclaration
@@ -6748,33 +6915,24 @@ declare class JavascriptParser extends ParserClass {
6748
6915
  boolean | void
6749
6916
  >;
6750
6917
  label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
6751
- import: SyncBailHook<
6752
- [ImportDeclarationJavascriptParser, ImportSource],
6753
- boolean | void
6754
- >;
6918
+ import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
6755
6919
  importSpecifier: SyncBailHook<
6756
- [ImportDeclarationJavascriptParser, ImportSource, null | string, string],
6920
+ [ImportDeclaration, ImportSource, null | string, string],
6757
6921
  boolean | void
6758
6922
  >;
6759
6923
  export: SyncBailHook<
6760
- [ExportNamedDeclarationJavascriptParser | ExportDefaultDeclaration],
6924
+ [ExportNamedDeclaration | ExportDefaultDeclaration],
6761
6925
  boolean | void
6762
6926
  >;
6763
6927
  exportImport: SyncBailHook<
6764
- [
6765
- (
6766
- | ExportNamedDeclarationJavascriptParser
6767
- | ExportAllDeclarationJavascriptParser
6768
- ),
6769
- ImportSource
6770
- ],
6928
+ [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
6771
6929
  boolean | void
6772
6930
  >;
6773
6931
  exportDeclaration: SyncBailHook<
6774
6932
  [
6775
6933
  (
6776
- | ExportNamedDeclarationJavascriptParser
6777
- | ExportAllDeclarationJavascriptParser
6934
+ | ExportNamedDeclaration
6935
+ | ExportAllDeclaration
6778
6936
  | ExportDefaultDeclaration
6779
6937
  ),
6780
6938
  Declaration
@@ -6821,8 +6979,8 @@ declare class JavascriptParser extends ParserClass {
6821
6979
  exportSpecifier: SyncBailHook<
6822
6980
  [
6823
6981
  (
6824
- | ExportNamedDeclarationJavascriptParser
6825
- | ExportAllDeclarationJavascriptParser
6982
+ | ExportNamedDeclaration
6983
+ | ExportAllDeclaration
6826
6984
  | ExportDefaultDeclaration
6827
6985
  ),
6828
6986
  string,
@@ -6833,10 +6991,7 @@ declare class JavascriptParser extends ParserClass {
6833
6991
  >;
6834
6992
  exportImportSpecifier: SyncBailHook<
6835
6993
  [
6836
- (
6837
- | ExportNamedDeclarationJavascriptParser
6838
- | ExportAllDeclarationJavascriptParser
6839
- ),
6994
+ ExportNamedDeclaration | ExportAllDeclaration,
6840
6995
  ImportSource,
6841
6996
  null | string,
6842
6997
  null | string,
@@ -6867,7 +7022,10 @@ declare class JavascriptParser extends ParserClass {
6867
7022
  >;
6868
7023
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
6869
7024
  importCall: SyncBailHook<
6870
- [ImportExpressionJavascriptParser],
7025
+ [
7026
+ ImportExpressionJavascriptParser,
7027
+ undefined | SimpleCallExpression | NewExpression
7028
+ ],
6871
7029
  boolean | void
6872
7030
  >;
6873
7031
  topLevelAwait: SyncBailHook<
@@ -6961,9 +7119,9 @@ declare class JavascriptParser extends ParserClass {
6961
7119
  semicolons?: Set<number>;
6962
7120
  statementPath?: StatementPathItem[];
6963
7121
  prevStatement?:
6964
- | ImportDeclarationJavascriptParser
6965
- | ExportNamedDeclarationJavascriptParser
6966
- | ExportAllDeclarationJavascriptParser
7122
+ | ImportDeclaration
7123
+ | ExportNamedDeclaration
7124
+ | ExportAllDeclaration
6967
7125
  | ImportExpressionImport
6968
7126
  | UnaryExpression
6969
7127
  | ArrayExpression
@@ -7020,7 +7178,13 @@ declare class JavascriptParser extends ParserClass {
7020
7178
  Expression,
7021
7179
  Set<DestructuringAssignmentProperty>
7022
7180
  >;
7023
- currentTagData?: TagData;
7181
+ currentTagData?:
7182
+ | Record<string, any>
7183
+ | TopLevelSymbol
7184
+ | HarmonySettings
7185
+ | ImportSettings
7186
+ | CommonJsImportSettings
7187
+ | CompatibilitySettings;
7024
7188
  magicCommentContext: Context;
7025
7189
  destructuringAssignmentPropertiesFor(
7026
7190
  node: Expression
@@ -7065,9 +7229,9 @@ declare class JavascriptParser extends ParserClass {
7065
7229
  */
7066
7230
  modulePreWalkStatements(
7067
7231
  statements: (
7068
- | ImportDeclarationJavascriptParser
7069
- | ExportNamedDeclarationJavascriptParser
7070
- | ExportAllDeclarationJavascriptParser
7232
+ | ImportDeclaration
7233
+ | ExportNamedDeclaration
7234
+ | ExportAllDeclaration
7071
7235
  | FunctionDeclaration
7072
7236
  | VariableDeclaration
7073
7237
  | ClassDeclaration
@@ -7099,9 +7263,9 @@ declare class JavascriptParser extends ParserClass {
7099
7263
  */
7100
7264
  preWalkStatements(
7101
7265
  statements: (
7102
- | ImportDeclarationJavascriptParser
7103
- | ExportNamedDeclarationJavascriptParser
7104
- | ExportAllDeclarationJavascriptParser
7266
+ | ImportDeclaration
7267
+ | ExportNamedDeclaration
7268
+ | ExportAllDeclaration
7105
7269
  | FunctionDeclaration
7106
7270
  | VariableDeclaration
7107
7271
  | ClassDeclaration
@@ -7133,9 +7297,9 @@ declare class JavascriptParser extends ParserClass {
7133
7297
  */
7134
7298
  blockPreWalkStatements(
7135
7299
  statements: (
7136
- | ImportDeclarationJavascriptParser
7137
- | ExportNamedDeclarationJavascriptParser
7138
- | ExportAllDeclarationJavascriptParser
7300
+ | ImportDeclaration
7301
+ | ExportNamedDeclaration
7302
+ | ExportAllDeclaration
7139
7303
  | FunctionDeclaration
7140
7304
  | VariableDeclaration
7141
7305
  | ClassDeclaration
@@ -7167,9 +7331,9 @@ declare class JavascriptParser extends ParserClass {
7167
7331
  */
7168
7332
  walkStatements(
7169
7333
  statements: (
7170
- | ImportDeclarationJavascriptParser
7171
- | ExportNamedDeclarationJavascriptParser
7172
- | ExportAllDeclarationJavascriptParser
7334
+ | ImportDeclaration
7335
+ | ExportNamedDeclaration
7336
+ | ExportAllDeclaration
7173
7337
  | FunctionDeclaration
7174
7338
  | VariableDeclaration
7175
7339
  | ClassDeclaration
@@ -7201,9 +7365,9 @@ declare class JavascriptParser extends ParserClass {
7201
7365
  */
7202
7366
  preWalkStatement(
7203
7367
  statement:
7204
- | ImportDeclarationJavascriptParser
7205
- | ExportNamedDeclarationJavascriptParser
7206
- | ExportAllDeclarationJavascriptParser
7368
+ | ImportDeclaration
7369
+ | ExportNamedDeclaration
7370
+ | ExportAllDeclaration
7207
7371
  | FunctionDeclaration
7208
7372
  | MaybeNamedFunctionDeclaration
7209
7373
  | VariableDeclaration
@@ -7232,9 +7396,9 @@ declare class JavascriptParser extends ParserClass {
7232
7396
  ): void;
7233
7397
  blockPreWalkStatement(
7234
7398
  statement:
7235
- | ImportDeclarationJavascriptParser
7236
- | ExportNamedDeclarationJavascriptParser
7237
- | ExportAllDeclarationJavascriptParser
7399
+ | ImportDeclaration
7400
+ | ExportNamedDeclaration
7401
+ | ExportAllDeclaration
7238
7402
  | FunctionDeclaration
7239
7403
  | MaybeNamedFunctionDeclaration
7240
7404
  | VariableDeclaration
@@ -7263,9 +7427,9 @@ declare class JavascriptParser extends ParserClass {
7263
7427
  ): void;
7264
7428
  walkStatement(
7265
7429
  statement:
7266
- | ImportDeclarationJavascriptParser
7267
- | ExportNamedDeclarationJavascriptParser
7268
- | ExportAllDeclarationJavascriptParser
7430
+ | ImportDeclaration
7431
+ | ExportNamedDeclaration
7432
+ | ExportAllDeclaration
7269
7433
  | FunctionDeclaration
7270
7434
  | MaybeNamedFunctionDeclaration
7271
7435
  | VariableDeclaration
@@ -7365,29 +7529,19 @@ declare class JavascriptParser extends ParserClass {
7365
7529
  | ThisExpression
7366
7530
  | UpdateExpression
7367
7531
  | YieldExpression;
7368
- modulePreWalkImportDeclaration(
7369
- statement: ImportDeclarationJavascriptParser
7370
- ): void;
7532
+ modulePreWalkImportDeclaration(statement: ImportDeclaration): void;
7371
7533
  enterDeclaration(
7372
7534
  declaration: Declaration,
7373
7535
  onIdent: (ident: string, identifier: Identifier) => void
7374
7536
  ): void;
7375
- modulePreWalkExportNamedDeclaration(
7376
- statement: ExportNamedDeclarationJavascriptParser
7377
- ): void;
7378
- blockPreWalkExportNamedDeclaration(
7379
- statement: ExportNamedDeclarationJavascriptParser
7380
- ): void;
7381
- walkExportNamedDeclaration(
7382
- statement: ExportNamedDeclarationJavascriptParser
7383
- ): void;
7537
+ modulePreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7538
+ blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7539
+ walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7384
7540
  blockPreWalkExportDefaultDeclaration(
7385
7541
  statement: ExportDefaultDeclaration
7386
7542
  ): void;
7387
7543
  walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
7388
- modulePreWalkExportAllDeclaration(
7389
- statement: ExportAllDeclarationJavascriptParser
7390
- ): void;
7544
+ modulePreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
7391
7545
  preWalkVariableDeclaration(statement: VariableDeclaration): void;
7392
7546
  blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
7393
7547
  preWalkVariableDeclarator(declarator: VariableDeclarator): void;
@@ -7597,7 +7751,7 @@ declare class JavascriptParser extends ParserClass {
7597
7751
  hookMap: HookMap<SyncBailHook<T, R>>,
7598
7752
  info: ExportedVariableInfo,
7599
7753
  fallback: undefined | ((name: string) => undefined | R),
7600
- defined: undefined | ((result?: string) => any),
7754
+ defined: undefined | ((result?: string) => undefined | R),
7601
7755
  ...args: AsArray<T>
7602
7756
  ): undefined | R;
7603
7757
  callHooksForNameWithFallback<T, R>(
@@ -7637,9 +7791,9 @@ declare class JavascriptParser extends ParserClass {
7637
7791
  inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
7638
7792
  detectMode(
7639
7793
  statements: (
7640
- | ImportDeclarationJavascriptParser
7641
- | ExportNamedDeclarationJavascriptParser
7642
- | ExportAllDeclarationJavascriptParser
7794
+ | ImportDeclaration
7795
+ | ExportNamedDeclaration
7796
+ | ExportAllDeclaration
7643
7797
  | FunctionDeclaration
7644
7798
  | VariableDeclaration
7645
7799
  | ClassDeclaration
@@ -7790,11 +7944,27 @@ declare class JavascriptParser extends ParserClass {
7790
7944
  setAsiPosition(pos: number): void;
7791
7945
  unsetAsiPosition(pos: number): void;
7792
7946
  isStatementLevelExpression(expr: Expression): boolean;
7793
- getTagData(name: string, tag: symbol): undefined | TagData;
7947
+ getTagData(
7948
+ name: string,
7949
+ tag: symbol
7950
+ ):
7951
+ | undefined
7952
+ | Record<string, any>
7953
+ | TopLevelSymbol
7954
+ | HarmonySettings
7955
+ | ImportSettings
7956
+ | CommonJsImportSettings
7957
+ | CompatibilitySettings;
7794
7958
  tagVariable(
7795
7959
  name: string,
7796
7960
  tag: symbol,
7797
- data?: TagData,
7961
+ data?:
7962
+ | Record<string, any>
7963
+ | TopLevelSymbol
7964
+ | HarmonySettings
7965
+ | ImportSettings
7966
+ | CommonJsImportSettings
7967
+ | CompatibilitySettings,
7798
7968
  flags?: 0 | 1 | 2 | 4
7799
7969
  ): void;
7800
7970
  defineVariable(name: string): void;
@@ -7933,9 +8103,9 @@ declare class JavascriptParser extends ParserClass {
7933
8103
  }>;
7934
8104
  static getImportAttributes: (
7935
8105
  node:
7936
- | ImportDeclarationJavascriptParser
7937
- | ExportNamedDeclarationJavascriptParser
7938
- | ExportAllDeclarationJavascriptParser
8106
+ | ImportDeclaration
8107
+ | ExportNamedDeclaration
8108
+ | ExportAllDeclaration
7939
8109
  | ImportExpressionJavascriptParser
7940
8110
  ) => undefined | ImportAttributes;
7941
8111
  }
@@ -8245,8 +8415,8 @@ declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
8245
8415
  static STAGE_TRIGGER: number;
8246
8416
  }
8247
8417
  declare interface JsonpCompilationPluginHooks {
8248
- linkPreload: SyncWaterfallHook<[string, Chunk]>;
8249
- linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
8418
+ linkPreload: SyncWaterfallHook<[string, Chunk], string>;
8419
+ linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
8250
8420
  }
8251
8421
  declare class JsonpTemplatePlugin {
8252
8422
  constructor();
@@ -8373,7 +8543,7 @@ declare interface KnownBuildInfo {
8373
8543
  /**
8374
8544
  * using in NormalModule
8375
8545
  */
8376
- valueDependencies?: Map<string, string | Set<string>>;
8546
+ valueDependencies?: Map<string, ValueCacheVersion>;
8377
8547
 
8378
8548
  /**
8379
8549
  * using in NormalModule
@@ -8444,6 +8614,7 @@ declare interface KnownBuildMeta {
8444
8614
  exportsType?: "namespace" | "dynamic" | "default" | "flagged";
8445
8615
  defaultObject?: false | "redirect" | "redirect-warn";
8446
8616
  strictHarmonyModule?: boolean;
8617
+ treatAsCommonJs?: boolean;
8447
8618
  async?: boolean;
8448
8619
  sideEffectFree?: boolean;
8449
8620
  isCSSModule?: boolean;
@@ -8486,6 +8657,10 @@ declare interface KnownHooks {
8486
8657
  */
8487
8658
  result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
8488
8659
  }
8660
+ declare interface KnownMeta {
8661
+ importVarMap?: Map<Module, string>;
8662
+ deferredImportVarMap?: Map<Module, string>;
8663
+ }
8489
8664
  declare interface KnownNormalizedStatsOptions {
8490
8665
  context: string;
8491
8666
  requestShortener: RequestShortener;
@@ -8525,7 +8700,7 @@ declare interface KnownNormalizedStatsOptions {
8525
8700
  modulesSpace: number;
8526
8701
  chunkModulesSpace: number;
8527
8702
  nestedModulesSpace: number;
8528
- logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
8703
+ logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
8529
8704
  loggingDebug: ((value: string) => boolean)[];
8530
8705
  loggingTrace: boolean;
8531
8706
  }
@@ -8575,24 +8750,24 @@ declare interface KnownStatsChunk {
8575
8750
  hash: string;
8576
8751
  childrenByOrder: Record<string, ChunkId[]>;
8577
8752
  id?: string | number;
8578
- siblings?: (string | number)[];
8579
- parents?: (string | number)[];
8580
- children?: (string | number)[];
8753
+ siblings?: ChunkId[];
8754
+ parents?: ChunkId[];
8755
+ children?: ChunkId[];
8581
8756
  modules?: StatsModule[];
8582
8757
  filteredModules?: number;
8583
8758
  origins?: StatsChunkOrigin[];
8584
8759
  }
8585
8760
  declare interface KnownStatsChunkGroup {
8586
8761
  name?: null | string;
8587
- chunks?: (string | number)[];
8762
+ chunks?: ChunkId[];
8588
8763
  assets?: { name: string; size?: number }[];
8589
8764
  filteredAssets?: number;
8590
8765
  assetsSize?: number;
8591
8766
  auxiliaryAssets?: { name: string; size?: number }[];
8592
8767
  filteredAuxiliaryAssets?: number;
8593
8768
  auxiliaryAssetsSize?: number;
8594
- children?: { [index: string]: StatsChunkGroup[] };
8595
- childAssets?: { [index: string]: string[] };
8769
+ children?: Record<string, StatsChunkGroup[]>;
8770
+ childAssets?: Record<string, string[]>;
8596
8771
  isOverSizeLimit?: boolean;
8597
8772
  }
8598
8773
  declare interface KnownStatsChunkOrigin {
@@ -8650,14 +8825,14 @@ declare interface KnownStatsError {
8650
8825
  }
8651
8826
  declare interface KnownStatsFactoryContext {
8652
8827
  type: string;
8653
- makePathsRelative: (path: string) => string;
8654
8828
  compilation: Compilation;
8829
+ makePathsRelative: (path: string) => string;
8655
8830
  rootModules: Set<Module>;
8656
8831
  compilationFileToChunks: Map<string, Chunk[]>;
8657
8832
  compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
8658
8833
  runtime: RuntimeSpec;
8659
- cachedGetErrors: (compilation: Compilation) => WebpackError[];
8660
- cachedGetWarnings: (compilation: Compilation) => WebpackError[];
8834
+ cachedGetErrors: (compilation: Compilation) => Error[];
8835
+ cachedGetWarnings: (compilation: Compilation) => Error[];
8661
8836
  }
8662
8837
  declare interface KnownStatsLogging {
8663
8838
  entries: StatsLoggingEntry[];
@@ -8684,7 +8859,7 @@ declare interface KnownStatsModule {
8684
8859
  index2?: number;
8685
8860
  postOrderIndex?: number;
8686
8861
  size?: number;
8687
- sizes?: { [index: string]: number };
8862
+ sizes?: Record<string, number>;
8688
8863
  cacheable?: boolean;
8689
8864
  built?: boolean;
8690
8865
  codeGenerated?: boolean;
@@ -8694,8 +8869,8 @@ declare interface KnownStatsModule {
8694
8869
  orphan?: boolean;
8695
8870
  id?: string | number;
8696
8871
  issuerId?: null | string | number;
8697
- chunks?: (string | number)[];
8698
- assets?: (string | number)[];
8872
+ chunks?: ChunkId[];
8873
+ assets?: string[];
8699
8874
  dependent?: boolean;
8700
8875
  issuer?: null | string;
8701
8876
  issuerName?: null | string;
@@ -8890,7 +9065,10 @@ declare interface LazyCompilationDefaultBackendOptions {
8890
9065
  /**
8891
9066
  * Specifies where to listen to from the server.
8892
9067
  */
8893
- listen?: number | ListenOptions | ((server: Server) => void);
9068
+ listen?:
9069
+ | number
9070
+ | ListenOptions
9071
+ | ((server: ServerLazyCompilationBackend) => void);
8894
9072
 
8895
9073
  /**
8896
9074
  * Specifies the protocol the client should use to connect to the server.
@@ -8903,7 +9081,7 @@ declare interface LazyCompilationDefaultBackendOptions {
8903
9081
  server?:
8904
9082
  | ServerOptions<typeof IncomingMessage>
8905
9083
  | HttpsServerOptions
8906
- | (() => Server);
9084
+ | (() => ServerLazyCompilationBackend);
8907
9085
  }
8908
9086
 
8909
9087
  /**
@@ -8916,7 +9094,7 @@ declare interface LazyCompilationOptions {
8916
9094
  backend?:
8917
9095
  | ((
8918
9096
  compiler: Compiler,
8919
- callback: (err: null | Error, api?: BackendApi) => void
9097
+ callback: (err: null | Error, backendApi?: BackendApi) => void
8920
9098
  ) => void)
8921
9099
  | ((compiler: Compiler) => Promise<BackendApi>)
8922
9100
  | LazyCompilationDefaultBackendOptions;
@@ -9149,9 +9327,8 @@ declare interface LimitChunkCountPluginOptions {
9149
9327
  */
9150
9328
  maxChunks: number;
9151
9329
  }
9152
- type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
9153
9330
  declare interface LoadScriptCompilationHooks {
9154
- createScript: SyncWaterfallHook<[string, Chunk]>;
9331
+ createScript: SyncWaterfallHook<[string, Chunk], string>;
9155
9332
  }
9156
9333
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
9157
9334
  constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
@@ -9191,7 +9368,7 @@ type LoaderContextDeclarationsIndex<OptionsType> =
9191
9368
  LoaderRunnerLoaderContext<OptionsType> &
9192
9369
  LoaderPluginLoaderContext &
9193
9370
  HotModuleReplacementPluginLoaderContext;
9194
- type LoaderContextObject<T> = NormalModuleLoaderContext<T> &
9371
+ type LoaderContextVirtualUrlPlugin<T> = NormalModuleLoaderContext<T> &
9195
9372
  LoaderRunnerLoaderContext<T> &
9196
9373
  LoaderPluginLoaderContext &
9197
9374
  HotModuleReplacementPluginLoaderContext;
@@ -9220,8 +9397,8 @@ declare interface LoaderDefinitionFunction<
9220
9397
  declare interface LoaderItem {
9221
9398
  loader: string;
9222
9399
  options?: null | string | Record<string, any>;
9223
- ident: null | string;
9224
- type: null | string;
9400
+ ident?: null | string;
9401
+ type?: null | string;
9225
9402
  }
9226
9403
  declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
9227
9404
  default?:
@@ -9286,7 +9463,7 @@ declare interface LoaderPluginLoaderContext {
9286
9463
  importModule(
9287
9464
  request: string,
9288
9465
  options: undefined | ImportModuleOptions,
9289
- callback: (err?: null | Error, exports?: any) => any
9466
+ callback: (err?: null | Error, exports?: any) => void
9290
9467
  ): void;
9291
9468
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
9292
9469
  }
@@ -9455,8 +9632,8 @@ type LogTypeEnum =
9455
9632
  | "warn"
9456
9633
  | "info"
9457
9634
  | "log"
9458
- | "debug"
9459
9635
  | "profile"
9636
+ | "debug"
9460
9637
  | "trace"
9461
9638
  | "group"
9462
9639
  | "groupCollapsed"
@@ -9588,14 +9765,15 @@ declare abstract class MainTemplate {
9588
9765
  globalHash: { tap: () => void };
9589
9766
  hotBootstrap: { tap: () => never };
9590
9767
  bootstrap: SyncWaterfallHook<
9591
- [string, Chunk, string, ModuleTemplate, DependencyTemplates]
9768
+ [string, Chunk, string, ModuleTemplate, DependencyTemplates],
9769
+ string
9592
9770
  >;
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]>;
9771
+ localVars: SyncWaterfallHook<[string, Chunk, string], string>;
9772
+ requireExtensions: SyncWaterfallHook<[string, Chunk, string], string>;
9773
+ requireEnsure: SyncWaterfallHook<[string, Chunk, string, string], string>;
9774
+ get jsonpScript(): SyncWaterfallHook<[string, Chunk], string>;
9775
+ get linkPrefetch(): SyncWaterfallHook<[string, Chunk], string>;
9776
+ get linkPreload(): SyncWaterfallHook<[string, Chunk], string>;
9599
9777
  }>;
9600
9778
  renderCurrentHashCode: (hash: string, length?: number) => string;
9601
9779
  getPublicPath: (options: PathData) => string;
@@ -9623,11 +9801,40 @@ declare interface MapOptions {
9623
9801
  module?: boolean;
9624
9802
  }
9625
9803
  declare interface MatchObject {
9626
- test?: string | RegExp | (string | RegExp)[];
9627
- include?: string | RegExp | (string | RegExp)[];
9628
- exclude?: string | RegExp | (string | RegExp)[];
9804
+ test?:
9805
+ | string
9806
+ | RegExp
9807
+ | ((str: string) => boolean)
9808
+ | (string | RegExp | ((str: string) => boolean))[];
9809
+ include?:
9810
+ | string
9811
+ | RegExp
9812
+ | ((str: string) => boolean)
9813
+ | (string | RegExp | ((str: string) => boolean))[];
9814
+ exclude?:
9815
+ | string
9816
+ | RegExp
9817
+ | ((str: string) => boolean)
9818
+ | (string | RegExp | ((str: string) => boolean))[];
9819
+ }
9820
+ type Matcher =
9821
+ | string
9822
+ | RegExp
9823
+ | ((str: string) => boolean)
9824
+ | (string | RegExp | ((str: string) => boolean))[];
9825
+ declare interface MaybeMergeableInitFragment<GenerateContext> {
9826
+ key?: string;
9827
+ stage: number;
9828
+ position: number;
9829
+ getContent: (context: GenerateContext) => undefined | string | Source;
9830
+ getEndContent: (context: GenerateContext) => undefined | string | Source;
9831
+ merge?: (
9832
+ fragments: MaybeMergeableInitFragment<GenerateContext>
9833
+ ) => MaybeMergeableInitFragment<GenerateContext>;
9834
+ mergeAll?: (
9835
+ fragments: MaybeMergeableInitFragment<GenerateContext>[]
9836
+ ) => MaybeMergeableInitFragment<GenerateContext>[];
9629
9837
  }
9630
- type Matcher = string | RegExp | (string | RegExp)[];
9631
9838
  type Media = undefined | string;
9632
9839
 
9633
9840
  /**
@@ -9668,6 +9875,14 @@ declare interface MergeDuplicateChunksPluginOptions {
9668
9875
  */
9669
9876
  stage?: number;
9670
9877
  }
9878
+ type Meta = KnownMeta &
9879
+ Record<
9880
+ | typeof idsSymbolCommonJsExportRequireDependency
9881
+ | typeof idsSymbolHarmonyImportSpecifierDependency
9882
+ | typeof idsSymbolHarmonyExportImportedSpecifierDependency,
9883
+ string[]
9884
+ > &
9885
+ Record<string, any>;
9671
9886
  declare class MinChunkSizePlugin {
9672
9887
  constructor(options: MinChunkSizePluginOptions);
9673
9888
  options: MinChunkSizePluginOptions;
@@ -9820,7 +10035,7 @@ declare class Module extends DependenciesBlock {
9820
10035
  identifier(): string;
9821
10036
  readableIdentifier(requestShortener: RequestShortener): string;
9822
10037
  build(
9823
- options: WebpackOptionsNormalized,
10038
+ options: WebpackOptionsNormalizedWithDefaults,
9824
10039
  compilation: Compilation,
9825
10040
  resolver: ResolverWithOptions,
9826
10041
  fs: InputFileSystem,
@@ -9911,8 +10126,7 @@ declare class ModuleDependency extends Dependency {
9911
10126
  constructor(request: string);
9912
10127
  request: string;
9913
10128
  userRequest: string;
9914
- range: any;
9915
- assertions?: ImportAttributes;
10129
+ range?: [number, number];
9916
10130
  static Template: typeof DependencyTemplate;
9917
10131
  static NO_EXPORTS_REFERENCED: string[][];
9918
10132
  static EXPORTS_OBJECT_REFERENCED: string[][];
@@ -9926,10 +10140,14 @@ declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
9926
10140
  dependencyMeta?: ImportDependencyMeta,
9927
10141
  hashFunction?: string | typeof Hash
9928
10142
  );
10143
+ getImported(): Imported;
10144
+ setImported(imported: Imported): void;
9929
10145
  getNamespaceIdentifier(): string;
9930
- static addToSource<Context, T>(
10146
+ buildIdentifier(ident: string): string;
10147
+ buildImported(imported: Imported): Imported;
10148
+ static addToSource<Context>(
9931
10149
  source: Source,
9932
- initFragments: InitFragment<T>[],
10150
+ initFragments: MaybeMergeableInitFragment<Context>[],
9933
10151
  context: Context
9934
10152
  ): Source;
9935
10153
  static STAGE_CONSTANTS: number;
@@ -9955,7 +10173,7 @@ declare interface ModuleFactoryCreateData {
9955
10173
  }
9956
10174
  declare interface ModuleFactoryCreateDataContextInfo {
9957
10175
  issuer: string;
9958
- issuerLayer?: null | string;
10176
+ issuerLayer: IssuerLayer;
9959
10177
  compiler?: string;
9960
10178
  }
9961
10179
  declare interface ModuleFactoryResult {
@@ -10055,38 +10273,94 @@ declare interface ModuleFederationPluginOptions {
10055
10273
  */
10056
10274
  shared?: (string | SharedObject)[] | SharedObject;
10057
10275
  }
10058
- type ModuleFilterItemTypes =
10059
- | string
10060
- | RegExp
10061
- | ((
10062
- name: string,
10063
- module: StatsModule,
10064
- type: "module" | "chunk" | "root-of-chunk" | "nested"
10065
- ) => boolean);
10066
- declare class ModuleGraph {
10067
- constructor();
10068
- setParents(
10069
- dependency: Dependency,
10070
- block: DependenciesBlock,
10071
- module: Module,
10072
- indexInBlock?: number
10073
- ): void;
10074
- setParentDependenciesBlockIndex(dependency: Dependency, index: number): void;
10075
- getParentModule(dependency: Dependency): undefined | Module;
10076
- getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
10077
- getParentBlockIndex(dependency: Dependency): number;
10078
- setResolvedModule(
10079
- originModule: null | Module,
10080
- dependency: Dependency,
10081
- module: Module
10082
- ): void;
10083
- updateModule(dependency: Dependency, module: Module): void;
10084
- updateParent(
10085
- dependency: Dependency,
10086
- connection?: ModuleGraphConnection,
10087
- parentModule?: Module
10088
- ): void;
10089
- removeConnection(dependency: Dependency): void;
10276
+ declare interface ModuleFilenameTemplateContext {
10277
+ /**
10278
+ * the identifier of the module
10279
+ */
10280
+ identifier: string;
10281
+
10282
+ /**
10283
+ * the shortened identifier of the module
10284
+ */
10285
+ shortIdentifier: string;
10286
+
10287
+ /**
10288
+ * the resource of the module request
10289
+ */
10290
+ resource: string;
10291
+
10292
+ /**
10293
+ * the resource path of the module request
10294
+ */
10295
+ resourcePath: string;
10296
+
10297
+ /**
10298
+ * the absolute resource path of the module request
10299
+ */
10300
+ absoluteResourcePath: string;
10301
+
10302
+ /**
10303
+ * the loaders of the module request
10304
+ */
10305
+ loaders: string;
10306
+
10307
+ /**
10308
+ * the all loaders of the module request
10309
+ */
10310
+ allLoaders: string;
10311
+
10312
+ /**
10313
+ * the query of the module identifier
10314
+ */
10315
+ query: string;
10316
+
10317
+ /**
10318
+ * the module id of the module
10319
+ */
10320
+ moduleId: string;
10321
+
10322
+ /**
10323
+ * the hash of the module identifier
10324
+ */
10325
+ hash: string;
10326
+
10327
+ /**
10328
+ * the module namespace
10329
+ */
10330
+ namespace: string;
10331
+ }
10332
+ type ModuleFilterItemTypes =
10333
+ | string
10334
+ | RegExp
10335
+ | ((
10336
+ name: string,
10337
+ module: StatsModule,
10338
+ type: "module" | "chunk" | "root-of-chunk" | "nested"
10339
+ ) => boolean);
10340
+ declare class ModuleGraph {
10341
+ constructor();
10342
+ setParents(
10343
+ dependency: Dependency,
10344
+ block: DependenciesBlock,
10345
+ module: Module,
10346
+ indexInBlock?: number
10347
+ ): void;
10348
+ setParentDependenciesBlockIndex(dependency: Dependency, index: number): void;
10349
+ getParentModule(dependency: Dependency): undefined | Module;
10350
+ getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
10351
+ getParentBlockIndex(dependency: Dependency): number;
10352
+ setResolvedModule(
10353
+ originModule: null | Module,
10354
+ dependency: Dependency,
10355
+ module: Module
10356
+ ): void;
10357
+ updateModule(dependency: Dependency, module: Module): void;
10358
+ updateParent(
10359
+ dependency: Dependency,
10360
+ connection?: ModuleGraphConnection,
10361
+ parentModule?: Module
10362
+ ): void;
10363
+ removeConnection(dependency: Dependency): void;
10090
10364
  addExplanation(dependency: Dependency, explanation: string): void;
10091
10365
  cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
10092
10366
  removeModuleAttributes(module: Module): void;
@@ -10111,13 +10385,18 @@ declare class ModuleGraph {
10111
10385
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
10112
10386
  getIncomingConnectionsByOriginModule(
10113
10387
  module: Module
10114
- ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
10388
+ ): ReadonlyMap<
10389
+ undefined | null | Module,
10390
+ ReadonlyArray<ModuleGraphConnection>
10391
+ >;
10115
10392
  getOutgoingConnectionsByModule(
10116
10393
  module: Module
10117
- ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10394
+ ):
10395
+ | undefined
10396
+ | ReadonlyMap<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10118
10397
  getProfile(module: Module): undefined | ModuleProfile;
10119
10398
  setProfile(module: Module, profile?: ModuleProfile): void;
10120
- getIssuer(module: Module): undefined | null | Module;
10399
+ getIssuer(module: Module): Issuer;
10121
10400
  setIssuer(module: Module, issuer: null | Module): void;
10122
10401
  setIssuerIfUnset(module: Module, issuer: null | Module): void;
10123
10402
  getOptimizationBailout(
@@ -10147,13 +10426,13 @@ declare class ModuleGraph {
10147
10426
  isAsync(module: Module): boolean;
10148
10427
  isDeferred(module: Module): boolean;
10149
10428
  setAsync(module: Module): void;
10150
- getMeta(thing: object): any;
10151
- getMetaIfExisting(thing: object): any;
10429
+ getMeta(thing: object): Meta;
10430
+ getMetaIfExisting(thing: object): undefined | Meta;
10152
10431
  freeze(cacheStage?: string): void;
10153
10432
  unfreeze(): void;
10154
- cached<T, R>(
10155
- fn: (moduleGraph: ModuleGraph, ...args: T[]) => R,
10156
- ...args: T[]
10433
+ cached<T extends any[], R>(
10434
+ fn: (moduleGraph: ModuleGraph, ...args: T) => R,
10435
+ ...args: T
10157
10436
  ): R;
10158
10437
  setModuleMemCaches(
10159
10438
  moduleMemCaches: Map<Module, WeakTupleMap<any[], any>>
@@ -10515,6 +10794,11 @@ declare interface ModuleSettings {
10515
10794
  */
10516
10795
  type?: string;
10517
10796
 
10797
+ /**
10798
+ * Enable/Disable extracting source map.
10799
+ */
10800
+ extractSourceMap?: boolean;
10801
+
10518
10802
  /**
10519
10803
  * Options for the resolver.
10520
10804
  */
@@ -10630,19 +10914,24 @@ declare class MultiCompiler {
10630
10914
  intermediateFileSystem: IntermediateFileSystem;
10631
10915
  getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
10632
10916
  setDependencies(compiler: Compiler, dependencies: string[]): void;
10633
- validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
10917
+ validateDependencies(
10918
+ callback: CallbackWebpackFunction_2<MultiStats, void>
10919
+ ): boolean;
10634
10920
  runWithDependencies(
10635
10921
  compilers: Compiler[],
10636
- fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
10637
- callback: CallbackFunction_1<Stats[]>
10922
+ fn: (
10923
+ compiler: Compiler,
10924
+ callback: CallbackWebpackFunction_2<MultiStats, void>
10925
+ ) => void,
10926
+ callback: CallbackWebpackFunction_2<Stats[], void>
10638
10927
  ): void;
10639
10928
  watch(
10640
10929
  watchOptions: WatchOptions | WatchOptions[],
10641
- handler: CallbackFunction_1<MultiStats>
10642
- ): MultiWatching;
10643
- run(callback: CallbackFunction_1<MultiStats>): void;
10930
+ handler: CallbackWebpackFunction_2<MultiStats, void>
10931
+ ): undefined | MultiWatching;
10932
+ run(callback: CallbackWebpackFunction_2<MultiStats, void>): void;
10644
10933
  purgeInputFileSystem(): void;
10645
- close(callback: CallbackFunction_1<void>): void;
10934
+ close(callback: (err: null | Error, result?: void) => void): void;
10646
10935
  }
10647
10936
  declare interface MultiCompilerOptions {
10648
10937
  /**
@@ -10650,7 +10939,8 @@ declare interface MultiCompilerOptions {
10650
10939
  */
10651
10940
  parallelism?: number;
10652
10941
  }
10653
- type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
10942
+ type MultiConfiguration = ReadonlyArray<WebpackOptionsNormalized> &
10943
+ MultiCompilerOptions;
10654
10944
  declare abstract class MultiStats {
10655
10945
  stats: Stats[];
10656
10946
  get hash(): string;
@@ -10665,10 +10955,10 @@ type MultiStatsOptions = Omit<StatsOptions, "children"> & {
10665
10955
  declare abstract class MultiWatching {
10666
10956
  watchings: Watching[];
10667
10957
  compiler: MultiCompiler;
10668
- invalidate(callback?: CallbackFunction_2<void>): void;
10958
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
10669
10959
  suspend(): void;
10670
10960
  resume(): void;
10671
- close(callback: CallbackFunction_2<void>): void;
10961
+ close(callback: (err: null | Error, result?: void) => void): void;
10672
10962
  }
10673
10963
  declare class NamedChunkIdsPlugin {
10674
10964
  constructor(options?: NamedChunkIdsPluginOptions);
@@ -10717,7 +11007,7 @@ declare class NaturalModuleIdsPlugin {
10717
11007
  declare interface NeedBuildContext {
10718
11008
  compilation: Compilation;
10719
11009
  fileSystemInfo: FileSystemInfo;
10720
- valueCacheVersions: Map<string, string | Set<string>>;
11010
+ valueCacheVersions: Map<string, ValueCacheVersion>;
10721
11011
  }
10722
11012
  declare interface NewContentCreateContextMap {
10723
11013
  [index: string]: string;
@@ -10801,6 +11091,7 @@ declare interface NodeTemplatePluginOptions {
10801
11091
  */
10802
11092
  asyncChunkLoading?: boolean;
10803
11093
  }
11094
+ type NonNullable<T> = T & {};
10804
11095
  declare class NormalModule extends Module {
10805
11096
  constructor(__0: NormalModuleCreateData);
10806
11097
  request: string;
@@ -10815,7 +11106,9 @@ declare class NormalModule extends Module {
10815
11106
  resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
10816
11107
  matchResource?: string;
10817
11108
  loaders: LoaderItem[];
11109
+ extractSourceMap?: boolean;
10818
11110
  error: null | WebpackError;
11111
+ getResource(): null | string;
10819
11112
 
10820
11113
  /**
10821
11114
  * restore unsafe cache data
@@ -10832,7 +11125,7 @@ declare class NormalModule extends Module {
10832
11125
  associatedObjectForCache?: object
10833
11126
  ): Source;
10834
11127
  getCurrentLoader(
10835
- loaderContext: LoaderContextObject<any>,
11128
+ loaderContext: AnyLoaderContext,
10836
11129
  index?: number
10837
11130
  ): null | LoaderItem;
10838
11131
  createSource(
@@ -10858,10 +11151,8 @@ declare class NormalModule extends Module {
10858
11151
  static deserialize(context: ObjectDeserializerContext): NormalModule;
10859
11152
  }
10860
11153
  declare interface NormalModuleCompilationHooks {
10861
- loader: SyncHook<[LoaderContextObject<any>, NormalModule]>;
10862
- beforeLoaders: SyncHook<
10863
- [LoaderItem[], NormalModule, LoaderContextObject<any>]
10864
- >;
11154
+ loader: SyncHook<[AnyLoaderContext, NormalModule]>;
11155
+ beforeLoaders: SyncHook<[LoaderItem[], NormalModule, AnyLoaderContext]>;
10865
11156
  beforeParse: SyncHook<[NormalModule]>;
10866
11157
  beforeSnapshot: SyncHook<[NormalModule]>;
10867
11158
  readResourceForScheme: HookMap<
@@ -10870,7 +11161,7 @@ declare interface NormalModuleCompilationHooks {
10870
11161
  >
10871
11162
  >;
10872
11163
  readResource: HookMap<
10873
- AsyncSeriesBailHook<[LoaderContextObject<any>], null | string | Buffer>
11164
+ AsyncSeriesBailHook<[AnyLoaderContext], null | string | Buffer>
10874
11165
  >;
10875
11166
  processResult: SyncWaterfallHook<
10876
11167
  [
@@ -10880,6 +11171,11 @@ declare interface NormalModuleCompilationHooks {
10880
11171
  undefined | PreparsedAst
10881
11172
  ],
10882
11173
  NormalModule
11174
+ ],
11175
+ [
11176
+ string | Buffer,
11177
+ undefined | string | RawSourceMap,
11178
+ undefined | PreparsedAst
10883
11179
  ]
10884
11180
  >;
10885
11181
  needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
@@ -10959,6 +11255,11 @@ declare interface NormalModuleCreateData {
10959
11255
  * options used for resolving requests from this module
10960
11256
  */
10961
11257
  resolveOptions?: ResolveOptions;
11258
+
11259
+ /**
11260
+ * enable/disable extracting source map
11261
+ */
11262
+ extractSourceMap?: boolean;
10962
11263
  }
10963
11264
  declare abstract class NormalModuleFactory extends ModuleFactory {
10964
11265
  hooks: Readonly<{
@@ -10984,7 +11285,8 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10984
11285
  Module,
10985
11286
  Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
10986
11287
  ResolveData
10987
- ]
11288
+ ],
11289
+ Module
10988
11290
  >;
10989
11291
  createParser: HookMap<SyncBailHook<[ParserOptions], void | ParserClass>>;
10990
11292
  parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
@@ -11027,7 +11329,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11027
11329
  array: LoaderItem[],
11028
11330
  resolver: ResolverWithOptions,
11029
11331
  resolveContext: ResolveContext,
11030
- callback: CallbackNormalModuleFactory<LoaderItem[]>
11332
+ callback: CallbackWebpackFunction_1<LoaderItem[]>
11031
11333
  ): void;
11032
11334
  getParser(type: string, parserOptions?: ParserOptions): ParserClass;
11033
11335
  createParser(type: string, parserOptions?: ParserOptions): ParserClass;
@@ -11057,7 +11359,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11057
11359
  res?: string | false,
11058
11360
  req?: ResolveRequest
11059
11361
  ) => void
11060
- ): any;
11362
+ ): void;
11061
11363
  getResolve(options?: ResolveOptionsWithDependencyType): {
11062
11364
  (
11063
11365
  context: string,
@@ -11090,7 +11392,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11090
11392
  hashFunction: HashFunction;
11091
11393
  hashDigest: string;
11092
11394
  hashDigestLength: number;
11093
- hashSalt: string;
11395
+ hashSalt?: string;
11094
11396
  _module?: NormalModule;
11095
11397
  _compilation?: Compilation;
11096
11398
  _compiler?: Compiler;
@@ -11187,9 +11489,6 @@ declare interface ObjectEncodingOptions {
11187
11489
  | "binary"
11188
11490
  | "hex";
11189
11491
  }
11190
- declare interface ObjectForExtract {
11191
- [index: string]: any;
11192
- }
11193
11492
  declare interface ObjectSerializer {
11194
11493
  serialize: (value: any, context: ObjectSerializerContext) => void;
11195
11494
  deserialize: (context: ObjectDeserializerContext) => any;
@@ -11479,11 +11778,6 @@ declare interface OptimizationNormalized {
11479
11778
  * Minimizer(s) to use for minimizing the output.
11480
11779
  */
11481
11780
  minimizer?: (
11482
- | undefined
11483
- | null
11484
- | false
11485
- | ""
11486
- | 0
11487
11781
  | ((this: Compiler, compiler: Compiler) => void)
11488
11782
  | WebpackPluginInstance
11489
11783
  | "..."
@@ -11556,6 +11850,60 @@ declare interface OptimizationNormalized {
11556
11850
  */
11557
11851
  usedExports?: boolean | "global";
11558
11852
  }
11853
+ type OptimizationNormalizedWithDefaults = OptimizationNormalized & {
11854
+ runtimeChunk: NonNullable<
11855
+ | undefined
11856
+ | false
11857
+ | {
11858
+ /**
11859
+ * The name factory for the runtime chunks.
11860
+ */
11861
+ name?: (entrypoint: { name: string }) => string;
11862
+ }
11863
+ >;
11864
+ splitChunks: NonNullable<undefined | false | OptimizationSplitChunksOptions>;
11865
+ mergeDuplicateChunks: NonNullable<undefined | boolean>;
11866
+ removeAvailableModules: NonNullable<undefined | boolean>;
11867
+ removeEmptyChunks: NonNullable<undefined | boolean>;
11868
+ flagIncludedChunks: NonNullable<undefined | boolean>;
11869
+ moduleIds: NonNullable<
11870
+ | undefined
11871
+ | false
11872
+ | "natural"
11873
+ | "named"
11874
+ | "deterministic"
11875
+ | "size"
11876
+ | "hashed"
11877
+ >;
11878
+ chunkIds: NonNullable<
11879
+ | undefined
11880
+ | false
11881
+ | "natural"
11882
+ | "named"
11883
+ | "deterministic"
11884
+ | "size"
11885
+ | "total-size"
11886
+ >;
11887
+ sideEffects: NonNullable<undefined | boolean | "flag">;
11888
+ providedExports: NonNullable<undefined | boolean>;
11889
+ usedExports: NonNullable<undefined | boolean | "global">;
11890
+ mangleExports: NonNullable<undefined | boolean | "deterministic" | "size">;
11891
+ innerGraph: NonNullable<undefined | boolean>;
11892
+ concatenateModules: NonNullable<undefined | boolean>;
11893
+ avoidEntryIife: NonNullable<undefined | boolean>;
11894
+ emitOnErrors: NonNullable<undefined | boolean>;
11895
+ checkWasmTypes: NonNullable<undefined | boolean>;
11896
+ mangleWasmImports: NonNullable<undefined | boolean>;
11897
+ portableRecords: NonNullable<undefined | boolean>;
11898
+ realContentHash: NonNullable<undefined | boolean>;
11899
+ minimize: NonNullable<undefined | boolean>;
11900
+ minimizer: (
11901
+ | ((this: Compiler, compiler: Compiler) => void)
11902
+ | WebpackPluginInstance
11903
+ | "..."
11904
+ )[];
11905
+ nodeEnv: NonNullable<undefined | string | false>;
11906
+ };
11559
11907
 
11560
11908
  /**
11561
11909
  * Options object for describing behavior of a cache group selecting modules that should be cached together.
@@ -11569,7 +11917,12 @@ declare interface OptimizationSplitChunksCacheGroup {
11569
11917
  /**
11570
11918
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
11571
11919
  */
11572
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
11920
+ chunks?:
11921
+ | RegExp
11922
+ | "all"
11923
+ | "initial"
11924
+ | "async"
11925
+ | ((chunk: Chunk) => undefined | boolean);
11573
11926
 
11574
11927
  /**
11575
11928
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -11707,7 +12060,12 @@ declare interface OptimizationSplitChunksOptions {
11707
12060
  /**
11708
12061
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11709
12062
  */
11710
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12063
+ chunks?:
12064
+ | RegExp
12065
+ | "all"
12066
+ | "initial"
12067
+ | "async"
12068
+ | ((chunk: Chunk) => undefined | boolean);
11711
12069
 
11712
12070
  /**
11713
12071
  * Sets the size types which are used when a number is used for sizes.
@@ -11730,7 +12088,12 @@ declare interface OptimizationSplitChunksOptions {
11730
12088
  /**
11731
12089
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11732
12090
  */
11733
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12091
+ chunks?:
12092
+ | RegExp
12093
+ | "all"
12094
+ | "initial"
12095
+ | "async"
12096
+ | ((chunk: Chunk) => undefined | boolean);
11734
12097
  /**
11735
12098
  * Maximal size hint for the on-demand chunks.
11736
12099
  */
@@ -11859,9 +12222,9 @@ declare interface Options {
11859
12222
  }
11860
12223
  declare abstract class OptionsApply {
11861
12224
  process(
11862
- options: WebpackOptionsNormalized,
12225
+ options: WebpackOptionsNormalizedWithDefaults,
11863
12226
  compiler: Compiler
11864
- ): WebpackOptionsNormalized;
12227
+ ): WebpackOptionsNormalizedWithDefaults;
11865
12228
  }
11866
12229
  declare interface OriginRecord {
11867
12230
  module: null | Module;
@@ -11981,12 +12344,16 @@ declare interface Output {
11981
12344
  /**
11982
12345
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
11983
12346
  */
11984
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
12347
+ devtoolFallbackModuleFilenameTemplate?:
12348
+ | string
12349
+ | ((context: ModuleFilenameTemplateContext) => string);
11985
12350
 
11986
12351
  /**
11987
12352
  * Filename template string of function for the sources array in a generated SourceMap.
11988
12353
  */
11989
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
12354
+ devtoolModuleFilenameTemplate?:
12355
+ | string
12356
+ | ((context: ModuleFilenameTemplateContext) => string);
11990
12357
 
11991
12358
  /**
11992
12359
  * 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.
@@ -12179,10 +12546,10 @@ declare interface Output {
12179
12546
  workerWasmLoading?: string | false;
12180
12547
  }
12181
12548
  declare interface OutputFileSystem {
12182
- writeFile: WriteFile;
12183
12549
  mkdir: Mkdir;
12184
12550
  readdir?: ReaddirFs;
12185
12551
  rmdir?: Rmdir;
12552
+ writeFile: WriteFile;
12186
12553
  unlink?: (
12187
12554
  pathLike: PathLikeFs,
12188
12555
  callback: (err: null | NodeJS.ErrnoException) => void
@@ -12190,6 +12557,23 @@ declare interface OutputFileSystem {
12190
12557
  stat: StatFs;
12191
12558
  lstat?: LStatFs;
12192
12559
  readFile: ReadFileFs;
12560
+ createReadStream?: (
12561
+ path: PathLikeFs,
12562
+ options?:
12563
+ | "ascii"
12564
+ | "utf8"
12565
+ | "utf-8"
12566
+ | "utf16le"
12567
+ | "utf-16le"
12568
+ | "ucs2"
12569
+ | "ucs-2"
12570
+ | "base64"
12571
+ | "base64url"
12572
+ | "latin1"
12573
+ | "binary"
12574
+ | "hex"
12575
+ | ReadStreamOptions
12576
+ ) => NodeJS.ReadableStream;
12193
12577
  join?: (path1: string, path2: string) => string;
12194
12578
  relative?: (from: string, to: string) => string;
12195
12579
  dirname?: (dirname: string) => string;
@@ -12275,12 +12659,16 @@ declare interface OutputNormalized {
12275
12659
  /**
12276
12660
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
12277
12661
  */
12278
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
12662
+ devtoolFallbackModuleFilenameTemplate?:
12663
+ | string
12664
+ | ((context: ModuleFilenameTemplateContext) => string);
12279
12665
 
12280
12666
  /**
12281
12667
  * Filename template string of function for the sources array in a generated SourceMap.
12282
12668
  */
12283
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
12669
+ devtoolModuleFilenameTemplate?:
12670
+ | string
12671
+ | ((context: ModuleFilenameTemplateContext) => string);
12284
12672
 
12285
12673
  /**
12286
12674
  * 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.
@@ -12457,6 +12845,61 @@ declare interface OutputNormalized {
12457
12845
  */
12458
12846
  workerWasmLoading?: string | false;
12459
12847
  }
12848
+ type OutputNormalizedWithDefaults = OutputNormalized & {
12849
+ uniqueName: string;
12850
+ filename: NonNullable<
12851
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12852
+ >;
12853
+ cssFilename: NonNullable<
12854
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12855
+ >;
12856
+ chunkFilename: NonNullable<
12857
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12858
+ >;
12859
+ cssChunkFilename: NonNullable<
12860
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12861
+ >;
12862
+ hotUpdateChunkFilename: string;
12863
+ hotUpdateGlobal: string;
12864
+ assetModuleFilename: NonNullable<
12865
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12866
+ >;
12867
+ webassemblyModuleFilename: string;
12868
+ sourceMapFilename: string;
12869
+ hotUpdateMainFilename: string;
12870
+ devtoolNamespace: string;
12871
+ publicPath: NonNullable<
12872
+ undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
12873
+ >;
12874
+ workerPublicPath: string;
12875
+ workerWasmLoading: NonNullable<undefined | string | false>;
12876
+ workerChunkLoading: NonNullable<undefined | string | false>;
12877
+ chunkFormat: NonNullable<undefined | string | false>;
12878
+ module: NonNullable<undefined | boolean>;
12879
+ asyncChunks: NonNullable<undefined | boolean>;
12880
+ charset: NonNullable<undefined | boolean>;
12881
+ iife: NonNullable<undefined | boolean>;
12882
+ globalObject: string;
12883
+ scriptType: NonNullable<undefined | false | "module" | "text/javascript">;
12884
+ path: string;
12885
+ pathinfo: NonNullable<undefined | boolean | "verbose">;
12886
+ hashFunction: NonNullable<undefined | string | typeof Hash>;
12887
+ hashDigest: string;
12888
+ hashDigestLength: number;
12889
+ chunkLoadTimeout: number;
12890
+ chunkLoading: NonNullable<undefined | string | false>;
12891
+ chunkLoadingGlobal: string;
12892
+ compareBeforeEmit: NonNullable<undefined | boolean>;
12893
+ strictModuleErrorHandling: NonNullable<undefined | boolean>;
12894
+ strictModuleExceptionHandling: NonNullable<undefined | boolean>;
12895
+ importFunctionName: string;
12896
+ importMetaName: string;
12897
+ environment: RecursiveNonNullable<Environment>;
12898
+ crossOriginLoading: NonNullable<
12899
+ undefined | false | "anonymous" | "use-credentials"
12900
+ >;
12901
+ wasmLoading: NonNullable<undefined | string | false>;
12902
+ };
12460
12903
  declare interface ParameterizedComparator<TArg extends object, T> {
12461
12904
  (tArg: TArg): Comparator<T>;
12462
12905
  }
@@ -12518,6 +12961,11 @@ declare interface ParserOptionsByModuleTypeKnown {
12518
12961
  */
12519
12962
  asset?: AssetParserOptions;
12520
12963
 
12964
+ /**
12965
+ * No parser options are supported for this module type.
12966
+ */
12967
+ "asset/bytes"?: EmptyParserOptions;
12968
+
12521
12969
  /**
12522
12970
  * No parser options are supported for this module type.
12523
12971
  */
@@ -12591,7 +13039,7 @@ declare interface ParserStateBase {
12591
13039
  current: NormalModule;
12592
13040
  module: NormalModule;
12593
13041
  compilation: Compilation;
12594
- options: WebpackOptionsNormalized;
13042
+ options: WebpackOptionsNormalizedWithDefaults;
12595
13043
  }
12596
13044
  declare interface PathData {
12597
13045
  chunkGraph?: ChunkGraph;
@@ -12729,7 +13177,7 @@ declare class PrefetchPlugin {
12729
13177
  apply(compiler: Compiler): void;
12730
13178
  }
12731
13179
  declare class PrefixSource extends Source {
12732
- constructor(prefix: string, source: string | Source | Buffer);
13180
+ constructor(prefix: string, source: string | Buffer | Source);
12733
13181
  getPrefix(): string;
12734
13182
  original(): Source;
12735
13183
  streamChunks(
@@ -12773,7 +13221,7 @@ type ProblemType =
12773
13221
  | "multiple-values-unexpected"
12774
13222
  | "invalid-value";
12775
13223
  declare interface ProcessAssetsAdditionalOptions {
12776
- additionalAssets?: any;
13224
+ additionalAssets?: boolean | ((assets: CompilationAssets) => void);
12777
13225
  }
12778
13226
  declare class Profiler {
12779
13227
  constructor(inspector: Inspector);
@@ -12783,7 +13231,7 @@ declare class Profiler {
12783
13231
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
12784
13232
  sendCommand(method: string, params?: object): Promise<any>;
12785
13233
  destroy(): Promise<void>;
12786
- stopProfiling(): Promise<{ profile: any }>;
13234
+ stopProfiling(): Promise<{ profile: { startTime: number; endTime: number } }>;
12787
13235
  }
12788
13236
  declare class ProfilingPlugin {
12789
13237
  constructor(options?: ProfilingPluginOptions);
@@ -13263,6 +13711,10 @@ declare interface ReadFileTypes {
13263
13711
  callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
13264
13712
  ): void;
13265
13713
  }
13714
+ type ReadStreamOptions = StreamOptions & {
13715
+ fs?: null | CreateReadStreamFSImplementation;
13716
+ end?: number;
13717
+ };
13266
13718
  declare interface ReaddirFs {
13267
13719
  (
13268
13720
  path: PathLikeFs,
@@ -13674,6 +14126,7 @@ type RecursiveArrayOrRecord<T> =
13674
14126
  | { [index: string]: RecursiveArrayOrRecord<T> }
13675
14127
  | RecursiveArrayOrRecord<T>[]
13676
14128
  | T;
14129
+ declare interface RecursiveNonNullable<T> {}
13677
14130
  type ReferenceableItem = string | object;
13678
14131
  declare interface ReferencedExport {
13679
14132
  /**
@@ -13839,7 +14292,7 @@ declare interface RenderManifestOptions {
13839
14292
  chunk: Chunk;
13840
14293
  hash: string;
13841
14294
  fullHash: string;
13842
- outputOptions: Output;
14295
+ outputOptions: OutputNormalizedWithDefaults;
13843
14296
  codeGenerationResults: CodeGenerationResults;
13844
14297
  moduleTemplates: { javascript: ModuleTemplate };
13845
14298
  dependencyTemplates: DependencyTemplates;
@@ -13951,7 +14404,7 @@ declare interface ResolveData {
13951
14404
  resolveOptions?: ResolveOptions;
13952
14405
  context: string;
13953
14406
  request: string;
13954
- assertions?: ImportAttributes;
14407
+ attributes?: ImportAttributes;
13955
14408
  dependencies: ModuleDependency[];
13956
14409
  dependencyType: string;
13957
14410
  createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
@@ -14543,7 +14996,10 @@ declare interface ResolverCache {
14543
14996
  declare abstract class ResolverFactory {
14544
14997
  hooks: Readonly<{
14545
14998
  resolveOptions: HookMap<
14546
- SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
14999
+ SyncWaterfallHook<
15000
+ [ResolveOptionsWithDependencyType],
15001
+ ResolveOptionsWithDependencyType
15002
+ >
14547
15003
  >;
14548
15004
  resolver: HookMap<
14549
15005
  SyncHook<
@@ -14622,7 +15078,7 @@ declare interface Rmdir {
14622
15078
  callback: (err: null | NodeJS.ErrnoException) => void
14623
15079
  ): void;
14624
15080
  }
14625
- type Rule = string | RegExp;
15081
+ type Rule = string | RegExp | ((str: string) => boolean);
14626
15082
  declare interface RuleSet {
14627
15083
  /**
14628
15084
  * map of references in the rule set (may grow over time)
@@ -14753,6 +15209,11 @@ declare interface RuleSetRule {
14753
15209
  | RuleSetLogicalConditionsAbsolute
14754
15210
  | RuleSetConditionAbsolute[];
14755
15211
 
15212
+ /**
15213
+ * Enable/Disable extracting source map.
15214
+ */
15215
+ extractSourceMap?: boolean;
15216
+
14756
15217
  /**
14757
15218
  * The options for the module generator.
14758
15219
  */
@@ -15046,9 +15507,6 @@ type RuleSetUseItem =
15046
15507
  */
15047
15508
  options?: string | { [index: string]: any };
15048
15509
  };
15049
- declare interface RunCallback<T> {
15050
- (err: null | Error, result?: T): any;
15051
- }
15052
15510
  declare class RuntimeChunkPlugin {
15053
15511
  constructor(options?: {
15054
15512
  /**
@@ -15064,6 +15522,7 @@ declare class RuntimeChunkPlugin {
15064
15522
  apply(compiler: Compiler): void;
15065
15523
  }
15066
15524
  type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
15525
+ type RuntimeId = string | number;
15067
15526
  declare class RuntimeModule extends Module {
15068
15527
  constructor(name: string, stage?: number);
15069
15528
  name: string;
@@ -15131,25 +15590,26 @@ declare class RuntimeSpecSet {
15131
15590
  }
15132
15591
  declare abstract class RuntimeTemplate {
15133
15592
  compilation: Compilation;
15134
- outputOptions: OutputNormalized;
15593
+ outputOptions: OutputNormalizedWithDefaults;
15135
15594
  requestShortener: RequestShortener;
15136
15595
  globalObject: string;
15137
15596
  contentHashReplacement: string;
15138
- isIIFE(): undefined | boolean;
15139
- isModule(): undefined | boolean;
15597
+ isIIFE(): boolean;
15598
+ isModule(): boolean;
15140
15599
  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;
15600
+ supportsConst(): boolean;
15601
+ supportsArrowFunction(): boolean;
15602
+ supportsAsyncFunction(): boolean;
15603
+ supportsOptionalChaining(): boolean;
15604
+ supportsForOf(): boolean;
15605
+ supportsDestructuring(): boolean;
15606
+ supportsBigIntLiteral(): boolean;
15607
+ supportsDynamicImport(): boolean;
15608
+ supportsEcmaScriptModuleSyntax(): boolean;
15609
+ supportTemplateLiteral(): boolean;
15610
+ supportNodePrefixForCoreModules(): boolean;
15152
15611
  renderNodePrefixForCoreModule(mod: string): string;
15612
+ renderConst(): "var" | "const";
15153
15613
  returningFunction(returnValue: string, args?: string): string;
15154
15614
  basicFunction(args: string, body: string | string[]): string;
15155
15615
  concatenation(...args: (string | { expr: string })[]): string;
@@ -15556,7 +16016,7 @@ declare abstract class RuntimeValue {
15556
16016
  get fileDependencies(): true | string[];
15557
16017
  exec(
15558
16018
  parser: JavascriptParser,
15559
- valueCacheVersions: Map<string, string | Set<string>>,
16019
+ valueCacheVersions: Map<string, ValueCacheVersion>,
15560
16020
  key: string
15561
16021
  ): CodeValuePrimitive;
15562
16022
  getCacheVersion(): undefined | string;
@@ -15614,6 +16074,9 @@ declare abstract class SerializerMiddleware<
15614
16074
  context: Context
15615
16075
  ): DeserializedType | Promise<DeserializedType>;
15616
16076
  }
16077
+ type ServerLazyCompilationBackend =
16078
+ | ServerImportHttp<typeof IncomingMessage>
16079
+ | ServerImportHttps<typeof IncomingMessage>;
15617
16080
  declare interface SetIterator<T> extends IteratorObject<T, undefined> {
15618
16081
  [Symbol.iterator](): SetIterator<T>;
15619
16082
  [Symbol.dispose](): void;
@@ -15708,10 +16171,11 @@ declare class SideEffectsFlagPlugin {
15708
16171
  apply(compiler: Compiler): void;
15709
16172
  static moduleHasSideEffects(
15710
16173
  moduleName: string,
15711
- flagValue: undefined | string | boolean | string[],
16174
+ flagValue: SideEffectsFlagValue,
15712
16175
  cache: Map<string, RegExp>
15713
16176
  ): undefined | boolean;
15714
16177
  }
16178
+ type SideEffectsFlagValue = undefined | string | boolean | string[];
15715
16179
  type SimpleType = "string" | "number" | "boolean";
15716
16180
  declare class SizeOnlySource extends Source {
15717
16181
  constructor(size: number);
@@ -15768,6 +16232,51 @@ declare abstract class Snapshot {
15768
16232
  getContextIterable(): Iterable<string>;
15769
16233
  getMissingIterable(): Iterable<string>;
15770
16234
  }
16235
+ type SnapshotNormalizedWithDefaults = SnapshotOptionsWebpackOptions & {
16236
+ managedPaths: (string | RegExp)[];
16237
+ unmanagedPaths: (string | RegExp)[];
16238
+ immutablePaths: (string | RegExp)[];
16239
+ resolveBuildDependencies: {
16240
+ /**
16241
+ * Use hashes of the content of the files/directories to determine invalidation.
16242
+ */
16243
+ hash?: boolean;
16244
+ /**
16245
+ * Use timestamps of the files/directories to determine invalidation.
16246
+ */
16247
+ timestamp?: boolean;
16248
+ };
16249
+ buildDependencies: {
16250
+ /**
16251
+ * Use hashes of the content of the files/directories to determine invalidation.
16252
+ */
16253
+ hash?: boolean;
16254
+ /**
16255
+ * Use timestamps of the files/directories to determine invalidation.
16256
+ */
16257
+ timestamp?: boolean;
16258
+ };
16259
+ module: {
16260
+ /**
16261
+ * Use hashes of the content of the files/directories to determine invalidation.
16262
+ */
16263
+ hash?: boolean;
16264
+ /**
16265
+ * Use timestamps of the files/directories to determine invalidation.
16266
+ */
16267
+ timestamp?: boolean;
16268
+ };
16269
+ resolve: {
16270
+ /**
16271
+ * Use hashes of the content of the files/directories to determine invalidation.
16272
+ */
16273
+ hash?: boolean;
16274
+ /**
16275
+ * Use timestamps of the files/directories to determine invalidation.
16276
+ */
16277
+ timestamp?: boolean;
16278
+ };
16279
+ };
15771
16280
  declare interface SnapshotOptionsFileSystemInfo {
15772
16281
  /**
15773
16282
  * should use hash to snapshot
@@ -15798,6 +16307,20 @@ declare interface SnapshotOptionsWebpackOptions {
15798
16307
  timestamp?: boolean;
15799
16308
  };
15800
16309
 
16310
+ /**
16311
+ * Options for snapshotting the context module to determine if it needs to be built again.
16312
+ */
16313
+ contextModule?: {
16314
+ /**
16315
+ * Use hashes of the content of the files/directories to determine invalidation.
16316
+ */
16317
+ hash?: boolean;
16318
+ /**
16319
+ * Use timestamps of the files/directories to determine invalidation.
16320
+ */
16321
+ timestamp?: boolean;
16322
+ };
16323
+
15801
16324
  /**
15802
16325
  * 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
16326
  */
@@ -15934,8 +16457,12 @@ declare class SourceMapDevToolPlugin {
15934
16457
  | string
15935
16458
  | false
15936
16459
  | ((pathData: PathData, assetInfo?: AssetInfo) => string);
15937
- moduleFilenameTemplate: string | ((context?: any) => string);
15938
- fallbackModuleFilenameTemplate: string | ((context?: any) => string);
16460
+ moduleFilenameTemplate:
16461
+ | string
16462
+ | ((context: ModuleFilenameTemplateContext) => string);
16463
+ fallbackModuleFilenameTemplate:
16464
+ | string
16465
+ | ((context: ModuleFilenameTemplateContext) => string);
15939
16466
  namespace: string;
15940
16467
  options: SourceMapDevToolPluginOptions;
15941
16468
 
@@ -15967,12 +16494,14 @@ declare interface SourceMapDevToolPluginOptions {
15967
16494
  /**
15968
16495
  * Exclude modules that match the given value from source map generation.
15969
16496
  */
15970
- exclude?: string | RegExp | Rule[];
16497
+ exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
15971
16498
 
15972
16499
  /**
15973
16500
  * 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
16501
  */
15975
- fallbackModuleFilenameTemplate?: string | ((context?: any) => string);
16502
+ fallbackModuleFilenameTemplate?:
16503
+ | string
16504
+ | ((context: ModuleFilenameTemplateContext) => string);
15976
16505
 
15977
16506
  /**
15978
16507
  * Path prefix to which the [file] placeholder is relative to.
@@ -15987,7 +16516,7 @@ declare interface SourceMapDevToolPluginOptions {
15987
16516
  /**
15988
16517
  * Include source maps for module paths that match the given value.
15989
16518
  */
15990
- include?: string | RegExp | Rule[];
16519
+ include?: string | RegExp | Rule[] | ((str: string) => boolean);
15991
16520
 
15992
16521
  /**
15993
16522
  * Indicates whether SourceMaps from loaders should be used (defaults to true).
@@ -15997,7 +16526,9 @@ declare interface SourceMapDevToolPluginOptions {
15997
16526
  /**
15998
16527
  * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
15999
16528
  */
16000
- moduleFilenameTemplate?: string | ((context?: any) => string);
16529
+ moduleFilenameTemplate?:
16530
+ | string
16531
+ | ((context: ModuleFilenameTemplateContext) => string);
16001
16532
 
16002
16533
  /**
16003
16534
  * Namespace prefix to allow multiple webpack roots in the devtools.
@@ -16022,7 +16553,7 @@ declare interface SourceMapDevToolPluginOptions {
16022
16553
  /**
16023
16554
  * Include source maps for modules based on their extension (defaults to .js and .css).
16024
16555
  */
16025
- test?: string | RegExp | Rule[];
16556
+ test?: string | RegExp | Rule[] | ((str: string) => boolean);
16026
16557
  }
16027
16558
  declare class SourceMapSource extends Source {
16028
16559
  constructor(
@@ -16266,9 +16797,9 @@ type Statement =
16266
16797
  | ForInStatement
16267
16798
  | ForOfStatement;
16268
16799
  type StatementPathItem =
16269
- | ImportDeclarationJavascriptParser
16270
- | ExportNamedDeclarationJavascriptParser
16271
- | ExportAllDeclarationJavascriptParser
16800
+ | ImportDeclaration
16801
+ | ExportNamedDeclaration
16802
+ | ExportAllDeclaration
16272
16803
  | ImportExpressionImport
16273
16804
  | UnaryExpression
16274
16805
  | ArrayExpression
@@ -16348,9 +16879,7 @@ declare abstract class StatsFactory {
16348
16879
  }
16349
16880
  type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
16350
16881
  declare interface StatsFactoryHooks {
16351
- extract: HookMap<
16352
- SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], void>
16353
- >;
16882
+ extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
16354
16883
  filter: HookMap<
16355
16884
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16356
16885
  >;
@@ -16364,7 +16893,7 @@ declare interface StatsFactoryHooks {
16364
16893
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16365
16894
  >;
16366
16895
  groupResults: HookMap<
16367
- SyncBailHook<[GroupConfig[], StatsFactoryContext], void>
16896
+ SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
16368
16897
  >;
16369
16898
  sortResults: HookMap<
16370
16899
  SyncBailHook<
@@ -16438,7 +16967,18 @@ declare interface StatsOptions {
16438
16967
  /**
16439
16968
  * Add children information.
16440
16969
  */
16441
- children?: boolean;
16970
+ children?:
16971
+ | boolean
16972
+ | StatsOptions
16973
+ | "none"
16974
+ | "summary"
16975
+ | "errors-only"
16976
+ | "errors-warnings"
16977
+ | "minimal"
16978
+ | "normal"
16979
+ | "detailed"
16980
+ | "verbose"
16981
+ | StatsValue[];
16442
16982
 
16443
16983
  /**
16444
16984
  * Display auxiliary assets in chunk groups.
@@ -16692,7 +17232,7 @@ declare interface StatsOptions {
16692
17232
  /**
16693
17233
  * Add logging output.
16694
17234
  */
16695
- logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
17235
+ logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
16696
17236
 
16697
17237
  /**
16698
17238
  * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
@@ -16841,7 +17381,7 @@ declare interface StatsOptions {
16841
17381
  | string
16842
17382
  | RegExp
16843
17383
  | WarningFilterItemTypes[]
16844
- | ((warning: StatsError, value: string) => boolean);
17384
+ | ((warning: StatsError, warningString: string) => boolean);
16845
17385
 
16846
17386
  /**
16847
17387
  * Space to display warnings (value is in number of lines).
@@ -16866,7 +17406,7 @@ declare interface StatsPrintHooks {
16866
17406
  print: HookMap<
16867
17407
  SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
16868
17408
  >;
16869
- result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
17409
+ result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
16870
17410
  }
16871
17411
  declare abstract class StatsPrinter {
16872
17412
  hooks: StatsPrintHooks;
@@ -16885,18 +17425,40 @@ type StatsValue =
16885
17425
  | boolean
16886
17426
  | StatsOptions
16887
17427
  | "none"
16888
- | "verbose"
16889
17428
  | "summary"
16890
17429
  | "errors-only"
16891
17430
  | "errors-warnings"
16892
17431
  | "minimal"
16893
17432
  | "normal"
16894
- | "detailed";
17433
+ | "detailed"
17434
+ | "verbose";
16895
17435
  declare interface StreamChunksOptions {
16896
17436
  source?: boolean;
16897
17437
  finalSource?: boolean;
16898
17438
  columns?: boolean;
16899
17439
  }
17440
+ declare interface StreamOptions {
17441
+ flags?: string;
17442
+ encoding?:
17443
+ | "ascii"
17444
+ | "utf8"
17445
+ | "utf-8"
17446
+ | "utf16le"
17447
+ | "utf-16le"
17448
+ | "ucs2"
17449
+ | "ucs-2"
17450
+ | "base64"
17451
+ | "base64url"
17452
+ | "latin1"
17453
+ | "binary"
17454
+ | "hex";
17455
+ fd?: any;
17456
+ mode?: number;
17457
+ autoClose?: boolean;
17458
+ emitClose?: boolean;
17459
+ start?: number;
17460
+ signal?: null | AbortSignal;
17461
+ }
16900
17462
  type Supports = undefined | string;
16901
17463
  declare class SyncModuleIdsPlugin {
16902
17464
  constructor(__0: SyncModuleIdsPluginOptions);
@@ -16934,12 +17496,15 @@ declare interface SyntheticDependencyLocation {
16934
17496
  declare const TOMBSTONE: unique symbol;
16935
17497
  declare const TRANSITIVE: unique symbol;
16936
17498
  declare const TRANSITIVE_ONLY: unique symbol;
16937
- declare interface TagData {
16938
- [index: string]: any;
16939
- }
16940
17499
  declare interface TagInfo {
16941
17500
  tag: symbol;
16942
- data?: TagData;
17501
+ data?:
17502
+ | Record<string, any>
17503
+ | TopLevelSymbol
17504
+ | HarmonySettings
17505
+ | ImportSettings
17506
+ | CommonJsImportSettings
17507
+ | CompatibilitySettings;
16943
17508
  next?: TagInfo;
16944
17509
  }
16945
17510
  declare interface TargetItemWithConnection {
@@ -17028,6 +17593,7 @@ declare interface UpdateHashContextGenerator {
17028
17593
  runtime: RuntimeSpec;
17029
17594
  runtimeTemplate?: RuntimeTemplate;
17030
17595
  }
17596
+ type Usage = string | true | TopLevelSymbol;
17031
17597
  type UsageStateType = 0 | 1 | 2 | 3 | 4;
17032
17598
  type UsedName = string | false | string[];
17033
17599
  type Value = string | number | boolean | RegExp;
@@ -17052,23 +17618,27 @@ declare class VariableInfo {
17052
17618
  type VariableInfoFlagsType = 0 | 1 | 2 | 4;
17053
17619
  declare interface VirtualModuleConfig {
17054
17620
  /**
17055
- * - The module type
17621
+ * the module type
17056
17622
  */
17057
17623
  type?: string;
17058
17624
 
17059
17625
  /**
17060
- * - The source function
17626
+ * the source function
17061
17627
  */
17062
- source: (loaderContext: LoaderContextObject<any>) => string | Promise<string>;
17628
+ source: (
17629
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
17630
+ ) => string | Buffer | Promise<string | Buffer>;
17063
17631
 
17064
17632
  /**
17065
- * - Optional version function or value
17633
+ * optional version function or value
17066
17634
  */
17067
17635
  version?: string | true | (() => string);
17068
17636
  }
17069
17637
  type VirtualModuleInput =
17070
17638
  | string
17071
- | ((loaderContext: LoaderContextObject<any>) => string | Promise<string>)
17639
+ | ((
17640
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
17641
+ ) => string | Buffer | Promise<string | Buffer>)
17072
17642
  | VirtualModuleConfig;
17073
17643
  declare interface VirtualModules {
17074
17644
  [index: string]: VirtualModuleInput;
@@ -17093,7 +17663,7 @@ declare class VirtualUrlPlugin {
17093
17663
  type WarningFilterItemTypes =
17094
17664
  | string
17095
17665
  | RegExp
17096
- | ((warning: StatsError, value: string) => boolean);
17666
+ | ((warning: StatsError, warningString: string) => boolean);
17097
17667
  declare interface WatchFileSystem {
17098
17668
  watch: (
17099
17669
  files: Iterable<string>,
@@ -17216,8 +17786,8 @@ declare interface WatcherInfo {
17216
17786
  declare abstract class Watching {
17217
17787
  startTime: null | number;
17218
17788
  invalid: boolean;
17219
- handler: CallbackFunction_1<Stats>;
17220
- callbacks: CallbackFunction_1<void>[];
17789
+ handler: CallbackWebpackFunction_2<Stats, void>;
17790
+ callbacks: ((err: null | Error, result?: void) => void)[];
17221
17791
  closed: boolean;
17222
17792
  suspended: boolean;
17223
17793
  blocked: boolean;
@@ -17232,10 +17802,10 @@ declare abstract class Watching {
17232
17802
  dirs: Iterable<string>,
17233
17803
  missing: Iterable<string>
17234
17804
  ): void;
17235
- invalidate(callback?: CallbackFunction_1<void>): void;
17805
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
17236
17806
  suspend(): void;
17237
17807
  resume(): void;
17238
- close(callback: CallbackFunction_1<void>): void;
17808
+ close(callback: (err: null | Error, result?: void) => void): void;
17239
17809
  }
17240
17810
  declare abstract class WeakTupleMap<K extends any[], V> {
17241
17811
  set(...args: [K, ...V[]]): void;
@@ -17528,11 +18098,6 @@ declare interface WebpackOptionsNormalized {
17528
18098
  * Add additional plugins to the compiler.
17529
18099
  */
17530
18100
  plugins: (
17531
- | undefined
17532
- | null
17533
- | false
17534
- | ""
17535
- | 0
17536
18101
  | ((this: Compiler, compiler: Compiler) => void)
17537
18102
  | WebpackPluginInstance
17538
18103
  )[];
@@ -17587,6 +18152,49 @@ declare interface WebpackOptionsNormalized {
17587
18152
  */
17588
18153
  watchOptions: WatchOptions;
17589
18154
  }
18155
+ type WebpackOptionsNormalizedWithDefaults = WebpackOptionsNormalized & {
18156
+ context: string;
18157
+ } & { infrastructureLogging: InfrastructureLoggingNormalizedWithDefaults } & {
18158
+ target: NonNullable<undefined | string | false | string[]>;
18159
+ } & { output: OutputNormalizedWithDefaults } & {
18160
+ optimization: OptimizationNormalizedWithDefaults;
18161
+ } & { devtool: NonNullable<undefined | string | false> } & {
18162
+ stats: NonNullable<StatsValue>;
18163
+ } & { node: NonNullable<Node> } & {
18164
+ profile: NonNullable<undefined | boolean>;
18165
+ } & { parallelism: number } & { snapshot: SnapshotNormalizedWithDefaults } & {
18166
+ externalsPresets: ExternalsPresetsNormalizedWithDefaults;
18167
+ } & {
18168
+ externalsType: NonNullable<
18169
+ | undefined
18170
+ | "import"
18171
+ | "var"
18172
+ | "module"
18173
+ | "assign"
18174
+ | "this"
18175
+ | "window"
18176
+ | "self"
18177
+ | "global"
18178
+ | "commonjs"
18179
+ | "commonjs2"
18180
+ | "commonjs-module"
18181
+ | "commonjs-static"
18182
+ | "amd"
18183
+ | "amd-require"
18184
+ | "umd"
18185
+ | "umd2"
18186
+ | "jsonp"
18187
+ | "system"
18188
+ | "promise"
18189
+ | "module-import"
18190
+ | "script"
18191
+ | "node-commonjs"
18192
+ >;
18193
+ } & { watch: NonNullable<undefined | boolean> } & {
18194
+ performance: NonNullable<undefined | false | PerformanceOptions>;
18195
+ } & { recordsInputPath: NonNullable<undefined | string | false> } & {
18196
+ recordsOutputPath: NonNullable<undefined | string | false>;
18197
+ };
17590
18198
 
17591
18199
  /**
17592
18200
  * Plugin instance.
@@ -17648,47 +18256,31 @@ type WriteFileOptions =
17648
18256
  declare interface WriteOnlySet<T> {
17649
18257
  add: (item: T) => void;
17650
18258
  }
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;
18259
+ type WriteStreamOptions = StreamOptions & {
17673
18260
  fs?: null | CreateWriteStreamFSImplementation;
18261
+ flush?: boolean;
18262
+ };
18263
+ declare interface chunkModuleHashMap {
18264
+ [index: number]: string;
18265
+ [index: string]: string;
17674
18266
  }
17675
18267
  declare function exports(
17676
18268
  options: Configuration,
17677
- callback?: CallbackWebpack<Stats>
18269
+ callback?: CallbackWebpackFunction_2<Stats, void>
17678
18270
  ): null | Compiler;
17679
18271
  declare function exports(
17680
18272
  options: MultiConfiguration,
17681
- callback?: CallbackWebpack<MultiStats>
18273
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17682
18274
  ): null | MultiCompiler;
17683
18275
  declare namespace exports {
17684
18276
  export const webpack: {
17685
18277
  (
17686
18278
  options: Configuration,
17687
- callback?: CallbackWebpack<Stats>
18279
+ callback?: CallbackWebpackFunction_2<Stats, void>
17688
18280
  ): null | Compiler;
17689
18281
  (
17690
18282
  options: MultiConfiguration,
17691
- callback?: CallbackWebpack<MultiStats>
18283
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17692
18284
  ): null | MultiCompiler;
17693
18285
  };
17694
18286
  export const validate: (
@@ -17772,7 +18364,9 @@ declare namespace exports {
17772
18364
  module: string | Module,
17773
18365
  options: {
17774
18366
  namespace?: string;
17775
- moduleFilenameTemplate?: string | ((context?: any) => string);
18367
+ moduleFilenameTemplate?:
18368
+ | string
18369
+ | ((context: ModuleFilenameTemplateContext) => string);
17776
18370
  },
17777
18371
  __2: {
17778
18372
  requestShortener: RequestShortener;
@@ -17874,6 +18468,7 @@ declare namespace exports {
17874
18468
  export let system: "__webpack_require__.System";
17875
18469
  export let systemContext: "__webpack_require__.y";
17876
18470
  export let thisAsExports: "top-level-this-exports";
18471
+ export let toBinary: "__webpack_require__.tb";
17877
18472
  export let uncaughtErrorHandler: "__webpack_require__.oe";
17878
18473
  export let wasmInstances: "__webpack_require__.w";
17879
18474
  }
@@ -17929,12 +18524,12 @@ declare namespace exports {
17929
18524
  export let addUsage: (
17930
18525
  state: ParserState,
17931
18526
  symbol: null | TopLevelSymbol,
17932
- usage: string | true | TopLevelSymbol
18527
+ usage: Usage
17933
18528
  ) => void;
17934
18529
  export let addVariableUsage: (
17935
18530
  parser: JavascriptParser,
17936
18531
  name: string,
17937
- usage: string | true | TopLevelSymbol
18532
+ usage: Usage
17938
18533
  ) => void;
17939
18534
  export let bailout: (parserState: ParserState) => void;
17940
18535
  export let enable: (parserState: ParserState) => void;
@@ -17955,7 +18550,7 @@ declare namespace exports {
17955
18550
  export let inferDependencyUsage: (state: ParserState) => void;
17956
18551
  export let isDependencyUsedByExports: (
17957
18552
  dependency: Dependency,
17958
- usedByExports: boolean | Set<string>,
18553
+ usedByExports: undefined | boolean | Set<string>,
17959
18554
  moduleGraph: ModuleGraph,
17960
18555
  runtime: RuntimeSpec
17961
18556
  ) => boolean;
@@ -18223,42 +18818,6 @@ declare namespace exports {
18223
18818
  export { SyncModuleIdsPlugin };
18224
18819
  }
18225
18820
  }
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
18821
  export type RuleSetUseFunction = (data: EffectData) =>
18263
18822
  | string
18264
18823
  | RuleSetUseFunction
@@ -18302,6 +18861,42 @@ declare namespace exports {
18302
18861
  this: Compiler,
18303
18862
  compiler: Compiler
18304
18863
  ) => void;
18864
+ export type ExternalItemFunctionCallback = (
18865
+ data: ExternalItemFunctionData,
18866
+ callback: (
18867
+ err?: null | Error,
18868
+ result?: string | boolean | string[] | { [index: string]: any }
18869
+ ) => void
18870
+ ) => void;
18871
+ export type ExternalItemFunctionDataGetResolve = (
18872
+ options?: ResolveOptions
18873
+ ) =>
18874
+ | ((
18875
+ context: string,
18876
+ request: string,
18877
+ callback: (
18878
+ err?: null | Error,
18879
+ result?: string | false,
18880
+ resolveRequest?: ResolveRequest
18881
+ ) => void
18882
+ ) => void)
18883
+ | ((context: string, request: string) => Promise<string>);
18884
+ export type ExternalItemFunctionDataGetResolveCallbackResult = (
18885
+ context: string,
18886
+ request: string,
18887
+ callback: (
18888
+ err?: null | Error,
18889
+ result?: string | false,
18890
+ resolveRequest?: ResolveRequest
18891
+ ) => void
18892
+ ) => void;
18893
+ export type ExternalItemFunctionDataGetResolveResult = (
18894
+ context: string,
18895
+ request: string
18896
+ ) => Promise<string>;
18897
+ export type ExternalItemFunctionPromise = (
18898
+ data: ExternalItemFunctionData
18899
+ ) => Promise<ExternalItemValue>;
18305
18900
  export {
18306
18901
  AutomaticPrefetchPlugin,
18307
18902
  AsyncDependenciesBlock,
@@ -18367,7 +18962,6 @@ declare namespace exports {
18367
18962
  EntryObject,
18368
18963
  ExternalItem,
18369
18964
  ExternalItemFunction,
18370
- ExternalItemFunctionData,
18371
18965
  ExternalItemObjectKnown,
18372
18966
  ExternalItemObjectUnknown,
18373
18967
  ExternalItemValue,
@@ -18389,12 +18983,14 @@ declare namespace exports {
18389
18983
  WebpackOptionsNormalized,
18390
18984
  WebpackPluginInstance,
18391
18985
  ChunkGroup,
18986
+ AssetEmittedInfo,
18392
18987
  Asset,
18393
18988
  AssetInfo,
18394
18989
  EntryOptions,
18395
18990
  PathData,
18396
- AssetEmittedInfo,
18991
+ CodeGenerationResults,
18397
18992
  Entrypoint,
18993
+ ExternalItemFunctionData,
18398
18994
  MultiCompilerOptions,
18399
18995
  MultiConfiguration,
18400
18996
  MultiStats,
@@ -18438,6 +19034,9 @@ declare namespace exports {
18438
19034
  LoaderContextDeclarationsIndex as LoaderContext
18439
19035
  };
18440
19036
  }
19037
+ declare const idsSymbolCommonJsExportRequireDependency: unique symbol;
19038
+ declare const idsSymbolHarmonyExportImportedSpecifierDependency: unique symbol;
19039
+ declare const idsSymbolHarmonyImportSpecifierDependency: unique symbol;
18441
19040
  declare const topLevelSymbolTag: unique symbol;
18442
19041
 
18443
19042
  export = exports;