webpack 5.101.2 → 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 (323) 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 +18 -10
  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 +18 -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/async-modules/AwaitDependenciesInitFragment.js +4 -1
  93. package/lib/buildChunkGraph.js +0 -1
  94. package/lib/cache/MemoryCachePlugin.js +0 -2
  95. package/lib/cache/MemoryWithGcCachePlugin.js +0 -2
  96. package/lib/cache/PackFileCacheStrategy.js +14 -1
  97. package/lib/cache/ResolverCachePlugin.js +9 -15
  98. package/lib/config/defaults.js +155 -21
  99. package/lib/config/normalization.js +18 -3
  100. package/lib/container/ContainerEntryDependency.js +0 -1
  101. package/lib/container/ContainerEntryModule.js +3 -7
  102. package/lib/container/ContainerPlugin.js +1 -2
  103. package/lib/container/ContainerReferencePlugin.js +0 -1
  104. package/lib/container/FallbackDependency.js +2 -1
  105. package/lib/container/FallbackModule.js +6 -7
  106. package/lib/container/ModuleFederationPlugin.js +0 -1
  107. package/lib/container/RemoteModule.js +8 -8
  108. package/lib/container/RemoteRuntimeModule.js +2 -2
  109. package/lib/css/CssGenerator.js +3 -6
  110. package/lib/css/CssLoadingRuntimeModule.js +6 -9
  111. package/lib/css/CssModulesPlugin.js +11 -13
  112. package/lib/css/CssParser.js +3 -3
  113. package/lib/css/walkCssTokens.js +1 -1
  114. package/lib/debug/ProfilingPlugin.js +35 -8
  115. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +12 -17
  116. package/lib/dependencies/AMDPlugin.js +2 -2
  117. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -2
  118. package/lib/dependencies/CachedConstDependency.js +0 -4
  119. package/lib/dependencies/CommonJsExportRequireDependency.js +20 -14
  120. package/lib/dependencies/CommonJsExportsDependency.js +2 -1
  121. package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -5
  122. package/lib/dependencies/CommonJsFullRequireDependency.js +6 -4
  123. package/lib/dependencies/CommonJsImportsParserPlugin.js +16 -7
  124. package/lib/dependencies/CommonJsRequireContextDependency.js +1 -1
  125. package/lib/dependencies/CommonJsSelfReferenceDependency.js +4 -4
  126. package/lib/dependencies/ConstDependency.js +2 -2
  127. package/lib/dependencies/ContextDependency.js +9 -4
  128. package/lib/dependencies/ContextDependencyHelpers.js +2 -2
  129. package/lib/dependencies/ContextDependencyTemplateAsId.js +9 -9
  130. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +9 -9
  131. package/lib/dependencies/ContextElementDependency.js +22 -11
  132. package/lib/dependencies/CssIcssImportDependency.js +0 -2
  133. package/lib/dependencies/CssIcssSymbolDependency.js +2 -2
  134. package/lib/dependencies/CssImportDependency.js +0 -8
  135. package/lib/dependencies/CssLocalIdentifierDependency.js +3 -4
  136. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -2
  137. package/lib/dependencies/CssUrlDependency.js +0 -6
  138. package/lib/dependencies/ExportsInfoDependency.js +7 -9
  139. package/lib/dependencies/ExternalModuleDependency.js +0 -3
  140. package/lib/dependencies/ExternalModuleInitFragment.js +1 -1
  141. package/lib/dependencies/HarmonyAcceptDependency.js +1 -1
  142. package/lib/dependencies/HarmonyAcceptImportDependency.js +0 -4
  143. package/lib/dependencies/HarmonyCompatibilityDependency.js +0 -1
  144. package/lib/dependencies/HarmonyDetectionParserPlugin.js +0 -14
  145. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -3
  146. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -1
  147. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +29 -35
  148. package/lib/dependencies/HarmonyImportDependency.js +30 -14
  149. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +38 -24
  150. package/lib/dependencies/HarmonyImportSideEffectDependency.js +0 -4
  151. package/lib/dependencies/HarmonyImportSpecifierDependency.js +46 -31
  152. package/lib/dependencies/HarmonyModulesPlugin.js +3 -3
  153. package/lib/dependencies/ImportDependency.js +18 -6
  154. package/lib/dependencies/ImportEagerDependency.js +2 -3
  155. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -5
  156. package/lib/dependencies/ImportMetaContextPlugin.js +0 -1
  157. package/lib/dependencies/ImportMetaPlugin.js +8 -1
  158. package/lib/dependencies/ImportParserPlugin.js +294 -45
  159. package/lib/dependencies/ImportWeakDependency.js +2 -3
  160. package/lib/dependencies/JsonExportsDependency.js +0 -1
  161. package/lib/dependencies/LoaderDependency.js +0 -3
  162. package/lib/dependencies/LoaderImportDependency.js +0 -3
  163. package/lib/dependencies/LoaderPlugin.js +11 -5
  164. package/lib/dependencies/ModuleDecoratorDependency.js +2 -4
  165. package/lib/dependencies/ModuleDependency.js +3 -9
  166. package/lib/dependencies/NullDependency.js +2 -0
  167. package/lib/dependencies/ProvidedDependency.js +6 -8
  168. package/lib/dependencies/PureExpressionDependency.js +0 -1
  169. package/lib/dependencies/RequireEnsureDependenciesBlock.js +0 -1
  170. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -2
  171. package/lib/dependencies/RequireIncludeDependency.js +2 -2
  172. package/lib/dependencies/RequireResolveDependency.js +2 -2
  173. package/lib/dependencies/RuntimeRequirementsDependency.js +2 -3
  174. package/lib/dependencies/StaticExportsDependency.js +3 -5
  175. package/lib/dependencies/URLDependency.js +2 -7
  176. package/lib/dependencies/URLPlugin.js +1 -2
  177. package/lib/dependencies/WebAssemblyExportImportedDependency.js +2 -2
  178. package/lib/dependencies/WebAssemblyImportDependency.js +2 -2
  179. package/lib/dependencies/WebpackIsIncludedDependency.js +2 -3
  180. package/lib/dependencies/WorkerDependency.js +2 -3
  181. package/lib/dependencies/WorkerPlugin.js +3 -9
  182. package/lib/dependencies/processExportInfo.js +2 -3
  183. package/lib/esm/ModuleChunkFormatPlugin.js +0 -3
  184. package/lib/esm/ModuleChunkLoadingPlugin.js +2 -1
  185. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -7
  186. package/lib/hmr/LazyCompilationPlugin.js +6 -4
  187. package/lib/hmr/lazyCompilationBackend.js +13 -10
  188. package/lib/ids/DeterministicChunkIdsPlugin.js +0 -1
  189. package/lib/ids/NamedChunkIdsPlugin.js +1 -6
  190. package/lib/ids/NamedModuleIdsPlugin.js +1 -5
  191. package/lib/ids/NaturalChunkIdsPlugin.js +0 -1
  192. package/lib/ids/NaturalModuleIdsPlugin.js +0 -1
  193. package/lib/ids/OccurrenceChunkIdsPlugin.js +0 -1
  194. package/lib/ids/OccurrenceModuleIdsPlugin.js +0 -1
  195. package/lib/ids/SyncModuleIdsPlugin.js +4 -3
  196. package/lib/index.js +8 -7
  197. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -1
  198. package/lib/javascript/BasicEvaluatedExpression.js +13 -6
  199. package/lib/javascript/ChunkFormatHelpers.js +1 -1
  200. package/lib/javascript/CommonJsChunkFormatPlugin.js +0 -1
  201. package/lib/javascript/JavascriptGenerator.js +2 -3
  202. package/lib/javascript/JavascriptModulesPlugin.js +44 -21
  203. package/lib/javascript/JavascriptParser.js +159 -93
  204. package/lib/javascript/JavascriptParserHelpers.js +2 -2
  205. package/lib/javascript/StartupHelpers.js +2 -4
  206. package/lib/json/JsonData.js +1 -1
  207. package/lib/json/JsonGenerator.js +4 -5
  208. package/lib/json/JsonModulesPlugin.js +0 -3
  209. package/lib/json/JsonParser.js +4 -2
  210. package/lib/library/AbstractLibraryPlugin.js +2 -2
  211. package/lib/library/AmdLibraryPlugin.js +0 -1
  212. package/lib/library/AssignLibraryPlugin.js +23 -12
  213. package/lib/library/EnableLibraryPlugin.js +7 -11
  214. package/lib/library/ExportPropertyLibraryPlugin.js +8 -20
  215. package/lib/library/JsonpLibraryPlugin.js +5 -2
  216. package/lib/library/ModuleLibraryPlugin.js +88 -43
  217. package/lib/library/SystemLibraryPlugin.js +0 -1
  218. package/lib/library/UmdLibraryPlugin.js +12 -18
  219. package/lib/logging/Logger.js +12 -10
  220. package/lib/logging/createConsoleLogger.js +15 -14
  221. package/lib/logging/truncateArgs.js +1 -1
  222. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
  223. package/lib/node/NodeWatchFileSystem.js +4 -4
  224. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
  225. package/lib/node/RequireChunkLoadingRuntimeModule.js +5 -2
  226. package/lib/node/nodeConsole.js +2 -2
  227. package/lib/optimize/AggressiveSplittingPlugin.js +2 -0
  228. package/lib/optimize/ConcatenatedModule.js +142 -100
  229. package/lib/optimize/InnerGraph.js +17 -11
  230. package/lib/optimize/InnerGraphPlugin.js +0 -3
  231. package/lib/optimize/ModuleConcatenationPlugin.js +3 -4
  232. package/lib/optimize/RuntimeChunkPlugin.js +0 -1
  233. package/lib/optimize/SideEffectsFlagPlugin.js +3 -10
  234. package/lib/optimize/SplitChunksPlugin.js +46 -40
  235. package/lib/performance/SizeLimitsPlugin.js +2 -1
  236. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +5 -7
  237. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +0 -2
  238. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +0 -1
  239. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +2 -2
  240. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +2 -2
  241. package/lib/rules/BasicMatcherRulePlugin.js +0 -2
  242. package/lib/rules/ObjectMatcherRulePlugin.js +0 -1
  243. package/lib/rules/RuleSetCompiler.js +8 -6
  244. package/lib/runtime/BaseUriRuntimeModule.js +2 -2
  245. package/lib/runtime/CompatRuntimeModule.js +0 -1
  246. package/lib/runtime/GetChunkFilenameRuntimeModule.js +8 -9
  247. package/lib/runtime/LoadScriptRuntimeModule.js +0 -2
  248. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
  249. package/lib/runtime/PublicPathRuntimeModule.js +2 -2
  250. package/lib/runtime/StartupEntrypointRuntimeModule.js +0 -1
  251. package/lib/runtime/SystemContextRuntimeModule.js +0 -2
  252. package/lib/runtime/ToBinaryRuntimeModule.js +64 -0
  253. package/lib/schemes/DataUriPlugin.js +2 -28
  254. package/lib/schemes/FileUriPlugin.js +5 -2
  255. package/lib/schemes/HttpUriPlugin.js +4 -2
  256. package/lib/schemes/VirtualUrlPlugin.js +11 -11
  257. package/lib/serialization/NullPrototypeObjectSerializer.js +5 -3
  258. package/lib/serialization/ObjectMiddleware.js +30 -19
  259. package/lib/serialization/SerializerMiddleware.js +1 -3
  260. package/lib/serialization/types.js +1 -1
  261. package/lib/sharing/ConsumeSharedModule.js +3 -5
  262. package/lib/sharing/ConsumeSharedPlugin.js +2 -4
  263. package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -6
  264. package/lib/sharing/ProvideSharedModule.js +3 -7
  265. package/lib/sharing/SharePlugin.js +0 -2
  266. package/lib/sharing/ShareRuntimeModule.js +4 -1
  267. package/lib/sharing/resolveMatchedConfigs.js +14 -6
  268. package/lib/sharing/utils.js +0 -6
  269. package/lib/stats/DefaultStatsFactoryPlugin.js +178 -94
  270. package/lib/stats/DefaultStatsPresetPlugin.js +15 -9
  271. package/lib/stats/DefaultStatsPrinterPlugin.js +77 -113
  272. package/lib/stats/StatsFactory.js +14 -11
  273. package/lib/url/URLParserPlugin.js +2 -4
  274. package/lib/util/ArrayHelpers.js +4 -4
  275. package/lib/util/AsyncQueue.js +1 -0
  276. package/lib/util/LazySet.js +2 -2
  277. package/lib/util/StackedCacheMap.js +0 -2
  278. package/lib/util/TupleSet.js +9 -4
  279. package/lib/util/URLAbsoluteSpecifier.js +0 -1
  280. package/lib/util/WeakTupleMap.js +1 -1
  281. package/lib/util/chainedImports.js +3 -1
  282. package/lib/util/cleverMerge.js +15 -18
  283. package/lib/util/comparators.js +2 -4
  284. package/lib/util/compileBooleanMatcher.js +11 -9
  285. package/lib/util/concatenate.js +1 -2
  286. package/lib/util/create-schema-validation.js +0 -1
  287. package/lib/util/dataURL.js +39 -0
  288. package/lib/util/deprecation.js +29 -31
  289. package/lib/util/deterministicGrouping.js +34 -30
  290. package/lib/util/extractSourceMap.js +319 -0
  291. package/lib/util/findGraphRoots.js +15 -5
  292. package/lib/util/fs.js +29 -8
  293. package/lib/util/semver.js +9 -8
  294. package/lib/util/smartGrouping.js +41 -26
  295. package/lib/util/traverseDestructuringAssignmentProperties.js +45 -0
  296. package/lib/wasm/EnableWasmLoadingPlugin.js +3 -2
  297. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
  298. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +2 -13
  299. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -9
  300. package/lib/wasm-async/AsyncWebAssemblyParser.js +2 -1
  301. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +6 -4
  302. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -3
  303. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -4
  304. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -7
  305. package/lib/wasm-sync/WebAssemblyParser.js +1 -4
  306. package/lib/web/JsonpChunkLoadingPlugin.js +2 -1
  307. package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
  308. package/lib/web/JsonpTemplatePlugin.js +0 -1
  309. package/lib/webpack.js +21 -8
  310. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -1
  311. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  312. package/package.json +13 -13
  313. package/schemas/WebpackOptions.check.js +1 -1
  314. package/schemas/WebpackOptions.json +77 -93
  315. package/schemas/plugins/BannerPlugin.check.js +1 -1
  316. package/schemas/plugins/BannerPlugin.json +4 -0
  317. package/schemas/plugins/IgnorePlugin.json +1 -1
  318. package/schemas/plugins/ProgressPlugin.json +1 -1
  319. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  320. package/schemas/plugins/SourceMapDevToolPlugin.json +5 -1
  321. package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
  322. package/types.d.ts +1140 -505
  323. 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
@@ -663,12 +685,12 @@ declare abstract class BasicEvaluatedExpression {
663
685
  | MethodDefinition
664
686
  | PropertyDefinition
665
687
  | VariableDeclarator
666
- | SwitchCase
667
- | CatchClause
668
688
  | ObjectPattern
669
689
  | ArrayPattern
670
690
  | RestElement
671
691
  | AssignmentPattern
692
+ | SwitchCase
693
+ | CatchClause
672
694
  | Property
673
695
  | AssignmentProperty
674
696
  | ClassBody
@@ -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
@@ -894,12 +916,12 @@ declare abstract class BasicEvaluatedExpression {
894
916
  | MethodDefinition
895
917
  | PropertyDefinition
896
918
  | VariableDeclarator
897
- | SwitchCase
898
- | CatchClause
899
919
  | ObjectPattern
900
920
  | ArrayPattern
901
921
  | RestElement
902
922
  | AssignmentPattern
923
+ | SwitchCase
924
+ | CatchClause
903
925
  | Property
904
926
  | AssignmentProperty
905
927
  | ClassBody
@@ -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,
@@ -6855,6 +7010,10 @@ declare class JavascriptParser extends ParserClass {
6855
7010
  varDeclarationUsing: HookMap<SyncBailHook<[Identifier], boolean | void>>;
6856
7011
  varDeclarationVar: HookMap<SyncBailHook<[Identifier], boolean | void>>;
6857
7012
  pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
7013
+ collectDestructuringAssignmentProperties: SyncBailHook<
7014
+ [Expression],
7015
+ boolean | void
7016
+ >;
6858
7017
  canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
6859
7018
  rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
6860
7019
  assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
@@ -6863,7 +7022,10 @@ declare class JavascriptParser extends ParserClass {
6863
7022
  >;
6864
7023
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
6865
7024
  importCall: SyncBailHook<
6866
- [ImportExpressionJavascriptParser],
7025
+ [
7026
+ ImportExpressionJavascriptParser,
7027
+ undefined | SimpleCallExpression | NewExpression
7028
+ ],
6867
7029
  boolean | void
6868
7030
  >;
6869
7031
  topLevelAwait: SyncBailHook<
@@ -6957,9 +7119,9 @@ declare class JavascriptParser extends ParserClass {
6957
7119
  semicolons?: Set<number>;
6958
7120
  statementPath?: StatementPathItem[];
6959
7121
  prevStatement?:
6960
- | ImportDeclarationJavascriptParser
6961
- | ExportNamedDeclarationJavascriptParser
6962
- | ExportAllDeclarationJavascriptParser
7122
+ | ImportDeclaration
7123
+ | ExportNamedDeclaration
7124
+ | ExportAllDeclaration
6963
7125
  | ImportExpressionImport
6964
7126
  | UnaryExpression
6965
7127
  | ArrayExpression
@@ -7016,7 +7178,13 @@ declare class JavascriptParser extends ParserClass {
7016
7178
  Expression,
7017
7179
  Set<DestructuringAssignmentProperty>
7018
7180
  >;
7019
- currentTagData?: TagData;
7181
+ currentTagData?:
7182
+ | Record<string, any>
7183
+ | TopLevelSymbol
7184
+ | HarmonySettings
7185
+ | ImportSettings
7186
+ | CommonJsImportSettings
7187
+ | CompatibilitySettings;
7020
7188
  magicCommentContext: Context;
7021
7189
  destructuringAssignmentPropertiesFor(
7022
7190
  node: Expression
@@ -7061,9 +7229,9 @@ declare class JavascriptParser extends ParserClass {
7061
7229
  */
7062
7230
  modulePreWalkStatements(
7063
7231
  statements: (
7064
- | ImportDeclarationJavascriptParser
7065
- | ExportNamedDeclarationJavascriptParser
7066
- | ExportAllDeclarationJavascriptParser
7232
+ | ImportDeclaration
7233
+ | ExportNamedDeclaration
7234
+ | ExportAllDeclaration
7067
7235
  | FunctionDeclaration
7068
7236
  | VariableDeclaration
7069
7237
  | ClassDeclaration
@@ -7095,9 +7263,9 @@ declare class JavascriptParser extends ParserClass {
7095
7263
  */
7096
7264
  preWalkStatements(
7097
7265
  statements: (
7098
- | ImportDeclarationJavascriptParser
7099
- | ExportNamedDeclarationJavascriptParser
7100
- | ExportAllDeclarationJavascriptParser
7266
+ | ImportDeclaration
7267
+ | ExportNamedDeclaration
7268
+ | ExportAllDeclaration
7101
7269
  | FunctionDeclaration
7102
7270
  | VariableDeclaration
7103
7271
  | ClassDeclaration
@@ -7129,9 +7297,9 @@ declare class JavascriptParser extends ParserClass {
7129
7297
  */
7130
7298
  blockPreWalkStatements(
7131
7299
  statements: (
7132
- | ImportDeclarationJavascriptParser
7133
- | ExportNamedDeclarationJavascriptParser
7134
- | ExportAllDeclarationJavascriptParser
7300
+ | ImportDeclaration
7301
+ | ExportNamedDeclaration
7302
+ | ExportAllDeclaration
7135
7303
  | FunctionDeclaration
7136
7304
  | VariableDeclaration
7137
7305
  | ClassDeclaration
@@ -7163,9 +7331,9 @@ declare class JavascriptParser extends ParserClass {
7163
7331
  */
7164
7332
  walkStatements(
7165
7333
  statements: (
7166
- | ImportDeclarationJavascriptParser
7167
- | ExportNamedDeclarationJavascriptParser
7168
- | ExportAllDeclarationJavascriptParser
7334
+ | ImportDeclaration
7335
+ | ExportNamedDeclaration
7336
+ | ExportAllDeclaration
7169
7337
  | FunctionDeclaration
7170
7338
  | VariableDeclaration
7171
7339
  | ClassDeclaration
@@ -7197,9 +7365,9 @@ declare class JavascriptParser extends ParserClass {
7197
7365
  */
7198
7366
  preWalkStatement(
7199
7367
  statement:
7200
- | ImportDeclarationJavascriptParser
7201
- | ExportNamedDeclarationJavascriptParser
7202
- | ExportAllDeclarationJavascriptParser
7368
+ | ImportDeclaration
7369
+ | ExportNamedDeclaration
7370
+ | ExportAllDeclaration
7203
7371
  | FunctionDeclaration
7204
7372
  | MaybeNamedFunctionDeclaration
7205
7373
  | VariableDeclaration
@@ -7228,9 +7396,9 @@ declare class JavascriptParser extends ParserClass {
7228
7396
  ): void;
7229
7397
  blockPreWalkStatement(
7230
7398
  statement:
7231
- | ImportDeclarationJavascriptParser
7232
- | ExportNamedDeclarationJavascriptParser
7233
- | ExportAllDeclarationJavascriptParser
7399
+ | ImportDeclaration
7400
+ | ExportNamedDeclaration
7401
+ | ExportAllDeclaration
7234
7402
  | FunctionDeclaration
7235
7403
  | MaybeNamedFunctionDeclaration
7236
7404
  | VariableDeclaration
@@ -7259,9 +7427,9 @@ declare class JavascriptParser extends ParserClass {
7259
7427
  ): void;
7260
7428
  walkStatement(
7261
7429
  statement:
7262
- | ImportDeclarationJavascriptParser
7263
- | ExportNamedDeclarationJavascriptParser
7264
- | ExportAllDeclarationJavascriptParser
7430
+ | ImportDeclaration
7431
+ | ExportNamedDeclaration
7432
+ | ExportAllDeclaration
7265
7433
  | FunctionDeclaration
7266
7434
  | MaybeNamedFunctionDeclaration
7267
7435
  | VariableDeclaration
@@ -7329,29 +7497,51 @@ declare class JavascriptParser extends ParserClass {
7329
7497
  ): void;
7330
7498
  blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
7331
7499
  preWalkAssignmentExpression(expression: AssignmentExpression): void;
7332
- modulePreWalkImportDeclaration(
7333
- statement: ImportDeclarationJavascriptParser
7334
- ): void;
7500
+ enterDestructuringAssignment(
7501
+ pattern: Pattern,
7502
+ expression: Expression
7503
+ ):
7504
+ | undefined
7505
+ | ImportExpressionImport
7506
+ | UnaryExpression
7507
+ | ArrayExpression
7508
+ | ArrowFunctionExpression
7509
+ | AssignmentExpression
7510
+ | AwaitExpression
7511
+ | BinaryExpression
7512
+ | SimpleCallExpression
7513
+ | NewExpression
7514
+ | ChainExpression
7515
+ | ClassExpression
7516
+ | ConditionalExpression
7517
+ | FunctionExpression
7518
+ | Identifier
7519
+ | SimpleLiteral
7520
+ | RegExpLiteral
7521
+ | BigIntLiteral
7522
+ | LogicalExpression
7523
+ | MemberExpression
7524
+ | MetaProperty
7525
+ | ObjectExpression
7526
+ | SequenceExpression
7527
+ | TaggedTemplateExpression
7528
+ | TemplateLiteral
7529
+ | ThisExpression
7530
+ | UpdateExpression
7531
+ | YieldExpression;
7532
+ modulePreWalkImportDeclaration(statement: ImportDeclaration): void;
7335
7533
  enterDeclaration(
7336
7534
  declaration: Declaration,
7337
7535
  onIdent: (ident: string, identifier: Identifier) => void
7338
7536
  ): void;
7339
- modulePreWalkExportNamedDeclaration(
7340
- statement: ExportNamedDeclarationJavascriptParser
7341
- ): void;
7342
- blockPreWalkExportNamedDeclaration(
7343
- statement: ExportNamedDeclarationJavascriptParser
7344
- ): void;
7345
- walkExportNamedDeclaration(
7346
- statement: ExportNamedDeclarationJavascriptParser
7347
- ): void;
7537
+ modulePreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7538
+ blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7539
+ walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
7348
7540
  blockPreWalkExportDefaultDeclaration(
7349
7541
  statement: ExportDefaultDeclaration
7350
7542
  ): void;
7351
7543
  walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
7352
- modulePreWalkExportAllDeclaration(
7353
- statement: ExportAllDeclarationJavascriptParser
7354
- ): void;
7544
+ modulePreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
7355
7545
  preWalkVariableDeclaration(statement: VariableDeclaration): void;
7356
7546
  blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
7357
7547
  preWalkVariableDeclarator(declarator: VariableDeclarator): void;
@@ -7561,7 +7751,7 @@ declare class JavascriptParser extends ParserClass {
7561
7751
  hookMap: HookMap<SyncBailHook<T, R>>,
7562
7752
  info: ExportedVariableInfo,
7563
7753
  fallback: undefined | ((name: string) => undefined | R),
7564
- defined: undefined | ((result?: string) => any),
7754
+ defined: undefined | ((result?: string) => undefined | R),
7565
7755
  ...args: AsArray<T>
7566
7756
  ): undefined | R;
7567
7757
  callHooksForNameWithFallback<T, R>(
@@ -7601,9 +7791,9 @@ declare class JavascriptParser extends ParserClass {
7601
7791
  inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
7602
7792
  detectMode(
7603
7793
  statements: (
7604
- | ImportDeclarationJavascriptParser
7605
- | ExportNamedDeclarationJavascriptParser
7606
- | ExportAllDeclarationJavascriptParser
7794
+ | ImportDeclaration
7795
+ | ExportNamedDeclaration
7796
+ | ExportAllDeclaration
7607
7797
  | FunctionDeclaration
7608
7798
  | VariableDeclaration
7609
7799
  | ClassDeclaration
@@ -7754,11 +7944,27 @@ declare class JavascriptParser extends ParserClass {
7754
7944
  setAsiPosition(pos: number): void;
7755
7945
  unsetAsiPosition(pos: number): void;
7756
7946
  isStatementLevelExpression(expr: Expression): boolean;
7757
- 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;
7758
7958
  tagVariable(
7759
7959
  name: string,
7760
7960
  tag: symbol,
7761
- data?: TagData,
7961
+ data?:
7962
+ | Record<string, any>
7963
+ | TopLevelSymbol
7964
+ | HarmonySettings
7965
+ | ImportSettings
7966
+ | CommonJsImportSettings
7967
+ | CompatibilitySettings,
7762
7968
  flags?: 0 | 1 | 2 | 4
7763
7969
  ): void;
7764
7970
  defineVariable(name: string): void;
@@ -7874,7 +8080,7 @@ declare class JavascriptParser extends ParserClass {
7874
8080
  allowedTypes: number
7875
8081
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
7876
8082
  getNameForExpression(
7877
- expression: MemberExpression
8083
+ expression: Expression
7878
8084
  ):
7879
8085
  | undefined
7880
8086
  | {
@@ -7897,9 +8103,9 @@ declare class JavascriptParser extends ParserClass {
7897
8103
  }>;
7898
8104
  static getImportAttributes: (
7899
8105
  node:
7900
- | ImportDeclarationJavascriptParser
7901
- | ExportNamedDeclarationJavascriptParser
7902
- | ExportAllDeclarationJavascriptParser
8106
+ | ImportDeclaration
8107
+ | ExportNamedDeclaration
8108
+ | ExportAllDeclaration
7903
8109
  | ImportExpressionJavascriptParser
7904
8110
  ) => undefined | ImportAttributes;
7905
8111
  }
@@ -8209,8 +8415,8 @@ declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
8209
8415
  static STAGE_TRIGGER: number;
8210
8416
  }
8211
8417
  declare interface JsonpCompilationPluginHooks {
8212
- linkPreload: SyncWaterfallHook<[string, Chunk]>;
8213
- linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
8418
+ linkPreload: SyncWaterfallHook<[string, Chunk], string>;
8419
+ linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
8214
8420
  }
8215
8421
  declare class JsonpTemplatePlugin {
8216
8422
  constructor();
@@ -8337,7 +8543,7 @@ declare interface KnownBuildInfo {
8337
8543
  /**
8338
8544
  * using in NormalModule
8339
8545
  */
8340
- valueDependencies?: Map<string, string | Set<string>>;
8546
+ valueDependencies?: Map<string, ValueCacheVersion>;
8341
8547
 
8342
8548
  /**
8343
8549
  * using in NormalModule
@@ -8408,6 +8614,7 @@ declare interface KnownBuildMeta {
8408
8614
  exportsType?: "namespace" | "dynamic" | "default" | "flagged";
8409
8615
  defaultObject?: false | "redirect" | "redirect-warn";
8410
8616
  strictHarmonyModule?: boolean;
8617
+ treatAsCommonJs?: boolean;
8411
8618
  async?: boolean;
8412
8619
  sideEffectFree?: boolean;
8413
8620
  isCSSModule?: boolean;
@@ -8450,6 +8657,10 @@ declare interface KnownHooks {
8450
8657
  */
8451
8658
  result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
8452
8659
  }
8660
+ declare interface KnownMeta {
8661
+ importVarMap?: Map<Module, string>;
8662
+ deferredImportVarMap?: Map<Module, string>;
8663
+ }
8453
8664
  declare interface KnownNormalizedStatsOptions {
8454
8665
  context: string;
8455
8666
  requestShortener: RequestShortener;
@@ -8489,7 +8700,7 @@ declare interface KnownNormalizedStatsOptions {
8489
8700
  modulesSpace: number;
8490
8701
  chunkModulesSpace: number;
8491
8702
  nestedModulesSpace: number;
8492
- logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
8703
+ logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
8493
8704
  loggingDebug: ((value: string) => boolean)[];
8494
8705
  loggingTrace: boolean;
8495
8706
  }
@@ -8539,24 +8750,24 @@ declare interface KnownStatsChunk {
8539
8750
  hash: string;
8540
8751
  childrenByOrder: Record<string, ChunkId[]>;
8541
8752
  id?: string | number;
8542
- siblings?: (string | number)[];
8543
- parents?: (string | number)[];
8544
- children?: (string | number)[];
8753
+ siblings?: ChunkId[];
8754
+ parents?: ChunkId[];
8755
+ children?: ChunkId[];
8545
8756
  modules?: StatsModule[];
8546
8757
  filteredModules?: number;
8547
8758
  origins?: StatsChunkOrigin[];
8548
8759
  }
8549
8760
  declare interface KnownStatsChunkGroup {
8550
8761
  name?: null | string;
8551
- chunks?: (string | number)[];
8762
+ chunks?: ChunkId[];
8552
8763
  assets?: { name: string; size?: number }[];
8553
8764
  filteredAssets?: number;
8554
8765
  assetsSize?: number;
8555
8766
  auxiliaryAssets?: { name: string; size?: number }[];
8556
8767
  filteredAuxiliaryAssets?: number;
8557
8768
  auxiliaryAssetsSize?: number;
8558
- children?: { [index: string]: StatsChunkGroup[] };
8559
- childAssets?: { [index: string]: string[] };
8769
+ children?: Record<string, StatsChunkGroup[]>;
8770
+ childAssets?: Record<string, string[]>;
8560
8771
  isOverSizeLimit?: boolean;
8561
8772
  }
8562
8773
  declare interface KnownStatsChunkOrigin {
@@ -8614,14 +8825,14 @@ declare interface KnownStatsError {
8614
8825
  }
8615
8826
  declare interface KnownStatsFactoryContext {
8616
8827
  type: string;
8617
- makePathsRelative: (path: string) => string;
8618
8828
  compilation: Compilation;
8829
+ makePathsRelative: (path: string) => string;
8619
8830
  rootModules: Set<Module>;
8620
8831
  compilationFileToChunks: Map<string, Chunk[]>;
8621
8832
  compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
8622
8833
  runtime: RuntimeSpec;
8623
- cachedGetErrors: (compilation: Compilation) => WebpackError[];
8624
- cachedGetWarnings: (compilation: Compilation) => WebpackError[];
8834
+ cachedGetErrors: (compilation: Compilation) => Error[];
8835
+ cachedGetWarnings: (compilation: Compilation) => Error[];
8625
8836
  }
8626
8837
  declare interface KnownStatsLogging {
8627
8838
  entries: StatsLoggingEntry[];
@@ -8648,7 +8859,7 @@ declare interface KnownStatsModule {
8648
8859
  index2?: number;
8649
8860
  postOrderIndex?: number;
8650
8861
  size?: number;
8651
- sizes?: { [index: string]: number };
8862
+ sizes?: Record<string, number>;
8652
8863
  cacheable?: boolean;
8653
8864
  built?: boolean;
8654
8865
  codeGenerated?: boolean;
@@ -8658,8 +8869,8 @@ declare interface KnownStatsModule {
8658
8869
  orphan?: boolean;
8659
8870
  id?: string | number;
8660
8871
  issuerId?: null | string | number;
8661
- chunks?: (string | number)[];
8662
- assets?: (string | number)[];
8872
+ chunks?: ChunkId[];
8873
+ assets?: string[];
8663
8874
  dependent?: boolean;
8664
8875
  issuer?: null | string;
8665
8876
  issuerName?: null | string;
@@ -8854,7 +9065,10 @@ declare interface LazyCompilationDefaultBackendOptions {
8854
9065
  /**
8855
9066
  * Specifies where to listen to from the server.
8856
9067
  */
8857
- listen?: number | ListenOptions | ((server: Server) => void);
9068
+ listen?:
9069
+ | number
9070
+ | ListenOptions
9071
+ | ((server: ServerLazyCompilationBackend) => void);
8858
9072
 
8859
9073
  /**
8860
9074
  * Specifies the protocol the client should use to connect to the server.
@@ -8867,7 +9081,7 @@ declare interface LazyCompilationDefaultBackendOptions {
8867
9081
  server?:
8868
9082
  | ServerOptions<typeof IncomingMessage>
8869
9083
  | HttpsServerOptions
8870
- | (() => Server);
9084
+ | (() => ServerLazyCompilationBackend);
8871
9085
  }
8872
9086
 
8873
9087
  /**
@@ -8880,7 +9094,7 @@ declare interface LazyCompilationOptions {
8880
9094
  backend?:
8881
9095
  | ((
8882
9096
  compiler: Compiler,
8883
- callback: (err: null | Error, api?: BackendApi) => void
9097
+ callback: (err: null | Error, backendApi?: BackendApi) => void
8884
9098
  ) => void)
8885
9099
  | ((compiler: Compiler) => Promise<BackendApi>)
8886
9100
  | LazyCompilationDefaultBackendOptions;
@@ -9113,9 +9327,8 @@ declare interface LimitChunkCountPluginOptions {
9113
9327
  */
9114
9328
  maxChunks: number;
9115
9329
  }
9116
- type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
9117
9330
  declare interface LoadScriptCompilationHooks {
9118
- createScript: SyncWaterfallHook<[string, Chunk]>;
9331
+ createScript: SyncWaterfallHook<[string, Chunk], string>;
9119
9332
  }
9120
9333
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
9121
9334
  constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
@@ -9155,7 +9368,7 @@ type LoaderContextDeclarationsIndex<OptionsType> =
9155
9368
  LoaderRunnerLoaderContext<OptionsType> &
9156
9369
  LoaderPluginLoaderContext &
9157
9370
  HotModuleReplacementPluginLoaderContext;
9158
- type LoaderContextObject<T> = NormalModuleLoaderContext<T> &
9371
+ type LoaderContextVirtualUrlPlugin<T> = NormalModuleLoaderContext<T> &
9159
9372
  LoaderRunnerLoaderContext<T> &
9160
9373
  LoaderPluginLoaderContext &
9161
9374
  HotModuleReplacementPluginLoaderContext;
@@ -9184,8 +9397,8 @@ declare interface LoaderDefinitionFunction<
9184
9397
  declare interface LoaderItem {
9185
9398
  loader: string;
9186
9399
  options?: null | string | Record<string, any>;
9187
- ident: null | string;
9188
- type: null | string;
9400
+ ident?: null | string;
9401
+ type?: null | string;
9189
9402
  }
9190
9403
  declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
9191
9404
  default?:
@@ -9250,7 +9463,7 @@ declare interface LoaderPluginLoaderContext {
9250
9463
  importModule(
9251
9464
  request: string,
9252
9465
  options: undefined | ImportModuleOptions,
9253
- callback: (err?: null | Error, exports?: any) => any
9466
+ callback: (err?: null | Error, exports?: any) => void
9254
9467
  ): void;
9255
9468
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
9256
9469
  }
@@ -9419,8 +9632,8 @@ type LogTypeEnum =
9419
9632
  | "warn"
9420
9633
  | "info"
9421
9634
  | "log"
9422
- | "debug"
9423
9635
  | "profile"
9636
+ | "debug"
9424
9637
  | "trace"
9425
9638
  | "group"
9426
9639
  | "groupCollapsed"
@@ -9552,14 +9765,15 @@ declare abstract class MainTemplate {
9552
9765
  globalHash: { tap: () => void };
9553
9766
  hotBootstrap: { tap: () => never };
9554
9767
  bootstrap: SyncWaterfallHook<
9555
- [string, Chunk, string, ModuleTemplate, DependencyTemplates]
9768
+ [string, Chunk, string, ModuleTemplate, DependencyTemplates],
9769
+ string
9556
9770
  >;
9557
- localVars: SyncWaterfallHook<[string, Chunk, string]>;
9558
- requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
9559
- requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
9560
- get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
9561
- get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
9562
- 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>;
9563
9777
  }>;
9564
9778
  renderCurrentHashCode: (hash: string, length?: number) => string;
9565
9779
  getPublicPath: (options: PathData) => string;
@@ -9587,13 +9801,42 @@ declare interface MapOptions {
9587
9801
  module?: boolean;
9588
9802
  }
9589
9803
  declare interface MatchObject {
9590
- test?: string | RegExp | (string | RegExp)[];
9591
- include?: string | RegExp | (string | RegExp)[];
9592
- 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))[];
9593
9819
  }
9594
- type Matcher = string | RegExp | (string | RegExp)[];
9595
- type Media = undefined | string;
9596
-
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>[];
9837
+ }
9838
+ type Media = undefined | string;
9839
+
9597
9840
  /**
9598
9841
  * Options object for in-memory caching.
9599
9842
  */
@@ -9632,6 +9875,14 @@ declare interface MergeDuplicateChunksPluginOptions {
9632
9875
  */
9633
9876
  stage?: number;
9634
9877
  }
9878
+ type Meta = KnownMeta &
9879
+ Record<
9880
+ | typeof idsSymbolCommonJsExportRequireDependency
9881
+ | typeof idsSymbolHarmonyImportSpecifierDependency
9882
+ | typeof idsSymbolHarmonyExportImportedSpecifierDependency,
9883
+ string[]
9884
+ > &
9885
+ Record<string, any>;
9635
9886
  declare class MinChunkSizePlugin {
9636
9887
  constructor(options: MinChunkSizePluginOptions);
9637
9888
  options: MinChunkSizePluginOptions;
@@ -9784,7 +10035,7 @@ declare class Module extends DependenciesBlock {
9784
10035
  identifier(): string;
9785
10036
  readableIdentifier(requestShortener: RequestShortener): string;
9786
10037
  build(
9787
- options: WebpackOptionsNormalized,
10038
+ options: WebpackOptionsNormalizedWithDefaults,
9788
10039
  compilation: Compilation,
9789
10040
  resolver: ResolverWithOptions,
9790
10041
  fs: InputFileSystem,
@@ -9875,8 +10126,7 @@ declare class ModuleDependency extends Dependency {
9875
10126
  constructor(request: string);
9876
10127
  request: string;
9877
10128
  userRequest: string;
9878
- range: any;
9879
- assertions?: ImportAttributes;
10129
+ range?: [number, number];
9880
10130
  static Template: typeof DependencyTemplate;
9881
10131
  static NO_EXPORTS_REFERENCED: string[][];
9882
10132
  static EXPORTS_OBJECT_REFERENCED: string[][];
@@ -9890,10 +10140,14 @@ declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
9890
10140
  dependencyMeta?: ImportDependencyMeta,
9891
10141
  hashFunction?: string | typeof Hash
9892
10142
  );
10143
+ getImported(): Imported;
10144
+ setImported(imported: Imported): void;
9893
10145
  getNamespaceIdentifier(): string;
9894
- static addToSource<Context, T>(
10146
+ buildIdentifier(ident: string): string;
10147
+ buildImported(imported: Imported): Imported;
10148
+ static addToSource<Context>(
9895
10149
  source: Source,
9896
- initFragments: InitFragment<T>[],
10150
+ initFragments: MaybeMergeableInitFragment<Context>[],
9897
10151
  context: Context
9898
10152
  ): Source;
9899
10153
  static STAGE_CONSTANTS: number;
@@ -9919,7 +10173,7 @@ declare interface ModuleFactoryCreateData {
9919
10173
  }
9920
10174
  declare interface ModuleFactoryCreateDataContextInfo {
9921
10175
  issuer: string;
9922
- issuerLayer?: null | string;
10176
+ issuerLayer: IssuerLayer;
9923
10177
  compiler?: string;
9924
10178
  }
9925
10179
  declare interface ModuleFactoryResult {
@@ -10019,6 +10273,62 @@ declare interface ModuleFederationPluginOptions {
10019
10273
  */
10020
10274
  shared?: (string | SharedObject)[] | SharedObject;
10021
10275
  }
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
+ }
10022
10332
  type ModuleFilterItemTypes =
10023
10333
  | string
10024
10334
  | RegExp
@@ -10075,13 +10385,18 @@ declare class ModuleGraph {
10075
10385
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
10076
10386
  getIncomingConnectionsByOriginModule(
10077
10387
  module: Module
10078
- ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
10388
+ ): ReadonlyMap<
10389
+ undefined | null | Module,
10390
+ ReadonlyArray<ModuleGraphConnection>
10391
+ >;
10079
10392
  getOutgoingConnectionsByModule(
10080
10393
  module: Module
10081
- ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10394
+ ):
10395
+ | undefined
10396
+ | ReadonlyMap<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
10082
10397
  getProfile(module: Module): undefined | ModuleProfile;
10083
10398
  setProfile(module: Module, profile?: ModuleProfile): void;
10084
- getIssuer(module: Module): undefined | null | Module;
10399
+ getIssuer(module: Module): Issuer;
10085
10400
  setIssuer(module: Module, issuer: null | Module): void;
10086
10401
  setIssuerIfUnset(module: Module, issuer: null | Module): void;
10087
10402
  getOptimizationBailout(
@@ -10111,13 +10426,13 @@ declare class ModuleGraph {
10111
10426
  isAsync(module: Module): boolean;
10112
10427
  isDeferred(module: Module): boolean;
10113
10428
  setAsync(module: Module): void;
10114
- getMeta(thing: object): any;
10115
- getMetaIfExisting(thing: object): any;
10429
+ getMeta(thing: object): Meta;
10430
+ getMetaIfExisting(thing: object): undefined | Meta;
10116
10431
  freeze(cacheStage?: string): void;
10117
10432
  unfreeze(): void;
10118
- cached<T, R>(
10119
- fn: (moduleGraph: ModuleGraph, ...args: T[]) => R,
10120
- ...args: T[]
10433
+ cached<T extends any[], R>(
10434
+ fn: (moduleGraph: ModuleGraph, ...args: T) => R,
10435
+ ...args: T
10121
10436
  ): R;
10122
10437
  setModuleMemCaches(
10123
10438
  moduleMemCaches: Map<Module, WeakTupleMap<any[], any>>
@@ -10479,6 +10794,11 @@ declare interface ModuleSettings {
10479
10794
  */
10480
10795
  type?: string;
10481
10796
 
10797
+ /**
10798
+ * Enable/Disable extracting source map.
10799
+ */
10800
+ extractSourceMap?: boolean;
10801
+
10482
10802
  /**
10483
10803
  * Options for the resolver.
10484
10804
  */
@@ -10594,19 +10914,24 @@ declare class MultiCompiler {
10594
10914
  intermediateFileSystem: IntermediateFileSystem;
10595
10915
  getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
10596
10916
  setDependencies(compiler: Compiler, dependencies: string[]): void;
10597
- validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
10917
+ validateDependencies(
10918
+ callback: CallbackWebpackFunction_2<MultiStats, void>
10919
+ ): boolean;
10598
10920
  runWithDependencies(
10599
10921
  compilers: Compiler[],
10600
- fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
10601
- callback: CallbackFunction_1<Stats[]>
10922
+ fn: (
10923
+ compiler: Compiler,
10924
+ callback: CallbackWebpackFunction_2<MultiStats, void>
10925
+ ) => void,
10926
+ callback: CallbackWebpackFunction_2<Stats[], void>
10602
10927
  ): void;
10603
10928
  watch(
10604
10929
  watchOptions: WatchOptions | WatchOptions[],
10605
- handler: CallbackFunction_1<MultiStats>
10606
- ): MultiWatching;
10607
- run(callback: CallbackFunction_1<MultiStats>): void;
10930
+ handler: CallbackWebpackFunction_2<MultiStats, void>
10931
+ ): undefined | MultiWatching;
10932
+ run(callback: CallbackWebpackFunction_2<MultiStats, void>): void;
10608
10933
  purgeInputFileSystem(): void;
10609
- close(callback: CallbackFunction_1<void>): void;
10934
+ close(callback: (err: null | Error, result?: void) => void): void;
10610
10935
  }
10611
10936
  declare interface MultiCompilerOptions {
10612
10937
  /**
@@ -10614,7 +10939,8 @@ declare interface MultiCompilerOptions {
10614
10939
  */
10615
10940
  parallelism?: number;
10616
10941
  }
10617
- type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
10942
+ type MultiConfiguration = ReadonlyArray<WebpackOptionsNormalized> &
10943
+ MultiCompilerOptions;
10618
10944
  declare abstract class MultiStats {
10619
10945
  stats: Stats[];
10620
10946
  get hash(): string;
@@ -10629,10 +10955,10 @@ type MultiStatsOptions = Omit<StatsOptions, "children"> & {
10629
10955
  declare abstract class MultiWatching {
10630
10956
  watchings: Watching[];
10631
10957
  compiler: MultiCompiler;
10632
- invalidate(callback?: CallbackFunction_2<void>): void;
10958
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
10633
10959
  suspend(): void;
10634
10960
  resume(): void;
10635
- close(callback: CallbackFunction_2<void>): void;
10961
+ close(callback: (err: null | Error, result?: void) => void): void;
10636
10962
  }
10637
10963
  declare class NamedChunkIdsPlugin {
10638
10964
  constructor(options?: NamedChunkIdsPluginOptions);
@@ -10681,7 +11007,7 @@ declare class NaturalModuleIdsPlugin {
10681
11007
  declare interface NeedBuildContext {
10682
11008
  compilation: Compilation;
10683
11009
  fileSystemInfo: FileSystemInfo;
10684
- valueCacheVersions: Map<string, string | Set<string>>;
11010
+ valueCacheVersions: Map<string, ValueCacheVersion>;
10685
11011
  }
10686
11012
  declare interface NewContentCreateContextMap {
10687
11013
  [index: string]: string;
@@ -10765,6 +11091,7 @@ declare interface NodeTemplatePluginOptions {
10765
11091
  */
10766
11092
  asyncChunkLoading?: boolean;
10767
11093
  }
11094
+ type NonNullable<T> = T & {};
10768
11095
  declare class NormalModule extends Module {
10769
11096
  constructor(__0: NormalModuleCreateData);
10770
11097
  request: string;
@@ -10779,7 +11106,9 @@ declare class NormalModule extends Module {
10779
11106
  resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
10780
11107
  matchResource?: string;
10781
11108
  loaders: LoaderItem[];
11109
+ extractSourceMap?: boolean;
10782
11110
  error: null | WebpackError;
11111
+ getResource(): null | string;
10783
11112
 
10784
11113
  /**
10785
11114
  * restore unsafe cache data
@@ -10796,7 +11125,7 @@ declare class NormalModule extends Module {
10796
11125
  associatedObjectForCache?: object
10797
11126
  ): Source;
10798
11127
  getCurrentLoader(
10799
- loaderContext: LoaderContextObject<any>,
11128
+ loaderContext: AnyLoaderContext,
10800
11129
  index?: number
10801
11130
  ): null | LoaderItem;
10802
11131
  createSource(
@@ -10822,10 +11151,8 @@ declare class NormalModule extends Module {
10822
11151
  static deserialize(context: ObjectDeserializerContext): NormalModule;
10823
11152
  }
10824
11153
  declare interface NormalModuleCompilationHooks {
10825
- loader: SyncHook<[LoaderContextObject<any>, NormalModule]>;
10826
- beforeLoaders: SyncHook<
10827
- [LoaderItem[], NormalModule, LoaderContextObject<any>]
10828
- >;
11154
+ loader: SyncHook<[AnyLoaderContext, NormalModule]>;
11155
+ beforeLoaders: SyncHook<[LoaderItem[], NormalModule, AnyLoaderContext]>;
10829
11156
  beforeParse: SyncHook<[NormalModule]>;
10830
11157
  beforeSnapshot: SyncHook<[NormalModule]>;
10831
11158
  readResourceForScheme: HookMap<
@@ -10834,7 +11161,7 @@ declare interface NormalModuleCompilationHooks {
10834
11161
  >
10835
11162
  >;
10836
11163
  readResource: HookMap<
10837
- AsyncSeriesBailHook<[LoaderContextObject<any>], null | string | Buffer>
11164
+ AsyncSeriesBailHook<[AnyLoaderContext], null | string | Buffer>
10838
11165
  >;
10839
11166
  processResult: SyncWaterfallHook<
10840
11167
  [
@@ -10844,6 +11171,11 @@ declare interface NormalModuleCompilationHooks {
10844
11171
  undefined | PreparsedAst
10845
11172
  ],
10846
11173
  NormalModule
11174
+ ],
11175
+ [
11176
+ string | Buffer,
11177
+ undefined | string | RawSourceMap,
11178
+ undefined | PreparsedAst
10847
11179
  ]
10848
11180
  >;
10849
11181
  needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
@@ -10923,6 +11255,11 @@ declare interface NormalModuleCreateData {
10923
11255
  * options used for resolving requests from this module
10924
11256
  */
10925
11257
  resolveOptions?: ResolveOptions;
11258
+
11259
+ /**
11260
+ * enable/disable extracting source map
11261
+ */
11262
+ extractSourceMap?: boolean;
10926
11263
  }
10927
11264
  declare abstract class NormalModuleFactory extends ModuleFactory {
10928
11265
  hooks: Readonly<{
@@ -10948,7 +11285,8 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10948
11285
  Module,
10949
11286
  Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
10950
11287
  ResolveData
10951
- ]
11288
+ ],
11289
+ Module
10952
11290
  >;
10953
11291
  createParser: HookMap<SyncBailHook<[ParserOptions], void | ParserClass>>;
10954
11292
  parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
@@ -10991,7 +11329,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
10991
11329
  array: LoaderItem[],
10992
11330
  resolver: ResolverWithOptions,
10993
11331
  resolveContext: ResolveContext,
10994
- callback: CallbackNormalModuleFactory<LoaderItem[]>
11332
+ callback: CallbackWebpackFunction_1<LoaderItem[]>
10995
11333
  ): void;
10996
11334
  getParser(type: string, parserOptions?: ParserOptions): ParserClass;
10997
11335
  createParser(type: string, parserOptions?: ParserOptions): ParserClass;
@@ -11021,7 +11359,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11021
11359
  res?: string | false,
11022
11360
  req?: ResolveRequest
11023
11361
  ) => void
11024
- ): any;
11362
+ ): void;
11025
11363
  getResolve(options?: ResolveOptionsWithDependencyType): {
11026
11364
  (
11027
11365
  context: string,
@@ -11054,7 +11392,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
11054
11392
  hashFunction: HashFunction;
11055
11393
  hashDigest: string;
11056
11394
  hashDigestLength: number;
11057
- hashSalt: string;
11395
+ hashSalt?: string;
11058
11396
  _module?: NormalModule;
11059
11397
  _compilation?: Compilation;
11060
11398
  _compiler?: Compiler;
@@ -11151,9 +11489,6 @@ declare interface ObjectEncodingOptions {
11151
11489
  | "binary"
11152
11490
  | "hex";
11153
11491
  }
11154
- declare interface ObjectForExtract {
11155
- [index: string]: any;
11156
- }
11157
11492
  declare interface ObjectSerializer {
11158
11493
  serialize: (value: any, context: ObjectSerializerContext) => void;
11159
11494
  deserialize: (context: ObjectDeserializerContext) => any;
@@ -11443,11 +11778,6 @@ declare interface OptimizationNormalized {
11443
11778
  * Minimizer(s) to use for minimizing the output.
11444
11779
  */
11445
11780
  minimizer?: (
11446
- | undefined
11447
- | null
11448
- | false
11449
- | ""
11450
- | 0
11451
11781
  | ((this: Compiler, compiler: Compiler) => void)
11452
11782
  | WebpackPluginInstance
11453
11783
  | "..."
@@ -11520,6 +11850,60 @@ declare interface OptimizationNormalized {
11520
11850
  */
11521
11851
  usedExports?: boolean | "global";
11522
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
+ };
11523
11907
 
11524
11908
  /**
11525
11909
  * Options object for describing behavior of a cache group selecting modules that should be cached together.
@@ -11533,7 +11917,12 @@ declare interface OptimizationSplitChunksCacheGroup {
11533
11917
  /**
11534
11918
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
11535
11919
  */
11536
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
11920
+ chunks?:
11921
+ | RegExp
11922
+ | "all"
11923
+ | "initial"
11924
+ | "async"
11925
+ | ((chunk: Chunk) => undefined | boolean);
11537
11926
 
11538
11927
  /**
11539
11928
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -11671,7 +12060,12 @@ declare interface OptimizationSplitChunksOptions {
11671
12060
  /**
11672
12061
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11673
12062
  */
11674
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12063
+ chunks?:
12064
+ | RegExp
12065
+ | "all"
12066
+ | "initial"
12067
+ | "async"
12068
+ | ((chunk: Chunk) => undefined | boolean);
11675
12069
 
11676
12070
  /**
11677
12071
  * Sets the size types which are used when a number is used for sizes.
@@ -11694,7 +12088,12 @@ declare interface OptimizationSplitChunksOptions {
11694
12088
  /**
11695
12089
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
11696
12090
  */
11697
- chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
12091
+ chunks?:
12092
+ | RegExp
12093
+ | "all"
12094
+ | "initial"
12095
+ | "async"
12096
+ | ((chunk: Chunk) => undefined | boolean);
11698
12097
  /**
11699
12098
  * Maximal size hint for the on-demand chunks.
11700
12099
  */
@@ -11823,9 +12222,9 @@ declare interface Options {
11823
12222
  }
11824
12223
  declare abstract class OptionsApply {
11825
12224
  process(
11826
- options: WebpackOptionsNormalized,
12225
+ options: WebpackOptionsNormalizedWithDefaults,
11827
12226
  compiler: Compiler
11828
- ): WebpackOptionsNormalized;
12227
+ ): WebpackOptionsNormalizedWithDefaults;
11829
12228
  }
11830
12229
  declare interface OriginRecord {
11831
12230
  module: null | Module;
@@ -11945,12 +12344,16 @@ declare interface Output {
11945
12344
  /**
11946
12345
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
11947
12346
  */
11948
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
12347
+ devtoolFallbackModuleFilenameTemplate?:
12348
+ | string
12349
+ | ((context: ModuleFilenameTemplateContext) => string);
11949
12350
 
11950
12351
  /**
11951
12352
  * Filename template string of function for the sources array in a generated SourceMap.
11952
12353
  */
11953
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
12354
+ devtoolModuleFilenameTemplate?:
12355
+ | string
12356
+ | ((context: ModuleFilenameTemplateContext) => string);
11954
12357
 
11955
12358
  /**
11956
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.
@@ -12143,10 +12546,10 @@ declare interface Output {
12143
12546
  workerWasmLoading?: string | false;
12144
12547
  }
12145
12548
  declare interface OutputFileSystem {
12146
- writeFile: WriteFile;
12147
12549
  mkdir: Mkdir;
12148
12550
  readdir?: ReaddirFs;
12149
12551
  rmdir?: Rmdir;
12552
+ writeFile: WriteFile;
12150
12553
  unlink?: (
12151
12554
  pathLike: PathLikeFs,
12152
12555
  callback: (err: null | NodeJS.ErrnoException) => void
@@ -12154,6 +12557,23 @@ declare interface OutputFileSystem {
12154
12557
  stat: StatFs;
12155
12558
  lstat?: LStatFs;
12156
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;
12157
12577
  join?: (path1: string, path2: string) => string;
12158
12578
  relative?: (from: string, to: string) => string;
12159
12579
  dirname?: (dirname: string) => string;
@@ -12239,12 +12659,16 @@ declare interface OutputNormalized {
12239
12659
  /**
12240
12660
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
12241
12661
  */
12242
- devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
12662
+ devtoolFallbackModuleFilenameTemplate?:
12663
+ | string
12664
+ | ((context: ModuleFilenameTemplateContext) => string);
12243
12665
 
12244
12666
  /**
12245
12667
  * Filename template string of function for the sources array in a generated SourceMap.
12246
12668
  */
12247
- devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
12669
+ devtoolModuleFilenameTemplate?:
12670
+ | string
12671
+ | ((context: ModuleFilenameTemplateContext) => string);
12248
12672
 
12249
12673
  /**
12250
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.
@@ -12421,6 +12845,61 @@ declare interface OutputNormalized {
12421
12845
  */
12422
12846
  workerWasmLoading?: string | false;
12423
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
+ };
12424
12903
  declare interface ParameterizedComparator<TArg extends object, T> {
12425
12904
  (tArg: TArg): Comparator<T>;
12426
12905
  }
@@ -12482,6 +12961,11 @@ declare interface ParserOptionsByModuleTypeKnown {
12482
12961
  */
12483
12962
  asset?: AssetParserOptions;
12484
12963
 
12964
+ /**
12965
+ * No parser options are supported for this module type.
12966
+ */
12967
+ "asset/bytes"?: EmptyParserOptions;
12968
+
12485
12969
  /**
12486
12970
  * No parser options are supported for this module type.
12487
12971
  */
@@ -12555,7 +13039,7 @@ declare interface ParserStateBase {
12555
13039
  current: NormalModule;
12556
13040
  module: NormalModule;
12557
13041
  compilation: Compilation;
12558
- options: WebpackOptionsNormalized;
13042
+ options: WebpackOptionsNormalizedWithDefaults;
12559
13043
  }
12560
13044
  declare interface PathData {
12561
13045
  chunkGraph?: ChunkGraph;
@@ -12693,7 +13177,7 @@ declare class PrefetchPlugin {
12693
13177
  apply(compiler: Compiler): void;
12694
13178
  }
12695
13179
  declare class PrefixSource extends Source {
12696
- constructor(prefix: string, source: string | Source | Buffer);
13180
+ constructor(prefix: string, source: string | Buffer | Source);
12697
13181
  getPrefix(): string;
12698
13182
  original(): Source;
12699
13183
  streamChunks(
@@ -12737,7 +13221,7 @@ type ProblemType =
12737
13221
  | "multiple-values-unexpected"
12738
13222
  | "invalid-value";
12739
13223
  declare interface ProcessAssetsAdditionalOptions {
12740
- additionalAssets?: any;
13224
+ additionalAssets?: boolean | ((assets: CompilationAssets) => void);
12741
13225
  }
12742
13226
  declare class Profiler {
12743
13227
  constructor(inspector: Inspector);
@@ -12747,7 +13231,7 @@ declare class Profiler {
12747
13231
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
12748
13232
  sendCommand(method: string, params?: object): Promise<any>;
12749
13233
  destroy(): Promise<void>;
12750
- stopProfiling(): Promise<{ profile: any }>;
13234
+ stopProfiling(): Promise<{ profile: { startTime: number; endTime: number } }>;
12751
13235
  }
12752
13236
  declare class ProfilingPlugin {
12753
13237
  constructor(options?: ProfilingPluginOptions);
@@ -13227,6 +13711,10 @@ declare interface ReadFileTypes {
13227
13711
  callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
13228
13712
  ): void;
13229
13713
  }
13714
+ type ReadStreamOptions = StreamOptions & {
13715
+ fs?: null | CreateReadStreamFSImplementation;
13716
+ end?: number;
13717
+ };
13230
13718
  declare interface ReaddirFs {
13231
13719
  (
13232
13720
  path: PathLikeFs,
@@ -13638,6 +14126,7 @@ type RecursiveArrayOrRecord<T> =
13638
14126
  | { [index: string]: RecursiveArrayOrRecord<T> }
13639
14127
  | RecursiveArrayOrRecord<T>[]
13640
14128
  | T;
14129
+ declare interface RecursiveNonNullable<T> {}
13641
14130
  type ReferenceableItem = string | object;
13642
14131
  declare interface ReferencedExport {
13643
14132
  /**
@@ -13803,7 +14292,7 @@ declare interface RenderManifestOptions {
13803
14292
  chunk: Chunk;
13804
14293
  hash: string;
13805
14294
  fullHash: string;
13806
- outputOptions: Output;
14295
+ outputOptions: OutputNormalizedWithDefaults;
13807
14296
  codeGenerationResults: CodeGenerationResults;
13808
14297
  moduleTemplates: { javascript: ModuleTemplate };
13809
14298
  dependencyTemplates: DependencyTemplates;
@@ -13915,7 +14404,7 @@ declare interface ResolveData {
13915
14404
  resolveOptions?: ResolveOptions;
13916
14405
  context: string;
13917
14406
  request: string;
13918
- assertions?: ImportAttributes;
14407
+ attributes?: ImportAttributes;
13919
14408
  dependencies: ModuleDependency[];
13920
14409
  dependencyType: string;
13921
14410
  createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
@@ -14507,7 +14996,10 @@ declare interface ResolverCache {
14507
14996
  declare abstract class ResolverFactory {
14508
14997
  hooks: Readonly<{
14509
14998
  resolveOptions: HookMap<
14510
- SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
14999
+ SyncWaterfallHook<
15000
+ [ResolveOptionsWithDependencyType],
15001
+ ResolveOptionsWithDependencyType
15002
+ >
14511
15003
  >;
14512
15004
  resolver: HookMap<
14513
15005
  SyncHook<
@@ -14586,7 +15078,7 @@ declare interface Rmdir {
14586
15078
  callback: (err: null | NodeJS.ErrnoException) => void
14587
15079
  ): void;
14588
15080
  }
14589
- type Rule = string | RegExp;
15081
+ type Rule = string | RegExp | ((str: string) => boolean);
14590
15082
  declare interface RuleSet {
14591
15083
  /**
14592
15084
  * map of references in the rule set (may grow over time)
@@ -14717,6 +15209,11 @@ declare interface RuleSetRule {
14717
15209
  | RuleSetLogicalConditionsAbsolute
14718
15210
  | RuleSetConditionAbsolute[];
14719
15211
 
15212
+ /**
15213
+ * Enable/Disable extracting source map.
15214
+ */
15215
+ extractSourceMap?: boolean;
15216
+
14720
15217
  /**
14721
15218
  * The options for the module generator.
14722
15219
  */
@@ -15010,9 +15507,6 @@ type RuleSetUseItem =
15010
15507
  */
15011
15508
  options?: string | { [index: string]: any };
15012
15509
  };
15013
- declare interface RunCallback<T> {
15014
- (err: null | Error, result?: T): any;
15015
- }
15016
15510
  declare class RuntimeChunkPlugin {
15017
15511
  constructor(options?: {
15018
15512
  /**
@@ -15028,6 +15522,7 @@ declare class RuntimeChunkPlugin {
15028
15522
  apply(compiler: Compiler): void;
15029
15523
  }
15030
15524
  type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
15525
+ type RuntimeId = string | number;
15031
15526
  declare class RuntimeModule extends Module {
15032
15527
  constructor(name: string, stage?: number);
15033
15528
  name: string;
@@ -15095,25 +15590,26 @@ declare class RuntimeSpecSet {
15095
15590
  }
15096
15591
  declare abstract class RuntimeTemplate {
15097
15592
  compilation: Compilation;
15098
- outputOptions: OutputNormalized;
15593
+ outputOptions: OutputNormalizedWithDefaults;
15099
15594
  requestShortener: RequestShortener;
15100
15595
  globalObject: string;
15101
15596
  contentHashReplacement: string;
15102
- isIIFE(): undefined | boolean;
15103
- isModule(): undefined | boolean;
15597
+ isIIFE(): boolean;
15598
+ isModule(): boolean;
15104
15599
  isNeutralPlatform(): boolean;
15105
- supportsConst(): undefined | boolean;
15106
- supportsArrowFunction(): undefined | boolean;
15107
- supportsAsyncFunction(): undefined | boolean;
15108
- supportsOptionalChaining(): undefined | boolean;
15109
- supportsForOf(): undefined | boolean;
15110
- supportsDestructuring(): undefined | boolean;
15111
- supportsBigIntLiteral(): undefined | boolean;
15112
- supportsDynamicImport(): undefined | boolean;
15113
- supportsEcmaScriptModuleSyntax(): undefined | boolean;
15114
- supportTemplateLiteral(): undefined | boolean;
15115
- 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;
15116
15611
  renderNodePrefixForCoreModule(mod: string): string;
15612
+ renderConst(): "var" | "const";
15117
15613
  returningFunction(returnValue: string, args?: string): string;
15118
15614
  basicFunction(args: string, body: string | string[]): string;
15119
15615
  concatenation(...args: (string | { expr: string })[]): string;
@@ -15520,7 +16016,7 @@ declare abstract class RuntimeValue {
15520
16016
  get fileDependencies(): true | string[];
15521
16017
  exec(
15522
16018
  parser: JavascriptParser,
15523
- valueCacheVersions: Map<string, string | Set<string>>,
16019
+ valueCacheVersions: Map<string, ValueCacheVersion>,
15524
16020
  key: string
15525
16021
  ): CodeValuePrimitive;
15526
16022
  getCacheVersion(): undefined | string;
@@ -15578,6 +16074,9 @@ declare abstract class SerializerMiddleware<
15578
16074
  context: Context
15579
16075
  ): DeserializedType | Promise<DeserializedType>;
15580
16076
  }
16077
+ type ServerLazyCompilationBackend =
16078
+ | ServerImportHttp<typeof IncomingMessage>
16079
+ | ServerImportHttps<typeof IncomingMessage>;
15581
16080
  declare interface SetIterator<T> extends IteratorObject<T, undefined> {
15582
16081
  [Symbol.iterator](): SetIterator<T>;
15583
16082
  [Symbol.dispose](): void;
@@ -15672,10 +16171,11 @@ declare class SideEffectsFlagPlugin {
15672
16171
  apply(compiler: Compiler): void;
15673
16172
  static moduleHasSideEffects(
15674
16173
  moduleName: string,
15675
- flagValue: undefined | string | boolean | string[],
16174
+ flagValue: SideEffectsFlagValue,
15676
16175
  cache: Map<string, RegExp>
15677
16176
  ): undefined | boolean;
15678
16177
  }
16178
+ type SideEffectsFlagValue = undefined | string | boolean | string[];
15679
16179
  type SimpleType = "string" | "number" | "boolean";
15680
16180
  declare class SizeOnlySource extends Source {
15681
16181
  constructor(size: number);
@@ -15732,6 +16232,51 @@ declare abstract class Snapshot {
15732
16232
  getContextIterable(): Iterable<string>;
15733
16233
  getMissingIterable(): Iterable<string>;
15734
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
+ };
15735
16280
  declare interface SnapshotOptionsFileSystemInfo {
15736
16281
  /**
15737
16282
  * should use hash to snapshot
@@ -15762,6 +16307,20 @@ declare interface SnapshotOptionsWebpackOptions {
15762
16307
  timestamp?: boolean;
15763
16308
  };
15764
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
+
15765
16324
  /**
15766
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.
15767
16326
  */
@@ -15898,8 +16457,12 @@ declare class SourceMapDevToolPlugin {
15898
16457
  | string
15899
16458
  | false
15900
16459
  | ((pathData: PathData, assetInfo?: AssetInfo) => string);
15901
- moduleFilenameTemplate: string | ((context?: any) => string);
15902
- fallbackModuleFilenameTemplate: string | ((context?: any) => string);
16460
+ moduleFilenameTemplate:
16461
+ | string
16462
+ | ((context: ModuleFilenameTemplateContext) => string);
16463
+ fallbackModuleFilenameTemplate:
16464
+ | string
16465
+ | ((context: ModuleFilenameTemplateContext) => string);
15903
16466
  namespace: string;
15904
16467
  options: SourceMapDevToolPluginOptions;
15905
16468
 
@@ -15931,12 +16494,14 @@ declare interface SourceMapDevToolPluginOptions {
15931
16494
  /**
15932
16495
  * Exclude modules that match the given value from source map generation.
15933
16496
  */
15934
- exclude?: string | RegExp | Rule[];
16497
+ exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
15935
16498
 
15936
16499
  /**
15937
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.
15938
16501
  */
15939
- fallbackModuleFilenameTemplate?: string | ((context?: any) => string);
16502
+ fallbackModuleFilenameTemplate?:
16503
+ | string
16504
+ | ((context: ModuleFilenameTemplateContext) => string);
15940
16505
 
15941
16506
  /**
15942
16507
  * Path prefix to which the [file] placeholder is relative to.
@@ -15951,7 +16516,7 @@ declare interface SourceMapDevToolPluginOptions {
15951
16516
  /**
15952
16517
  * Include source maps for module paths that match the given value.
15953
16518
  */
15954
- include?: string | RegExp | Rule[];
16519
+ include?: string | RegExp | Rule[] | ((str: string) => boolean);
15955
16520
 
15956
16521
  /**
15957
16522
  * Indicates whether SourceMaps from loaders should be used (defaults to true).
@@ -15961,7 +16526,9 @@ declare interface SourceMapDevToolPluginOptions {
15961
16526
  /**
15962
16527
  * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
15963
16528
  */
15964
- moduleFilenameTemplate?: string | ((context?: any) => string);
16529
+ moduleFilenameTemplate?:
16530
+ | string
16531
+ | ((context: ModuleFilenameTemplateContext) => string);
15965
16532
 
15966
16533
  /**
15967
16534
  * Namespace prefix to allow multiple webpack roots in the devtools.
@@ -15986,7 +16553,7 @@ declare interface SourceMapDevToolPluginOptions {
15986
16553
  /**
15987
16554
  * Include source maps for modules based on their extension (defaults to .js and .css).
15988
16555
  */
15989
- test?: string | RegExp | Rule[];
16556
+ test?: string | RegExp | Rule[] | ((str: string) => boolean);
15990
16557
  }
15991
16558
  declare class SourceMapSource extends Source {
15992
16559
  constructor(
@@ -16230,9 +16797,9 @@ type Statement =
16230
16797
  | ForInStatement
16231
16798
  | ForOfStatement;
16232
16799
  type StatementPathItem =
16233
- | ImportDeclarationJavascriptParser
16234
- | ExportNamedDeclarationJavascriptParser
16235
- | ExportAllDeclarationJavascriptParser
16800
+ | ImportDeclaration
16801
+ | ExportNamedDeclaration
16802
+ | ExportAllDeclaration
16236
16803
  | ImportExpressionImport
16237
16804
  | UnaryExpression
16238
16805
  | ArrayExpression
@@ -16312,9 +16879,7 @@ declare abstract class StatsFactory {
16312
16879
  }
16313
16880
  type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
16314
16881
  declare interface StatsFactoryHooks {
16315
- extract: HookMap<
16316
- SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], void>
16317
- >;
16882
+ extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
16318
16883
  filter: HookMap<
16319
16884
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16320
16885
  >;
@@ -16328,7 +16893,7 @@ declare interface StatsFactoryHooks {
16328
16893
  SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
16329
16894
  >;
16330
16895
  groupResults: HookMap<
16331
- SyncBailHook<[GroupConfig[], StatsFactoryContext], void>
16896
+ SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
16332
16897
  >;
16333
16898
  sortResults: HookMap<
16334
16899
  SyncBailHook<
@@ -16402,7 +16967,18 @@ declare interface StatsOptions {
16402
16967
  /**
16403
16968
  * Add children information.
16404
16969
  */
16405
- 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[];
16406
16982
 
16407
16983
  /**
16408
16984
  * Display auxiliary assets in chunk groups.
@@ -16656,7 +17232,7 @@ declare interface StatsOptions {
16656
17232
  /**
16657
17233
  * Add logging output.
16658
17234
  */
16659
- logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
17235
+ logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
16660
17236
 
16661
17237
  /**
16662
17238
  * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
@@ -16805,7 +17381,7 @@ declare interface StatsOptions {
16805
17381
  | string
16806
17382
  | RegExp
16807
17383
  | WarningFilterItemTypes[]
16808
- | ((warning: StatsError, value: string) => boolean);
17384
+ | ((warning: StatsError, warningString: string) => boolean);
16809
17385
 
16810
17386
  /**
16811
17387
  * Space to display warnings (value is in number of lines).
@@ -16830,7 +17406,7 @@ declare interface StatsPrintHooks {
16830
17406
  print: HookMap<
16831
17407
  SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
16832
17408
  >;
16833
- result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
17409
+ result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
16834
17410
  }
16835
17411
  declare abstract class StatsPrinter {
16836
17412
  hooks: StatsPrintHooks;
@@ -16849,18 +17425,40 @@ type StatsValue =
16849
17425
  | boolean
16850
17426
  | StatsOptions
16851
17427
  | "none"
16852
- | "verbose"
16853
17428
  | "summary"
16854
17429
  | "errors-only"
16855
17430
  | "errors-warnings"
16856
17431
  | "minimal"
16857
17432
  | "normal"
16858
- | "detailed";
17433
+ | "detailed"
17434
+ | "verbose";
16859
17435
  declare interface StreamChunksOptions {
16860
17436
  source?: boolean;
16861
17437
  finalSource?: boolean;
16862
17438
  columns?: boolean;
16863
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
+ }
16864
17462
  type Supports = undefined | string;
16865
17463
  declare class SyncModuleIdsPlugin {
16866
17464
  constructor(__0: SyncModuleIdsPluginOptions);
@@ -16898,12 +17496,15 @@ declare interface SyntheticDependencyLocation {
16898
17496
  declare const TOMBSTONE: unique symbol;
16899
17497
  declare const TRANSITIVE: unique symbol;
16900
17498
  declare const TRANSITIVE_ONLY: unique symbol;
16901
- declare interface TagData {
16902
- [index: string]: any;
16903
- }
16904
17499
  declare interface TagInfo {
16905
17500
  tag: symbol;
16906
- data?: TagData;
17501
+ data?:
17502
+ | Record<string, any>
17503
+ | TopLevelSymbol
17504
+ | HarmonySettings
17505
+ | ImportSettings
17506
+ | CommonJsImportSettings
17507
+ | CompatibilitySettings;
16907
17508
  next?: TagInfo;
16908
17509
  }
16909
17510
  declare interface TargetItemWithConnection {
@@ -16992,6 +17593,7 @@ declare interface UpdateHashContextGenerator {
16992
17593
  runtime: RuntimeSpec;
16993
17594
  runtimeTemplate?: RuntimeTemplate;
16994
17595
  }
17596
+ type Usage = string | true | TopLevelSymbol;
16995
17597
  type UsageStateType = 0 | 1 | 2 | 3 | 4;
16996
17598
  type UsedName = string | false | string[];
16997
17599
  type Value = string | number | boolean | RegExp;
@@ -17016,23 +17618,27 @@ declare class VariableInfo {
17016
17618
  type VariableInfoFlagsType = 0 | 1 | 2 | 4;
17017
17619
  declare interface VirtualModuleConfig {
17018
17620
  /**
17019
- * - The module type
17621
+ * the module type
17020
17622
  */
17021
17623
  type?: string;
17022
17624
 
17023
17625
  /**
17024
- * - The source function
17626
+ * the source function
17025
17627
  */
17026
- source: (loaderContext: LoaderContextObject<any>) => string | Promise<string>;
17628
+ source: (
17629
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
17630
+ ) => string | Buffer | Promise<string | Buffer>;
17027
17631
 
17028
17632
  /**
17029
- * - Optional version function or value
17633
+ * optional version function or value
17030
17634
  */
17031
17635
  version?: string | true | (() => string);
17032
17636
  }
17033
17637
  type VirtualModuleInput =
17034
17638
  | string
17035
- | ((loaderContext: LoaderContextObject<any>) => string | Promise<string>)
17639
+ | ((
17640
+ loaderContext: LoaderContextVirtualUrlPlugin<any>
17641
+ ) => string | Buffer | Promise<string | Buffer>)
17036
17642
  | VirtualModuleConfig;
17037
17643
  declare interface VirtualModules {
17038
17644
  [index: string]: VirtualModuleInput;
@@ -17057,7 +17663,7 @@ declare class VirtualUrlPlugin {
17057
17663
  type WarningFilterItemTypes =
17058
17664
  | string
17059
17665
  | RegExp
17060
- | ((warning: StatsError, value: string) => boolean);
17666
+ | ((warning: StatsError, warningString: string) => boolean);
17061
17667
  declare interface WatchFileSystem {
17062
17668
  watch: (
17063
17669
  files: Iterable<string>,
@@ -17180,8 +17786,8 @@ declare interface WatcherInfo {
17180
17786
  declare abstract class Watching {
17181
17787
  startTime: null | number;
17182
17788
  invalid: boolean;
17183
- handler: CallbackFunction_1<Stats>;
17184
- callbacks: CallbackFunction_1<void>[];
17789
+ handler: CallbackWebpackFunction_2<Stats, void>;
17790
+ callbacks: ((err: null | Error, result?: void) => void)[];
17185
17791
  closed: boolean;
17186
17792
  suspended: boolean;
17187
17793
  blocked: boolean;
@@ -17196,10 +17802,10 @@ declare abstract class Watching {
17196
17802
  dirs: Iterable<string>,
17197
17803
  missing: Iterable<string>
17198
17804
  ): void;
17199
- invalidate(callback?: CallbackFunction_1<void>): void;
17805
+ invalidate(callback?: (err: null | Error, result?: void) => void): void;
17200
17806
  suspend(): void;
17201
17807
  resume(): void;
17202
- close(callback: CallbackFunction_1<void>): void;
17808
+ close(callback: (err: null | Error, result?: void) => void): void;
17203
17809
  }
17204
17810
  declare abstract class WeakTupleMap<K extends any[], V> {
17205
17811
  set(...args: [K, ...V[]]): void;
@@ -17492,11 +18098,6 @@ declare interface WebpackOptionsNormalized {
17492
18098
  * Add additional plugins to the compiler.
17493
18099
  */
17494
18100
  plugins: (
17495
- | undefined
17496
- | null
17497
- | false
17498
- | ""
17499
- | 0
17500
18101
  | ((this: Compiler, compiler: Compiler) => void)
17501
18102
  | WebpackPluginInstance
17502
18103
  )[];
@@ -17551,6 +18152,49 @@ declare interface WebpackOptionsNormalized {
17551
18152
  */
17552
18153
  watchOptions: WatchOptions;
17553
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
+ };
17554
18198
 
17555
18199
  /**
17556
18200
  * Plugin instance.
@@ -17612,47 +18256,31 @@ type WriteFileOptions =
17612
18256
  declare interface WriteOnlySet<T> {
17613
18257
  add: (item: T) => void;
17614
18258
  }
17615
-
17616
- declare interface WriteStreamOptions {
17617
- flags?: string;
17618
- encoding?:
17619
- | "ascii"
17620
- | "utf8"
17621
- | "utf-8"
17622
- | "utf16le"
17623
- | "utf-16le"
17624
- | "ucs2"
17625
- | "ucs-2"
17626
- | "base64"
17627
- | "base64url"
17628
- | "latin1"
17629
- | "binary"
17630
- | "hex";
17631
- fd?: any;
17632
- mode?: number;
17633
- autoClose?: boolean;
17634
- emitClose?: boolean;
17635
- start?: number;
17636
- signal?: null | AbortSignal;
18259
+ type WriteStreamOptions = StreamOptions & {
17637
18260
  fs?: null | CreateWriteStreamFSImplementation;
18261
+ flush?: boolean;
18262
+ };
18263
+ declare interface chunkModuleHashMap {
18264
+ [index: number]: string;
18265
+ [index: string]: string;
17638
18266
  }
17639
18267
  declare function exports(
17640
18268
  options: Configuration,
17641
- callback?: CallbackWebpack<Stats>
18269
+ callback?: CallbackWebpackFunction_2<Stats, void>
17642
18270
  ): null | Compiler;
17643
18271
  declare function exports(
17644
18272
  options: MultiConfiguration,
17645
- callback?: CallbackWebpack<MultiStats>
18273
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17646
18274
  ): null | MultiCompiler;
17647
18275
  declare namespace exports {
17648
18276
  export const webpack: {
17649
18277
  (
17650
18278
  options: Configuration,
17651
- callback?: CallbackWebpack<Stats>
18279
+ callback?: CallbackWebpackFunction_2<Stats, void>
17652
18280
  ): null | Compiler;
17653
18281
  (
17654
18282
  options: MultiConfiguration,
17655
- callback?: CallbackWebpack<MultiStats>
18283
+ callback?: CallbackWebpackFunction_2<MultiStats, void>
17656
18284
  ): null | MultiCompiler;
17657
18285
  };
17658
18286
  export const validate: (
@@ -17736,7 +18364,9 @@ declare namespace exports {
17736
18364
  module: string | Module,
17737
18365
  options: {
17738
18366
  namespace?: string;
17739
- moduleFilenameTemplate?: string | ((context?: any) => string);
18367
+ moduleFilenameTemplate?:
18368
+ | string
18369
+ | ((context: ModuleFilenameTemplateContext) => string);
17740
18370
  },
17741
18371
  __2: {
17742
18372
  requestShortener: RequestShortener;
@@ -17838,6 +18468,7 @@ declare namespace exports {
17838
18468
  export let system: "__webpack_require__.System";
17839
18469
  export let systemContext: "__webpack_require__.y";
17840
18470
  export let thisAsExports: "top-level-this-exports";
18471
+ export let toBinary: "__webpack_require__.tb";
17841
18472
  export let uncaughtErrorHandler: "__webpack_require__.oe";
17842
18473
  export let wasmInstances: "__webpack_require__.w";
17843
18474
  }
@@ -17893,12 +18524,12 @@ declare namespace exports {
17893
18524
  export let addUsage: (
17894
18525
  state: ParserState,
17895
18526
  symbol: null | TopLevelSymbol,
17896
- usage: string | true | TopLevelSymbol
18527
+ usage: Usage
17897
18528
  ) => void;
17898
18529
  export let addVariableUsage: (
17899
18530
  parser: JavascriptParser,
17900
18531
  name: string,
17901
- usage: string | true | TopLevelSymbol
18532
+ usage: Usage
17902
18533
  ) => void;
17903
18534
  export let bailout: (parserState: ParserState) => void;
17904
18535
  export let enable: (parserState: ParserState) => void;
@@ -17919,7 +18550,7 @@ declare namespace exports {
17919
18550
  export let inferDependencyUsage: (state: ParserState) => void;
17920
18551
  export let isDependencyUsedByExports: (
17921
18552
  dependency: Dependency,
17922
- usedByExports: boolean | Set<string>,
18553
+ usedByExports: undefined | boolean | Set<string>,
17923
18554
  moduleGraph: ModuleGraph,
17924
18555
  runtime: RuntimeSpec
17925
18556
  ) => boolean;
@@ -18187,42 +18818,6 @@ declare namespace exports {
18187
18818
  export { SyncModuleIdsPlugin };
18188
18819
  }
18189
18820
  }
18190
- export type ExternalItemFunctionCallback = (
18191
- data: ExternalItemFunctionData,
18192
- callback: (
18193
- err?: null | Error,
18194
- result?: string | boolean | string[] | { [index: string]: any }
18195
- ) => void
18196
- ) => void;
18197
- export type ExternalItemFunctionDataGetResolve = (
18198
- options?: ResolveOptions
18199
- ) =>
18200
- | ((
18201
- context: string,
18202
- request: string,
18203
- callback: (
18204
- err?: null | Error,
18205
- result?: string | false,
18206
- resolveRequest?: ResolveRequest
18207
- ) => void
18208
- ) => void)
18209
- | ((context: string, request: string) => Promise<string>);
18210
- export type ExternalItemFunctionDataGetResolveCallbackResult = (
18211
- context: string,
18212
- request: string,
18213
- callback: (
18214
- err?: null | Error,
18215
- result?: string | false,
18216
- resolveRequest?: ResolveRequest
18217
- ) => void
18218
- ) => void;
18219
- export type ExternalItemFunctionDataGetResolveResult = (
18220
- context: string,
18221
- request: string
18222
- ) => Promise<string>;
18223
- export type ExternalItemFunctionPromise = (
18224
- data: ExternalItemFunctionData
18225
- ) => Promise<ExternalItemValue>;
18226
18821
  export type RuleSetUseFunction = (data: EffectData) =>
18227
18822
  | string
18228
18823
  | RuleSetUseFunction
@@ -18266,6 +18861,42 @@ declare namespace exports {
18266
18861
  this: Compiler,
18267
18862
  compiler: Compiler
18268
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>;
18269
18900
  export {
18270
18901
  AutomaticPrefetchPlugin,
18271
18902
  AsyncDependenciesBlock,
@@ -18331,7 +18962,6 @@ declare namespace exports {
18331
18962
  EntryObject,
18332
18963
  ExternalItem,
18333
18964
  ExternalItemFunction,
18334
- ExternalItemFunctionData,
18335
18965
  ExternalItemObjectKnown,
18336
18966
  ExternalItemObjectUnknown,
18337
18967
  ExternalItemValue,
@@ -18353,12 +18983,14 @@ declare namespace exports {
18353
18983
  WebpackOptionsNormalized,
18354
18984
  WebpackPluginInstance,
18355
18985
  ChunkGroup,
18986
+ AssetEmittedInfo,
18356
18987
  Asset,
18357
18988
  AssetInfo,
18358
18989
  EntryOptions,
18359
18990
  PathData,
18360
- AssetEmittedInfo,
18991
+ CodeGenerationResults,
18361
18992
  Entrypoint,
18993
+ ExternalItemFunctionData,
18362
18994
  MultiCompilerOptions,
18363
18995
  MultiConfiguration,
18364
18996
  MultiStats,
@@ -18402,6 +19034,9 @@ declare namespace exports {
18402
19034
  LoaderContextDeclarationsIndex as LoaderContext
18403
19035
  };
18404
19036
  }
19037
+ declare const idsSymbolCommonJsExportRequireDependency: unique symbol;
19038
+ declare const idsSymbolHarmonyExportImportedSpecifierDependency: unique symbol;
19039
+ declare const idsSymbolHarmonyImportSpecifierDependency: unique symbol;
18405
19040
  declare const topLevelSymbolTag: unique symbol;
18406
19041
 
18407
19042
  export = exports;