webpack 5.85.0 → 5.88.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (249) hide show
  1. package/README.md +5 -2
  2. package/lib/APIPlugin.js +150 -99
  3. package/lib/AsyncDependenciesBlock.js +3 -3
  4. package/lib/BannerPlugin.js +2 -1
  5. package/lib/CaseSensitiveModulesWarning.js +3 -1
  6. package/lib/Chunk.js +35 -17
  7. package/lib/ChunkGraph.js +4 -4
  8. package/lib/ChunkGroup.js +20 -9
  9. package/lib/CompatibilityPlugin.js +50 -30
  10. package/lib/Compilation.js +2 -1
  11. package/lib/Compiler.js +10 -9
  12. package/lib/ConcatenationScope.js +2 -2
  13. package/lib/ConditionalInitFragment.js +11 -1
  14. package/lib/ConstPlugin.js +73 -32
  15. package/lib/ContextModule.js +8 -3
  16. package/lib/ContextModuleFactory.js +1 -0
  17. package/lib/ContextReplacementPlugin.js +13 -0
  18. package/lib/DelegatedModule.js +15 -3
  19. package/lib/DelegatedModuleFactoryPlugin.js +6 -0
  20. package/lib/DependenciesBlock.js +1 -1
  21. package/lib/Dependency.js +11 -5
  22. package/lib/DependencyTemplates.js +1 -1
  23. package/lib/DllEntryPlugin.js +11 -1
  24. package/lib/DllModule.js +6 -0
  25. package/lib/DllReferencePlugin.js +13 -1
  26. package/lib/Entrypoint.js +1 -1
  27. package/lib/ErrorHelpers.js +1 -0
  28. package/lib/EvalSourceMapDevToolPlugin.js +6 -1
  29. package/lib/ExportsInfo.js +22 -4
  30. package/lib/ExportsInfoApiPlugin.js +14 -5
  31. package/lib/ExternalModule.js +20 -8
  32. package/lib/FileSystemInfo.js +52 -24
  33. package/lib/FlagAllModulesAsUsedPlugin.js +6 -1
  34. package/lib/FlagDependencyUsagePlugin.js +3 -1
  35. package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
  36. package/lib/Generator.js +7 -0
  37. package/lib/HotModuleReplacementPlugin.js +8 -0
  38. package/lib/InitFragment.js +28 -5
  39. package/lib/JavascriptMetaInfoPlugin.js +11 -6
  40. package/lib/LibManifestPlugin.js +20 -4
  41. package/lib/Module.js +14 -3
  42. package/lib/ModuleDependencyError.js +4 -2
  43. package/lib/ModuleDependencyWarning.js +4 -2
  44. package/lib/ModuleGraph.js +31 -24
  45. package/lib/ModuleGraphConnection.js +19 -6
  46. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  47. package/lib/ModuleNotFoundError.js +5 -2
  48. package/lib/ModuleProfile.js +1 -0
  49. package/lib/ModuleRestoreError.js +2 -0
  50. package/lib/ModuleStoreError.js +2 -1
  51. package/lib/ModuleTypeConstants.js +7 -0
  52. package/lib/MultiWatching.js +4 -0
  53. package/lib/NodeStuffPlugin.js +32 -6
  54. package/lib/ProgressPlugin.js +71 -15
  55. package/lib/ProvidePlugin.js +13 -4
  56. package/lib/RawModule.js +3 -1
  57. package/lib/RequireJsStuffPlugin.js +7 -0
  58. package/lib/RuntimeGlobals.js +5 -0
  59. package/lib/RuntimeModule.js +3 -3
  60. package/lib/RuntimePlugin.js +6 -3
  61. package/lib/RuntimeTemplate.js +22 -4
  62. package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
  63. package/lib/SourceMapDevToolPlugin.js +7 -2
  64. package/lib/UseStrictPlugin.js +10 -3
  65. package/lib/Watching.js +62 -25
  66. package/lib/WebpackError.js +6 -5
  67. package/lib/WebpackIsIncludedPlugin.js +6 -4
  68. package/lib/WebpackOptionsApply.js +4 -2
  69. package/lib/WebpackOptionsDefaulter.js +10 -3
  70. package/lib/asset/AssetGenerator.js +2 -1
  71. package/lib/asset/AssetParser.js +11 -6
  72. package/lib/asset/AssetSourceParser.js +8 -3
  73. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
  74. package/lib/buildChunkGraph.js +37 -21
  75. package/lib/cache/IdleFileCachePlugin.js +2 -1
  76. package/lib/cache/PackFileCacheStrategy.js +53 -22
  77. package/lib/config/browserslistTargetHandler.js +7 -7
  78. package/lib/config/defaults.js +43 -26
  79. package/lib/container/RemoteRuntimeModule.js +1 -1
  80. package/lib/css/CssExportsGenerator.js +9 -0
  81. package/lib/css/CssGenerator.js +1 -1
  82. package/lib/css/CssLoadingRuntimeModule.js +43 -19
  83. package/lib/css/CssModulesPlugin.js +42 -14
  84. package/lib/css/CssParser.js +22 -0
  85. package/lib/dependencies/AMDDefineDependency.js +34 -4
  86. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -0
  87. package/lib/dependencies/AMDRuntimeModules.js +2 -2
  88. package/lib/dependencies/CommonJsExportsParserPlugin.js +14 -4
  89. package/lib/dependencies/CommonJsImportsParserPlugin.js +169 -59
  90. package/lib/dependencies/CommonJsPlugin.js +13 -8
  91. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
  92. package/lib/dependencies/ConstDependency.js +2 -2
  93. package/lib/dependencies/ContextDependency.js +7 -2
  94. package/lib/dependencies/CssImportDependency.js +1 -1
  95. package/lib/dependencies/CssLocalIdentifierDependency.js +5 -0
  96. package/lib/dependencies/CssUrlDependency.js +3 -3
  97. package/lib/dependencies/DllEntryDependency.js +5 -0
  98. package/lib/dependencies/DynamicExports.js +10 -6
  99. package/lib/dependencies/ExportsInfoDependency.js +14 -4
  100. package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
  101. package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -1
  102. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +12 -5
  103. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
  104. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +4 -4
  105. package/lib/dependencies/HarmonyExports.js +9 -5
  106. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +40 -27
  107. package/lib/dependencies/HarmonyImportSideEffectDependency.js +1 -2
  108. package/lib/dependencies/HarmonyImportSpecifierDependency.js +31 -21
  109. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
  110. package/lib/dependencies/ImportDependency.js +5 -3
  111. package/lib/dependencies/ImportEagerDependency.js +5 -3
  112. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
  113. package/lib/dependencies/ImportMetaPlugin.js +31 -15
  114. package/lib/dependencies/ImportParserPlugin.js +62 -25
  115. package/lib/dependencies/ImportWeakDependency.js +5 -3
  116. package/lib/dependencies/JsonExportsDependency.js +1 -1
  117. package/lib/dependencies/ModuleDependency.js +1 -1
  118. package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
  119. package/lib/dependencies/ProvidedDependency.js +4 -1
  120. package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
  121. package/lib/dependencies/RequireEnsureDependenciesBlock.js +5 -2
  122. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
  123. package/lib/dependencies/RequireHeaderDependency.js +4 -0
  124. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +26 -5
  125. package/lib/dependencies/RequireResolveHeaderDependency.js +9 -0
  126. package/lib/dependencies/SystemPlugin.js +17 -5
  127. package/lib/dependencies/SystemRuntimeModule.js +1 -1
  128. package/lib/dependencies/URLDependency.js +2 -2
  129. package/lib/dependencies/URLPlugin.js +9 -4
  130. package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
  131. package/lib/dependencies/WorkerPlugin.js +59 -22
  132. package/lib/esm/ExportWebpackRequireRuntimeModule.js +1 -1
  133. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
  134. package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
  135. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  136. package/lib/ids/SyncModuleIdsPlugin.js +1 -0
  137. package/lib/javascript/BasicEvaluatedExpression.js +28 -19
  138. package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
  139. package/lib/javascript/JavascriptModulesPlugin.js +25 -5
  140. package/lib/javascript/JavascriptParser.js +157 -85
  141. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  142. package/lib/json/JsonData.js +2 -2
  143. package/lib/json/JsonParser.js +25 -12
  144. package/lib/library/AmdLibraryPlugin.js +2 -2
  145. package/lib/library/AssignLibraryPlugin.js +13 -1
  146. package/lib/library/EnableLibraryPlugin.js +4 -0
  147. package/lib/library/SystemLibraryPlugin.js +1 -1
  148. package/lib/library/UmdLibraryPlugin.js +20 -2
  149. package/lib/logging/runtime.js +1 -1
  150. package/lib/logging/truncateArgs.js +4 -0
  151. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +10 -6
  152. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -1
  153. package/lib/node/RequireChunkLoadingRuntimeModule.js +10 -6
  154. package/lib/optimize/AggressiveMergingPlugin.js +8 -0
  155. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  156. package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
  157. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
  158. package/lib/optimize/InnerGraph.js +5 -5
  159. package/lib/optimize/InnerGraphPlugin.js +2 -1
  160. package/lib/optimize/LimitChunkCountPlugin.js +29 -4
  161. package/lib/optimize/MangleExportsPlugin.js +1 -1
  162. package/lib/optimize/MinMaxSizeWarning.js +5 -0
  163. package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
  164. package/lib/optimize/RealContentHashPlugin.js +80 -30
  165. package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
  166. package/lib/optimize/RuntimeChunkPlugin.js +9 -1
  167. package/lib/optimize/SideEffectsFlagPlugin.js +10 -1
  168. package/lib/optimize/SplitChunksPlugin.js +71 -31
  169. package/lib/performance/SizeLimitsPlugin.js +7 -4
  170. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
  171. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  172. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
  173. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
  174. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
  175. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  176. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  177. package/lib/rules/RuleSetCompiler.js +3 -3
  178. package/lib/rules/UseEffectRulePlugin.js +6 -4
  179. package/lib/runtime/AsyncModuleRuntimeModule.js +8 -5
  180. package/lib/runtime/AutoPublicPathRuntimeModule.js +4 -2
  181. package/lib/runtime/BaseUriRuntimeModule.js +3 -3
  182. package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
  183. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
  184. package/lib/runtime/CompatRuntimeModule.js +7 -2
  185. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
  186. package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
  187. package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
  188. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
  189. package/lib/runtime/EnsureChunkRuntimeModule.js +15 -4
  190. package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -10
  191. package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
  192. package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
  193. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -2
  194. package/lib/runtime/GlobalRuntimeModule.js +1 -1
  195. package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
  196. package/lib/runtime/LoadScriptRuntimeModule.js +64 -48
  197. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
  198. package/lib/runtime/NonceRuntimeModule.js +1 -1
  199. package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
  200. package/lib/runtime/PublicPathRuntimeModule.js +4 -2
  201. package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
  202. package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
  203. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +9 -3
  204. package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -2
  205. package/lib/runtime/SystemContextRuntimeModule.js +1 -1
  206. package/lib/serialization/BinaryMiddleware.js +143 -1
  207. package/lib/serialization/ErrorObjectSerializer.js +3 -0
  208. package/lib/serialization/ObjectMiddleware.js +9 -3
  209. package/lib/serialization/types.js +1 -1
  210. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  211. package/lib/sharing/ConsumeSharedRuntimeModule.js +14 -5
  212. package/lib/sharing/ProvideSharedDependency.js +11 -0
  213. package/lib/sharing/ProvideSharedModule.js +4 -0
  214. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  215. package/lib/sharing/ShareRuntimeModule.js +12 -5
  216. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  217. package/lib/sharing/utils.js +32 -5
  218. package/lib/util/AsyncQueue.js +4 -2
  219. package/lib/util/ParallelismFactorCalculator.js +10 -0
  220. package/lib/util/Semaphore.js +1 -1
  221. package/lib/util/StackedCacheMap.js +1 -1
  222. package/lib/util/URLAbsoluteSpecifier.js +1 -1
  223. package/lib/util/createHash.js +30 -9
  224. package/lib/util/deprecation.js +10 -3
  225. package/lib/util/deterministicGrouping.js +50 -11
  226. package/lib/util/findGraphRoots.js +4 -2
  227. package/lib/util/memoize.js +3 -3
  228. package/lib/util/processAsyncTree.js +7 -1
  229. package/lib/util/registerExternalSerializer.js +1 -1
  230. package/lib/util/runtime.js +84 -21
  231. package/lib/util/semver.js +1 -0
  232. package/lib/util/smartGrouping.js +1 -1
  233. package/lib/validateSchema.js +6 -2
  234. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +6 -2
  235. package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
  236. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +14 -7
  237. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
  238. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
  239. package/lib/wasm-sync/WebAssemblyParser.js +6 -2
  240. package/lib/web/JsonpChunkLoadingRuntimeModule.js +14 -4
  241. package/lib/webpack.js +11 -2
  242. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -16
  243. package/module.d.ts +1 -0
  244. package/package.json +5 -4
  245. package/schemas/WebpackOptions.check.js +1 -1
  246. package/schemas/WebpackOptions.json +52 -6
  247. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  248. package/schemas/plugins/css/CssParserOptions.json +1 -1
  249. package/types.d.ts +606 -292
package/types.d.ts CHANGED
@@ -13,7 +13,6 @@ import {
13
13
  AssignmentPattern,
14
14
  AssignmentProperty,
15
15
  AwaitExpression,
16
- BaseCallExpression,
17
16
  BigIntLiteral,
18
17
  BinaryExpression,
19
18
  BlockStatement,
@@ -27,6 +26,7 @@ import {
27
26
  ConditionalExpression,
28
27
  ContinueStatement,
29
28
  DebuggerStatement,
29
+ Directive,
30
30
  DoWhileStatement,
31
31
  EmptyStatement,
32
32
  ExportAllDeclaration,
@@ -167,14 +167,20 @@ declare interface AdditionalData {
167
167
  webpackAST: object;
168
168
  }
169
169
  declare class AggressiveMergingPlugin {
170
- constructor(options?: any);
171
- options: any;
170
+ constructor(options?: AggressiveMergingPluginOptions);
171
+ options: AggressiveMergingPluginOptions;
172
172
 
173
173
  /**
174
174
  * Apply the plugin
175
175
  */
176
176
  apply(compiler: Compiler): void;
177
177
  }
178
+ declare interface AggressiveMergingPluginOptions {
179
+ /**
180
+ * minimal size reduction to trigger merging
181
+ */
182
+ minSizeReduce?: number;
183
+ }
178
184
  declare class AggressiveSplittingPlugin {
179
185
  constructor(options?: AggressiveSplittingPluginOptions);
180
186
  options: AggressiveSplittingPluginOptions;
@@ -345,17 +351,19 @@ declare interface AssetResourceGeneratorOptions {
345
351
  }
346
352
  declare class AsyncDependenciesBlock extends DependenciesBlock {
347
353
  constructor(
348
- groupOptions: RawChunkGroupOptions & { name?: string } & {
349
- entryOptions?: EntryOptions;
350
- },
351
- loc?: SyntheticDependencyLocation | RealDependencyLocation,
352
- request?: string
354
+ groupOptions:
355
+ | null
356
+ | (RawChunkGroupOptions & { name?: string } & {
357
+ entryOptions?: EntryOptions;
358
+ }),
359
+ loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
360
+ request?: null | string
353
361
  );
354
362
  groupOptions: RawChunkGroupOptions & { name?: string } & {
355
363
  entryOptions?: EntryOptions;
356
364
  };
357
- loc?: SyntheticDependencyLocation | RealDependencyLocation;
358
- request?: string;
365
+ loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
366
+ request?: null | string;
359
367
  chunkName?: string;
360
368
  module: any;
361
369
  }
@@ -485,7 +493,7 @@ declare interface BaseResolveRequest {
485
493
  }
486
494
  declare abstract class BasicEvaluatedExpression {
487
495
  type: number;
488
- range: [number, number];
496
+ range?: [number, number];
489
497
  falsy: boolean;
490
498
  truthy: boolean;
491
499
  nullish?: boolean;
@@ -500,15 +508,89 @@ declare abstract class BasicEvaluatedExpression {
500
508
  array?: any[];
501
509
  items?: BasicEvaluatedExpression[];
502
510
  options?: BasicEvaluatedExpression[];
503
- prefix?: BasicEvaluatedExpression;
504
- postfix?: BasicEvaluatedExpression;
505
- wrappedInnerExpressions: BasicEvaluatedExpression[];
511
+ prefix?: null | BasicEvaluatedExpression;
512
+ postfix?: null | BasicEvaluatedExpression;
513
+ wrappedInnerExpressions?: BasicEvaluatedExpression[];
506
514
  identifier?: string | VariableInfoInterface;
507
- rootInfo: string | VariableInfoInterface;
508
- getMembers: () => string[];
509
- getMembersOptionals: () => boolean[];
510
- getMemberRangeStarts: () => number[];
511
- expression: NodeEstreeIndex;
515
+ rootInfo?: string | VariableInfoInterface;
516
+ getMembers?: () => string[];
517
+ getMembersOptionals?: () => boolean[];
518
+ getMemberRanges?: () => [number, number][];
519
+ expression?:
520
+ | UnaryExpression
521
+ | ArrayExpression
522
+ | ArrowFunctionExpression
523
+ | AssignmentExpression
524
+ | AwaitExpression
525
+ | BinaryExpression
526
+ | SimpleCallExpression
527
+ | NewExpression
528
+ | ChainExpression
529
+ | ClassExpression
530
+ | ConditionalExpression
531
+ | FunctionExpression
532
+ | Identifier
533
+ | ImportExpression
534
+ | SimpleLiteral
535
+ | RegExpLiteral
536
+ | BigIntLiteral
537
+ | LogicalExpression
538
+ | MemberExpression
539
+ | MetaProperty
540
+ | ObjectExpression
541
+ | SequenceExpression
542
+ | TaggedTemplateExpression
543
+ | TemplateLiteral
544
+ | ThisExpression
545
+ | UpdateExpression
546
+ | YieldExpression
547
+ | FunctionDeclaration
548
+ | VariableDeclaration
549
+ | ClassDeclaration
550
+ | PrivateIdentifier
551
+ | ExpressionStatement
552
+ | BlockStatement
553
+ | StaticBlock
554
+ | EmptyStatement
555
+ | DebuggerStatement
556
+ | WithStatement
557
+ | ReturnStatement
558
+ | LabeledStatement
559
+ | BreakStatement
560
+ | ContinueStatement
561
+ | IfStatement
562
+ | SwitchStatement
563
+ | ThrowStatement
564
+ | TryStatement
565
+ | WhileStatement
566
+ | DoWhileStatement
567
+ | ForStatement
568
+ | ForInStatement
569
+ | ForOfStatement
570
+ | ImportDeclaration
571
+ | ExportNamedDeclaration
572
+ | ExportDefaultDeclaration
573
+ | ExportAllDeclaration
574
+ | MethodDefinition
575
+ | PropertyDefinition
576
+ | VariableDeclarator
577
+ | Program
578
+ | SwitchCase
579
+ | CatchClause
580
+ | ObjectPattern
581
+ | ArrayPattern
582
+ | RestElement
583
+ | AssignmentPattern
584
+ | SpreadElement
585
+ | Property
586
+ | AssignmentProperty
587
+ | ClassBody
588
+ | ImportSpecifier
589
+ | ImportDefaultSpecifier
590
+ | ImportNamespaceSpecifier
591
+ | ExportSpecifier
592
+ | Super
593
+ | TemplateElement;
512
594
  isUnknown(): boolean;
513
595
  isNull(): boolean;
514
596
  isUndefined(): boolean;
@@ -561,7 +643,7 @@ declare abstract class BasicEvaluatedExpression {
561
643
  * Creates a string representation of this evaluated expression.
562
644
  */
563
645
  asString(): undefined | string;
564
- setString(string?: any): BasicEvaluatedExpression;
646
+ setString(string: string): BasicEvaluatedExpression;
565
647
  setUndefined(): BasicEvaluatedExpression;
566
648
  setNull(): BasicEvaluatedExpression;
567
649
 
@@ -593,15 +675,15 @@ declare abstract class BasicEvaluatedExpression {
593
675
  rootInfo: string | VariableInfoInterface,
594
676
  getMembers: () => string[],
595
677
  getMembersOptionals?: () => boolean[],
596
- getMemberRangeStarts?: () => number[]
678
+ getMemberRanges?: () => [number, number][]
597
679
  ): BasicEvaluatedExpression;
598
680
 
599
681
  /**
600
682
  * Wraps an array of expressions with a prefix and postfix expression.
601
683
  */
602
684
  setWrapped(
603
- prefix: null | BasicEvaluatedExpression,
604
- postfix: BasicEvaluatedExpression,
685
+ prefix: undefined | null | BasicEvaluatedExpression,
686
+ postfix: undefined | null | BasicEvaluatedExpression,
605
687
  innerExpressions: BasicEvaluatedExpression[]
606
688
  ): BasicEvaluatedExpression;
607
689
 
@@ -656,11 +738,90 @@ declare abstract class BasicEvaluatedExpression {
656
738
  /**
657
739
  * Set the expression node for the expression.
658
740
  */
659
- setExpression(expression: NodeEstreeIndex): BasicEvaluatedExpression;
741
+ setExpression(
742
+ expression?:
743
+ | UnaryExpression
744
+ | ArrayExpression
745
+ | ArrowFunctionExpression
746
+ | AssignmentExpression
747
+ | AwaitExpression
748
+ | BinaryExpression
749
+ | SimpleCallExpression
750
+ | NewExpression
751
+ | ChainExpression
752
+ | ClassExpression
753
+ | ConditionalExpression
754
+ | FunctionExpression
755
+ | Identifier
756
+ | ImportExpression
757
+ | SimpleLiteral
758
+ | RegExpLiteral
759
+ | BigIntLiteral
760
+ | LogicalExpression
761
+ | MemberExpression
762
+ | MetaProperty
763
+ | ObjectExpression
764
+ | SequenceExpression
765
+ | TaggedTemplateExpression
766
+ | TemplateLiteral
767
+ | ThisExpression
768
+ | UpdateExpression
769
+ | YieldExpression
770
+ | FunctionDeclaration
771
+ | VariableDeclaration
772
+ | ClassDeclaration
773
+ | PrivateIdentifier
774
+ | ExpressionStatement
775
+ | BlockStatement
776
+ | StaticBlock
777
+ | EmptyStatement
778
+ | DebuggerStatement
779
+ | WithStatement
780
+ | ReturnStatement
781
+ | LabeledStatement
782
+ | BreakStatement
783
+ | ContinueStatement
784
+ | IfStatement
785
+ | SwitchStatement
786
+ | ThrowStatement
787
+ | TryStatement
788
+ | WhileStatement
789
+ | DoWhileStatement
790
+ | ForStatement
791
+ | ForInStatement
792
+ | ForOfStatement
793
+ | ImportDeclaration
794
+ | ExportNamedDeclaration
795
+ | ExportDefaultDeclaration
796
+ | ExportAllDeclaration
797
+ | MethodDefinition
798
+ | PropertyDefinition
799
+ | VariableDeclarator
800
+ | Program
801
+ | SwitchCase
802
+ | CatchClause
803
+ | ObjectPattern
804
+ | ArrayPattern
805
+ | RestElement
806
+ | AssignmentPattern
807
+ | SpreadElement
808
+ | Property
809
+ | AssignmentProperty
810
+ | ClassBody
811
+ | ImportSpecifier
812
+ | ImportDefaultSpecifier
813
+ | ImportNamespaceSpecifier
814
+ | ExportSpecifier
815
+ | Super
816
+ | TemplateElement
817
+ ): BasicEvaluatedExpression;
818
+ }
819
+ declare interface BuildInfo {
820
+ [index: string]: any;
660
821
  }
661
822
  type BuildMeta = KnownBuildMeta & Record<string, any>;
662
823
  declare abstract class ByTypeGenerator extends Generator {
663
- map: any;
824
+ map: Record<string, Generator>;
664
825
  }
665
826
  declare const CIRCULAR_CONNECTION: unique symbol;
666
827
  declare class Cache {
@@ -749,7 +910,7 @@ declare interface CacheGroupSource {
749
910
  chunks?: Chunk[],
750
911
  key?: string
751
912
  ) => undefined | string;
752
- chunksFilter?: (chunk: Chunk) => boolean;
913
+ chunksFilter?: (chunk: Chunk) => undefined | boolean;
753
914
  enforce?: boolean;
754
915
  minSize: SplitChunksSizes;
755
916
  minSizeReduction: SplitChunksSizes;
@@ -762,7 +923,7 @@ declare interface CacheGroupSource {
762
923
  maxInitialRequests?: number;
763
924
  filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
764
925
  idHint?: string;
765
- automaticNameDelimiter: string;
926
+ automaticNameDelimiter?: string;
766
927
  reuseExistingChunk?: boolean;
767
928
  usedExports?: boolean;
768
929
  }
@@ -788,7 +949,7 @@ declare interface CallExpressionInfo {
788
949
  name: string;
789
950
  getMembers: () => string[];
790
951
  getMembersOptionals: () => boolean[];
791
- getMemberRangeStarts: () => number[];
952
+ getMemberRanges: () => [number, number][];
792
953
  }
793
954
  declare interface CallbackAsyncQueue<T> {
794
955
  (err?: null | WebpackError, result?: T): any;
@@ -809,19 +970,13 @@ type Cell<T> = undefined | T;
809
970
  declare class Chunk {
810
971
  constructor(name?: string, backCompat?: boolean);
811
972
  id: null | string | number;
812
- ids: null | (string | number)[];
973
+ ids: null | ChunkId[];
813
974
  debugId: number;
814
- name: string;
975
+ name?: string;
815
976
  idNameHints: SortableSet<string>;
816
977
  preventIntegration: boolean;
817
- filenameTemplate:
818
- | null
819
- | string
820
- | ((arg0: PathData, arg1?: AssetInfo) => string);
821
- cssFilenameTemplate:
822
- | null
823
- | string
824
- | ((arg0: PathData, arg1?: AssetInfo) => string);
978
+ filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
979
+ cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
825
980
  runtime: RuntimeSpec;
826
981
  files: Set<string>;
827
982
  auxiliaryFiles: Set<string>;
@@ -878,7 +1033,7 @@ declare class Chunk {
878
1033
  getChildrenOfTypeInOrder(
879
1034
  chunkGraph: ChunkGraph,
880
1035
  type: string
881
- ): { onChunks: Chunk[]; chunks: Set<Chunk> }[];
1036
+ ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
882
1037
  getChildIdsByOrdersMap(
883
1038
  chunkGraph: ChunkGraph,
884
1039
  includeDirectChildren?: boolean,
@@ -1066,7 +1221,7 @@ declare abstract class ChunkGroup {
1066
1221
  options: ChunkGroupOptions;
1067
1222
  chunks: Chunk[];
1068
1223
  origins: OriginRecord[];
1069
- index: number;
1224
+ index?: number;
1070
1225
 
1071
1226
  /**
1072
1227
  * when a new chunk is added to a chunkGroup, addingOptions will occur.
@@ -1147,7 +1302,7 @@ declare abstract class ChunkGroup {
1147
1302
  /**
1148
1303
  * Gets the top-down index of a module in this ChunkGroup
1149
1304
  */
1150
- getModulePreOrderIndex(module: Module): number;
1305
+ getModulePreOrderIndex(module: Module): undefined | number;
1151
1306
 
1152
1307
  /**
1153
1308
  * Sets the bottom-up index of a module in this ChunkGroup
@@ -1157,10 +1312,10 @@ declare abstract class ChunkGroup {
1157
1312
  /**
1158
1313
  * Gets the bottom-up index of a module in this ChunkGroup
1159
1314
  */
1160
- getModulePostOrderIndex(module: Module): number;
1315
+ getModulePostOrderIndex(module: Module): undefined | number;
1161
1316
  checkConstraints(): void;
1162
- getModuleIndex: (module: Module) => number;
1163
- getModuleIndex2: (module: Module) => number;
1317
+ getModuleIndex: (module: Module) => undefined | number;
1318
+ getModuleIndex2: (module: Module) => undefined | number;
1164
1319
  }
1165
1320
  type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
1166
1321
  declare interface ChunkHashContext {
@@ -1184,6 +1339,7 @@ declare interface ChunkHashContext {
1184
1339
  */
1185
1340
  chunkGraph: ChunkGraph;
1186
1341
  }
1342
+ type ChunkId = string | number;
1187
1343
  declare interface ChunkMaps {
1188
1344
  hash: Record<string | number, string>;
1189
1345
  contentHash: Record<string | number, Record<string, string>>;
@@ -2077,7 +2233,7 @@ declare class Compiler {
2077
2233
  parentCompilation?: Compilation;
2078
2234
  root: Compiler;
2079
2235
  outputPath: string;
2080
- watching: Watching;
2236
+ watching?: Watching;
2081
2237
  outputFileSystem: OutputFileSystem;
2082
2238
  intermediateFileSystem: IntermediateFileSystem;
2083
2239
  inputFileSystem: InputFileSystem;
@@ -2087,11 +2243,14 @@ declare class Compiler {
2087
2243
  records: object;
2088
2244
  managedPaths: Set<string | RegExp>;
2089
2245
  immutablePaths: Set<string | RegExp>;
2090
- modifiedFiles: ReadonlySet<string>;
2091
- removedFiles: ReadonlySet<string>;
2092
- fileTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
2093
- contextTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
2094
- fsStartTime: number;
2246
+ modifiedFiles?: ReadonlySet<string>;
2247
+ removedFiles?: ReadonlySet<string>;
2248
+ fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
2249
+ contextTimestamps?: ReadonlyMap<
2250
+ string,
2251
+ null | FileSystemInfoEntry | "ignore"
2252
+ >;
2253
+ fsStartTime?: number;
2095
2254
  resolverFactory: ResolverFactory;
2096
2255
  infrastructureLogger: any;
2097
2256
  options: WebpackOptionsNormalized;
@@ -2192,7 +2351,7 @@ declare class ConcatenationScope {
2192
2351
  static isModuleReference(name: string): boolean;
2193
2352
  static matchModuleReference(
2194
2353
  name: string
2195
- ): ModuleReferenceOptions & { index: number };
2354
+ ): null | (ModuleReferenceOptions & { index: number });
2196
2355
  static DEFAULT_EXPORT: string;
2197
2356
  static NAMESPACE_OBJECT_EXPORT: string;
2198
2357
  }
@@ -2261,7 +2420,7 @@ declare interface Configuration {
2261
2420
  | ((
2262
2421
  data: ExternalItemFunctionData,
2263
2422
  callback: (
2264
- err?: Error,
2423
+ err?: null | Error,
2265
2424
  result?: string | boolean | string[] | { [index: string]: any }
2266
2425
  ) => void
2267
2426
  ) => void)
@@ -2374,6 +2533,11 @@ declare interface Configuration {
2374
2533
  * Add additional plugins to the compiler.
2375
2534
  */
2376
2535
  plugins?: (
2536
+ | undefined
2537
+ | null
2538
+ | false
2539
+ | ""
2540
+ | 0
2377
2541
  | ((this: Compiler, compiler: Compiler) => void)
2378
2542
  | WebpackPluginInstance
2379
2543
  )[];
@@ -2411,7 +2575,7 @@ declare interface Configuration {
2411
2575
  /**
2412
2576
  * Options affecting how file system snapshots are created and validated.
2413
2577
  */
2414
- snapshot?: SnapshotOptions;
2578
+ snapshot?: SnapshotOptionsWebpackOptions;
2415
2579
 
2416
2580
  /**
2417
2581
  * Stats options object or preset name.
@@ -2451,7 +2615,7 @@ declare class ConstDependency extends NullDependency {
2451
2615
  constructor(
2452
2616
  expression: string,
2453
2617
  range: number | [number, number],
2454
- runtimeRequirements?: string[]
2618
+ runtimeRequirements?: null | string[]
2455
2619
  );
2456
2620
  expression: string;
2457
2621
  range: number | [number, number];
@@ -2681,7 +2845,8 @@ declare interface ContextModuleOptions {
2681
2845
  /**
2682
2846
  * exports referenced from modules (won't be mangled)
2683
2847
  */
2684
- referencedExports?: string[][];
2848
+ referencedExports?: null | string[][];
2849
+ layer?: string;
2685
2850
  resource: string | false | string[];
2686
2851
  resourceQuery?: string;
2687
2852
  resourceFragment?: string;
@@ -2689,18 +2854,22 @@ declare interface ContextModuleOptions {
2689
2854
  }
2690
2855
  declare class ContextReplacementPlugin {
2691
2856
  constructor(
2692
- resourceRegExp?: any,
2857
+ resourceRegExp: RegExp,
2693
2858
  newContentResource?: any,
2694
2859
  newContentRecursive?: any,
2695
2860
  newContentRegExp?: any
2696
2861
  );
2697
- resourceRegExp: any;
2862
+ resourceRegExp: RegExp;
2698
2863
  newContentCallback: any;
2699
2864
  newContentResource: any;
2700
2865
  newContentCreateContextMap: any;
2701
2866
  newContentRecursive: any;
2702
2867
  newContentRegExp: any;
2703
- apply(compiler?: any): void;
2868
+
2869
+ /**
2870
+ * Apply the plugin
2871
+ */
2872
+ apply(compiler: Compiler): void;
2704
2873
  }
2705
2874
  declare interface ContextTimestampAndHash {
2706
2875
  safeTime: number;
@@ -2757,7 +2926,7 @@ declare interface DepConstructor {
2757
2926
  declare abstract class DependenciesBlock {
2758
2927
  dependencies: Dependency[];
2759
2928
  blocks: AsyncDependenciesBlock[];
2760
- parent: DependenciesBlock;
2929
+ parent?: DependenciesBlock;
2761
2930
  getRootBlock(): DependenciesBlock;
2762
2931
 
2763
2932
  /**
@@ -2788,10 +2957,10 @@ declare class Dependency {
2788
2957
  get category(): string;
2789
2958
  loc: DependencyLocation;
2790
2959
  setLoc(
2791
- startLine?: any,
2792
- startColumn?: any,
2793
- endLine?: any,
2794
- endColumn?: any
2960
+ startLine: number,
2961
+ startColumn: number,
2962
+ endLine: number,
2963
+ endColumn: number
2795
2964
  ): void;
2796
2965
  getContext(): undefined | string;
2797
2966
  getResourceIdentifier(): null | string;
@@ -2824,12 +2993,12 @@ declare class Dependency {
2824
2993
  /**
2825
2994
  * Returns warnings
2826
2995
  */
2827
- getWarnings(moduleGraph: ModuleGraph): WebpackError[];
2996
+ getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2828
2997
 
2829
2998
  /**
2830
2999
  * Returns errors
2831
3000
  */
2832
- getErrors(moduleGraph: ModuleGraph): WebpackError[];
3001
+ getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
2833
3002
 
2834
3003
  /**
2835
3004
  * Update the hash
@@ -2843,7 +3012,7 @@ declare class Dependency {
2843
3012
  getModuleEvaluationSideEffectsState(
2844
3013
  moduleGraph: ModuleGraph
2845
3014
  ): ConnectionState;
2846
- createIgnoredModule(context: string): Module;
3015
+ createIgnoredModule(context: string): null | Module;
2847
3016
  serialize(__0: ObjectSerializerContext): void;
2848
3017
  deserialize(__0: ObjectDeserializerContext): void;
2849
3018
  module: any;
@@ -2916,7 +3085,7 @@ declare interface DependencyTemplateContext {
2916
3085
  codeGenerationResults: CodeGenerationResults;
2917
3086
  }
2918
3087
  declare abstract class DependencyTemplates {
2919
- get(dependency: DependencyConstructor): DependencyTemplate;
3088
+ get(dependency: DependencyConstructor): undefined | DependencyTemplate;
2920
3089
  set(
2921
3090
  dependency: DependencyConstructor,
2922
3091
  dependencyTemplate: DependencyTemplate
@@ -3057,7 +3226,11 @@ declare interface DllPluginOptions {
3057
3226
  declare class DllReferencePlugin {
3058
3227
  constructor(options: DllReferencePluginOptions);
3059
3228
  options: DllReferencePluginOptions;
3060
- apply(compiler?: any): void;
3229
+
3230
+ /**
3231
+ * Apply the plugin
3232
+ */
3233
+ apply(compiler: Compiler): void;
3061
3234
  }
3062
3235
  type DllReferencePluginOptions =
3063
3236
  | {
@@ -3991,7 +4164,7 @@ declare interface ExpressionExpressionInfo {
3991
4164
  name: string;
3992
4165
  getMembers: () => string[];
3993
4166
  getMembersOptionals: () => boolean[];
3994
- getMemberRangeStarts: () => number[];
4167
+ getMemberRanges: () => [number, number][];
3995
4168
  }
3996
4169
  declare interface ExtensionAliasOption {
3997
4170
  alias: string | string[];
@@ -4007,7 +4180,7 @@ type ExternalItem =
4007
4180
  | ((
4008
4181
  data: ExternalItemFunctionData,
4009
4182
  callback: (
4010
- err?: Error,
4183
+ err?: null | Error,
4011
4184
  result?: string | boolean | string[] | { [index: string]: any }
4012
4185
  ) => void
4013
4186
  ) => void)
@@ -4071,7 +4244,11 @@ declare interface ExternalItemObjectUnknown {
4071
4244
  }
4072
4245
  type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
4073
4246
  declare class ExternalModule extends Module {
4074
- constructor(request?: any, type?: any, userRequest?: any);
4247
+ constructor(
4248
+ request: string | string[] | Record<string, string | string[]>,
4249
+ type: any,
4250
+ userRequest: string
4251
+ );
4075
4252
  request: string | string[] | Record<string, string | string[]>;
4076
4253
  externalType: string;
4077
4254
  userRequest: string;
@@ -4092,7 +4269,7 @@ type Externals =
4092
4269
  | ((
4093
4270
  data: ExternalItemFunctionData,
4094
4271
  callback: (
4095
- err?: Error,
4272
+ err?: null | Error,
4096
4273
  result?: string | boolean | string[] | { [index: string]: any }
4097
4274
  ) => void
4098
4275
  ) => void)
@@ -4187,10 +4364,13 @@ declare interface FactorizeModuleOptions {
4187
4364
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
4188
4365
  context?: string;
4189
4366
  }
4367
+ declare interface FactoryMeta {
4368
+ sideEffectFree?: boolean;
4369
+ }
4190
4370
  type FakeHook<T> = T & FakeHookMarker;
4191
4371
  declare interface FakeHookMarker {}
4192
4372
  declare interface FallbackCacheGroup {
4193
- chunksFilter: (chunk: Chunk) => boolean;
4373
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
4194
4374
  minSize: SplitChunksSizes;
4195
4375
  maxAsyncSize: SplitChunksSizes;
4196
4376
  maxInitialSize: SplitChunksSizes;
@@ -4437,7 +4617,7 @@ declare abstract class FileSystemInfo {
4437
4617
  ): void;
4438
4618
  getFileHash(
4439
4619
  path: string,
4440
- callback: (arg0?: null | WebpackError, arg1?: string) => void
4620
+ callback: (arg0?: null | WebpackError, arg1?: null | string) => void
4441
4621
  ): void;
4442
4622
  getContextHash(
4443
4623
  path: string,
@@ -4463,20 +4643,11 @@ declare abstract class FileSystemInfo {
4463
4643
  callback: (arg0?: null | Error, arg1?: boolean) => void
4464
4644
  ): void;
4465
4645
  createSnapshot(
4466
- startTime: number,
4646
+ startTime: undefined | null | number,
4467
4647
  files: Iterable<string>,
4468
4648
  directories: Iterable<string>,
4469
4649
  missing: Iterable<string>,
4470
- options: {
4471
- /**
4472
- * Use hashes of the content of the files/directories to determine invalidation.
4473
- */
4474
- hash?: boolean;
4475
- /**
4476
- * Use timestamps of the files/directories to determine invalidation.
4477
- */
4478
- timestamp?: boolean;
4479
- },
4650
+ options: undefined | null | SnapshotOptionsFileSystemInfo,
4480
4651
  callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
4481
4652
  ): void;
4482
4653
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
@@ -4557,7 +4728,7 @@ declare class Generator {
4557
4728
  context: ConcatenationBailoutReasonContext
4558
4729
  ): undefined | string;
4559
4730
  updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
4560
- static byType(map?: any): ByTypeGenerator;
4731
+ static byType(map: Record<string, Generator>): ByTypeGenerator;
4561
4732
  }
4562
4733
  type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
4563
4734
  GeneratorOptionsByModuleTypeUnknown;
@@ -4958,8 +5129,8 @@ declare abstract class InitFragment<Context> {
4958
5129
  endContent?: string | Source;
4959
5130
  getContent(context: Context): string | Source;
4960
5131
  getEndContent(context: Context): undefined | string | Source;
4961
- serialize(context?: any): void;
4962
- deserialize(context?: any): void;
5132
+ serialize(context: ObjectSerializerContext): void;
5133
+ deserialize(context: ObjectDeserializerContext): void;
4963
5134
  merge: any;
4964
5135
  }
4965
5136
  declare interface InputFileSystem {
@@ -5341,10 +5512,10 @@ declare class JavascriptParser extends Parser {
5341
5512
  typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
5342
5513
  importCall: SyncBailHook<[ImportExpression], boolean | void>;
5343
5514
  topLevelAwait: SyncBailHook<[Expression], boolean | void>;
5344
- call: HookMap<SyncBailHook<[BaseCallExpression], boolean | void>>;
5515
+ call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
5345
5516
  callMemberChain: HookMap<
5346
5517
  SyncBailHook<
5347
- [CallExpression, string[], boolean[], number[]],
5518
+ [CallExpression, string[], boolean[], [number, number][]],
5348
5519
  boolean | void
5349
5520
  >
5350
5521
  >;
@@ -5356,7 +5527,7 @@ declare class JavascriptParser extends Parser {
5356
5527
  >;
5357
5528
  callMemberChainOfCallMemberChain: HookMap<
5358
5529
  SyncBailHook<
5359
- [Expression, string[], CallExpression, string[]],
5530
+ [CallExpression, string[], CallExpression, string[]],
5360
5531
  boolean | void
5361
5532
  >
5362
5533
  >;
@@ -5365,13 +5536,22 @@ declare class JavascriptParser extends Parser {
5365
5536
  binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
5366
5537
  expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
5367
5538
  expressionMemberChain: HookMap<
5368
- SyncBailHook<[Expression, string[], boolean[], number[]], boolean | void>
5539
+ SyncBailHook<
5540
+ [MemberExpression, string[], boolean[], [number, number][]],
5541
+ boolean | void
5542
+ >
5369
5543
  >;
5370
5544
  unhandledExpressionMemberChain: HookMap<
5371
- SyncBailHook<[Expression, string[]], boolean | void>
5545
+ SyncBailHook<[MemberExpression, string[]], boolean | void>
5546
+ >;
5547
+ expressionConditionalOperator: SyncBailHook<
5548
+ [ConditionalExpression],
5549
+ boolean | void
5550
+ >;
5551
+ expressionLogicalOperator: SyncBailHook<
5552
+ [LogicalExpression],
5553
+ boolean | void
5372
5554
  >;
5373
- expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
5374
- expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
5375
5555
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
5376
5556
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
5377
5557
  }>;
@@ -5435,7 +5615,7 @@ declare class JavascriptParser extends Parser {
5435
5615
  | ExportDefaultDeclaration
5436
5616
  | ExportAllDeclaration
5437
5617
  )[];
5438
- prevStatement:
5618
+ prevStatement?:
5439
5619
  | UnaryExpression
5440
5620
  | ArrayExpression
5441
5621
  | ArrowFunctionExpression
@@ -5824,43 +6004,75 @@ declare class JavascriptParser extends Parser {
5824
6004
  callHooksForExpressionWithFallback<T, R>(
5825
6005
  hookMap: HookMap<SyncBailHook<T, R>>,
5826
6006
  expr: MemberExpression,
5827
- fallback: (
5828
- arg0: string,
5829
- arg1: string | ScopeInfo | VariableInfo,
5830
- arg2: () => string[]
5831
- ) => any,
5832
- defined: (arg0: string) => any,
6007
+ fallback:
6008
+ | undefined
6009
+ | ((
6010
+ arg0: string,
6011
+ arg1: string | ScopeInfo | VariableInfo,
6012
+ arg2: () => string[]
6013
+ ) => any),
6014
+ defined: undefined | ((arg0: string) => any),
5833
6015
  ...args: AsArray<T>
5834
- ): R;
6016
+ ): undefined | R;
5835
6017
  callHooksForName<T, R>(
5836
6018
  hookMap: HookMap<SyncBailHook<T, R>>,
5837
6019
  name: string,
5838
6020
  ...args: AsArray<T>
5839
- ): R;
6021
+ ): undefined | R;
5840
6022
  callHooksForInfo<T, R>(
5841
6023
  hookMap: HookMap<SyncBailHook<T, R>>,
5842
6024
  info: ExportedVariableInfo,
5843
6025
  ...args: AsArray<T>
5844
- ): R;
6026
+ ): undefined | R;
5845
6027
  callHooksForInfoWithFallback<T, R>(
5846
6028
  hookMap: HookMap<SyncBailHook<T, R>>,
5847
6029
  info: ExportedVariableInfo,
5848
- fallback: (arg0: string) => any,
5849
- defined: () => any,
6030
+ fallback: undefined | ((arg0: string) => any),
6031
+ defined: undefined | (() => any),
5850
6032
  ...args: AsArray<T>
5851
- ): R;
6033
+ ): undefined | R;
5852
6034
  callHooksForNameWithFallback<T, R>(
5853
6035
  hookMap: HookMap<SyncBailHook<T, R>>,
5854
6036
  name: string,
5855
- fallback: (arg0: string) => any,
5856
- defined: () => any,
6037
+ fallback: undefined | ((arg0: string) => any),
6038
+ defined: undefined | (() => any),
5857
6039
  ...args: AsArray<T>
5858
- ): R;
6040
+ ): undefined | R;
5859
6041
  inScope(params: any, fn: () => void): void;
5860
- inClassScope(hasThis?: any, params?: any, fn?: any): void;
5861
- inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
5862
- inBlockScope(fn?: any): void;
5863
- detectMode(statements?: any): void;
6042
+ inClassScope(hasThis: boolean, params: any, fn: () => void): void;
6043
+ inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
6044
+ inBlockScope(fn: () => void): void;
6045
+ detectMode(
6046
+ statements: (
6047
+ | FunctionDeclaration
6048
+ | VariableDeclaration
6049
+ | ClassDeclaration
6050
+ | ExpressionStatement
6051
+ | BlockStatement
6052
+ | StaticBlock
6053
+ | EmptyStatement
6054
+ | DebuggerStatement
6055
+ | WithStatement
6056
+ | ReturnStatement
6057
+ | LabeledStatement
6058
+ | BreakStatement
6059
+ | ContinueStatement
6060
+ | IfStatement
6061
+ | SwitchStatement
6062
+ | ThrowStatement
6063
+ | TryStatement
6064
+ | WhileStatement
6065
+ | DoWhileStatement
6066
+ | ForStatement
6067
+ | ForInStatement
6068
+ | ForOfStatement
6069
+ | ImportDeclaration
6070
+ | ExportNamedDeclaration
6071
+ | ExportDefaultDeclaration
6072
+ | ExportAllDeclaration
6073
+ | Directive
6074
+ )[]
6075
+ ): void;
5864
6076
  enterPatterns(patterns?: any, onIdent?: any): void;
5865
6077
  enterPattern(pattern?: any, onIdent?: any): void;
5866
6078
  enterIdentifier(pattern: Identifier, onIdent?: any): void;
@@ -5868,7 +6080,7 @@ declare class JavascriptParser extends Parser {
5868
6080
  enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
5869
6081
  enterRestElement(pattern: RestElement, onIdent?: any): void;
5870
6082
  enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
5871
- evaluateExpression(expression: Expression): BasicEvaluatedExpression;
6083
+ evaluateExpression(expression?: any): BasicEvaluatedExpression;
5872
6084
  parseString(expression: Expression): string;
5873
6085
  parseCalculatedString(expression?: any): any;
5874
6086
  evaluate(source: string): BasicEvaluatedExpression;
@@ -5912,7 +6124,7 @@ declare class JavascriptParser extends Parser {
5912
6124
  getComments(range: [number, number]): any[];
5913
6125
  isAsiPosition(pos: number): boolean;
5914
6126
  unsetAsiPosition(pos: number): void;
5915
- isStatementLevelExpression(expr?: any): boolean;
6127
+ isStatementLevelExpression(expr: Expression): boolean;
5916
6128
  getTagData(name?: any, tag?: any): any;
5917
6129
  tagVariable(name?: any, tag?: any, data?: any): void;
5918
6130
  defineVariable(name: string): void;
@@ -5954,21 +6166,24 @@ declare class JavascriptParser extends Parser {
5954
6166
  | YieldExpression
5955
6167
  | Super;
5956
6168
  membersOptionals: boolean[];
5957
- memberRangeStarts: number[];
5958
- };
5959
- getFreeInfoFromVariable(varName: string): {
5960
- name: string;
5961
- info: string | VariableInfo;
6169
+ memberRanges: [number, number][];
5962
6170
  };
6171
+ getFreeInfoFromVariable(
6172
+ varName: string
6173
+ ): undefined | { name: string; info: string | VariableInfo };
5963
6174
  getMemberExpressionInfo(
5964
6175
  expression: MemberExpression,
5965
6176
  allowedTypes: number
5966
6177
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5967
- getNameForExpression(expression: MemberExpression): {
5968
- name: string;
5969
- rootInfo: ExportedVariableInfo;
5970
- getMembers: () => string[];
5971
- };
6178
+ getNameForExpression(
6179
+ expression: MemberExpression
6180
+ ):
6181
+ | undefined
6182
+ | {
6183
+ name: string;
6184
+ rootInfo: ExportedVariableInfo;
6185
+ getMembers: () => string[];
6186
+ };
5972
6187
  static ALLOWED_MEMBER_TYPES_ALL: 3;
5973
6188
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
5974
6189
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
@@ -6005,6 +6220,11 @@ declare interface JavascriptParserOptions {
6005
6220
  */
6006
6221
  createRequire?: string | boolean;
6007
6222
 
6223
+ /**
6224
+ * Specifies global fetchPriority for dynamic import.
6225
+ */
6226
+ dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6227
+
6008
6228
  /**
6009
6229
  * Specifies global mode for dynamic import.
6010
6230
  */
@@ -6674,14 +6894,45 @@ declare interface LibIdentOptions {
6674
6894
  associatedObjectForCache?: Object;
6675
6895
  }
6676
6896
  declare class LibManifestPlugin {
6677
- constructor(options?: any);
6678
- options: any;
6897
+ constructor(options: LibManifestPluginOptions);
6898
+ options: LibManifestPluginOptions;
6679
6899
 
6680
6900
  /**
6681
6901
  * Apply the plugin
6682
6902
  */
6683
6903
  apply(compiler: Compiler): void;
6684
6904
  }
6905
+ declare interface LibManifestPluginOptions {
6906
+ /**
6907
+ * Context of requests in the manifest file (defaults to the webpack context).
6908
+ */
6909
+ context?: string;
6910
+
6911
+ /**
6912
+ * If true, only entry points will be exposed (default: true).
6913
+ */
6914
+ entryOnly?: boolean;
6915
+
6916
+ /**
6917
+ * If true, manifest json file (output) will be formatted.
6918
+ */
6919
+ format?: boolean;
6920
+
6921
+ /**
6922
+ * Name of the exposed dll function (external name, use value of 'output.library').
6923
+ */
6924
+ name?: string;
6925
+
6926
+ /**
6927
+ * Absolute path to the manifest json file (output).
6928
+ */
6929
+ path: string;
6930
+
6931
+ /**
6932
+ * Type of the dll bundle (external type, use value of 'output.libraryTarget').
6933
+ */
6934
+ type?: string;
6935
+ }
6685
6936
  declare interface LibraryContext<T> {
6686
6937
  compilation: Compilation;
6687
6938
  chunkGraph: ChunkGraph;
@@ -6815,7 +7066,7 @@ declare interface LoadScriptCompilationHooks {
6815
7066
  createScript: SyncWaterfallHook<[string, Chunk]>;
6816
7067
  }
6817
7068
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
6818
- constructor(withCreateScriptUrl?: boolean);
7069
+ constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
6819
7070
  static getCompilationHooks(
6820
7071
  compilation: Compilation
6821
7072
  ): LoadScriptCompilationHooks;
@@ -7260,20 +7511,20 @@ declare class Module extends DependenciesBlock {
7260
7511
  needId: boolean;
7261
7512
  debugId: number;
7262
7513
  resolveOptions?: ResolveOptionsWebpackOptions;
7263
- factoryMeta?: object;
7514
+ factoryMeta?: FactoryMeta;
7264
7515
  useSourceMap: boolean;
7265
7516
  useSimpleSourceMap: boolean;
7266
7517
  buildMeta?: BuildMeta;
7267
- buildInfo?: Record<string, any>;
7518
+ buildInfo?: BuildInfo;
7268
7519
  presentationalDependencies?: Dependency[];
7269
7520
  codeGenerationDependencies?: Dependency[];
7270
7521
  id: string | number;
7271
7522
  get hash(): string;
7272
7523
  get renderedHash(): string;
7273
7524
  profile: null | ModuleProfile;
7274
- index: number;
7275
- index2: number;
7276
- depth: number;
7525
+ index: null | number;
7526
+ index2: null | number;
7527
+ depth: null | number;
7277
7528
  issuer: null | Module;
7278
7529
  get usedExports(): null | boolean | SortableSet<string>;
7279
7530
  get optimizationBailout(): (
@@ -7293,7 +7544,7 @@ declare class Module extends DependenciesBlock {
7293
7544
  get moduleArgument(): string;
7294
7545
  getExportsType(
7295
7546
  moduleGraph: ModuleGraph,
7296
- strict: boolean
7547
+ strict?: boolean
7297
7548
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
7298
7549
  addPresentationalDependency(presentationalDependency: Dependency): void;
7299
7550
  addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
@@ -7557,11 +7808,11 @@ declare class ModuleGraph {
7557
7808
  filterConnection: (arg0: ModuleGraphConnection) => boolean
7558
7809
  ): void;
7559
7810
  addExtraReason(module: Module, explanation: string): void;
7560
- getResolvedModule(dependency: Dependency): Module;
7811
+ getResolvedModule(dependency: Dependency): null | Module;
7561
7812
  getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
7562
- getModule(dependency: Dependency): Module;
7563
- getOrigin(dependency: Dependency): Module;
7564
- getResolvedOrigin(dependency: Dependency): Module;
7813
+ getModule(dependency: Dependency): null | Module;
7814
+ getOrigin(dependency: Dependency): null | Module;
7815
+ getResolvedOrigin(dependency: Dependency): null | Module;
7565
7816
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
7566
7817
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
7567
7818
  getIncomingConnectionsByOriginModule(
@@ -7590,19 +7841,19 @@ declare class ModuleGraph {
7590
7841
  module: Module,
7591
7842
  runtime: RuntimeSpec
7592
7843
  ): null | boolean | SortableSet<string>;
7593
- getPreOrderIndex(module: Module): number;
7594
- getPostOrderIndex(module: Module): number;
7844
+ getPreOrderIndex(module: Module): null | number;
7845
+ getPostOrderIndex(module: Module): null | number;
7595
7846
  setPreOrderIndex(module: Module, index: number): void;
7596
7847
  setPreOrderIndexIfUnset(module: Module, index: number): boolean;
7597
7848
  setPostOrderIndex(module: Module, index: number): void;
7598
7849
  setPostOrderIndexIfUnset(module: Module, index: number): boolean;
7599
- getDepth(module: Module): number;
7850
+ getDepth(module: Module): null | number;
7600
7851
  setDepth(module: Module, depth: number): void;
7601
7852
  setDepthIfLower(module: Module, depth: number): boolean;
7602
7853
  isAsync(module: Module): boolean;
7603
7854
  setAsync(module: Module): void;
7604
7855
  getMeta(thing?: any): Object;
7605
- getMetaIfExisting(thing?: any): Object;
7856
+ getMetaIfExisting(thing?: any): undefined | Object;
7606
7857
  freeze(cacheStage?: string): void;
7607
7858
  unfreeze(): void;
7608
7859
  cached<T extends any[], V>(
@@ -7643,11 +7894,11 @@ declare class ModuleGraphConnection {
7643
7894
  module: Module;
7644
7895
  weak: boolean;
7645
7896
  conditional: boolean;
7646
- condition: (
7897
+ condition?: (
7647
7898
  arg0: ModuleGraphConnection,
7648
7899
  arg1: RuntimeSpec
7649
7900
  ) => ConnectionState;
7650
- explanations: Set<string>;
7901
+ explanations?: Set<string>;
7651
7902
  clone(): ModuleGraphConnection;
7652
7903
  addCondition(
7653
7904
  condition: (
@@ -7678,7 +7929,7 @@ declare interface ModuleOptions {
7678
7929
  /**
7679
7930
  * An array of rules applied by default for modules.
7680
7931
  */
7681
- defaultRules?: (RuleSetRule | "...")[];
7932
+ defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7682
7933
 
7683
7934
  /**
7684
7935
  * Enable warnings for full dynamic dependencies.
@@ -7718,7 +7969,7 @@ declare interface ModuleOptions {
7718
7969
  /**
7719
7970
  * An array of rules applied for modules.
7720
7971
  */
7721
- rules?: (RuleSetRule | "...")[];
7972
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7722
7973
 
7723
7974
  /**
7724
7975
  * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
@@ -7778,7 +8029,7 @@ declare interface ModuleOptionsNormalized {
7778
8029
  /**
7779
8030
  * An array of rules applied by default for modules.
7780
8031
  */
7781
- defaultRules: (RuleSetRule | "...")[];
8032
+ defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7782
8033
 
7783
8034
  /**
7784
8035
  * Specify options for each generator.
@@ -7798,7 +8049,7 @@ declare interface ModuleOptionsNormalized {
7798
8049
  /**
7799
8050
  * An array of rules applied for modules.
7800
8051
  */
7801
- rules: (RuleSetRule | "...")[];
8052
+ rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7802
8053
 
7803
8054
  /**
7804
8055
  * Cache the resolving of module requests.
@@ -7832,7 +8083,7 @@ declare abstract class ModuleProfile {
7832
8083
  storingEndTime: number;
7833
8084
  storing: number;
7834
8085
  storingParallelismFactor: number;
7835
- additionalFactoryTimes: any;
8086
+ additionalFactoryTimes?: { start: number; end: number }[];
7836
8087
  additionalFactories: number;
7837
8088
  additionalFactoriesParallelismFactor: number;
7838
8089
  additionalIntegration: number;
@@ -7970,7 +8221,7 @@ declare abstract class MultiStats {
7970
8221
  declare abstract class MultiWatching {
7971
8222
  watchings: Watching[];
7972
8223
  compiler: MultiCompiler;
7973
- invalidate(callback?: any): void;
8224
+ invalidate(callback?: CallbackFunction<void>): void;
7974
8225
  suspend(): void;
7975
8226
  resume(): void;
7976
8227
  close(callback: CallbackFunction<void>): void;
@@ -8032,6 +8283,7 @@ declare class NoEmitOnErrorsPlugin {
8032
8283
  */
8033
8284
  apply(compiler: Compiler): void;
8034
8285
  }
8286
+ type Node = false | NodeOptions;
8035
8287
  declare class NodeEnvironmentPlugin {
8036
8288
  constructor(options: {
8037
8289
  /**
@@ -8051,81 +8303,6 @@ declare class NodeEnvironmentPlugin {
8051
8303
  */
8052
8304
  apply(compiler: Compiler): void;
8053
8305
  }
8054
- type NodeEstreeIndex =
8055
- | UnaryExpression
8056
- | ArrayExpression
8057
- | ArrowFunctionExpression
8058
- | AssignmentExpression
8059
- | AwaitExpression
8060
- | BinaryExpression
8061
- | SimpleCallExpression
8062
- | NewExpression
8063
- | ChainExpression
8064
- | ClassExpression
8065
- | ConditionalExpression
8066
- | FunctionExpression
8067
- | Identifier
8068
- | ImportExpression
8069
- | SimpleLiteral
8070
- | RegExpLiteral
8071
- | BigIntLiteral
8072
- | LogicalExpression
8073
- | MemberExpression
8074
- | MetaProperty
8075
- | ObjectExpression
8076
- | SequenceExpression
8077
- | TaggedTemplateExpression
8078
- | TemplateLiteral
8079
- | ThisExpression
8080
- | UpdateExpression
8081
- | YieldExpression
8082
- | FunctionDeclaration
8083
- | VariableDeclaration
8084
- | ClassDeclaration
8085
- | PrivateIdentifier
8086
- | ExpressionStatement
8087
- | BlockStatement
8088
- | StaticBlock
8089
- | EmptyStatement
8090
- | DebuggerStatement
8091
- | WithStatement
8092
- | ReturnStatement
8093
- | LabeledStatement
8094
- | BreakStatement
8095
- | ContinueStatement
8096
- | IfStatement
8097
- | SwitchStatement
8098
- | ThrowStatement
8099
- | TryStatement
8100
- | WhileStatement
8101
- | DoWhileStatement
8102
- | ForStatement
8103
- | ForInStatement
8104
- | ForOfStatement
8105
- | ImportDeclaration
8106
- | ExportNamedDeclaration
8107
- | ExportDefaultDeclaration
8108
- | ExportAllDeclaration
8109
- | MethodDefinition
8110
- | PropertyDefinition
8111
- | VariableDeclarator
8112
- | Program
8113
- | SwitchCase
8114
- | CatchClause
8115
- | ObjectPattern
8116
- | ArrayPattern
8117
- | RestElement
8118
- | AssignmentPattern
8119
- | SpreadElement
8120
- | Property
8121
- | AssignmentProperty
8122
- | ClassBody
8123
- | ImportSpecifier
8124
- | ImportDefaultSpecifier
8125
- | ImportNamespaceSpecifier
8126
- | ExportSpecifier
8127
- | Super
8128
- | TemplateElement;
8129
8306
 
8130
8307
  /**
8131
8308
  * Options object for node compatibility features.
@@ -8176,7 +8353,6 @@ declare interface NodeTemplatePluginOptions {
8176
8353
  */
8177
8354
  asyncChunkLoading?: boolean;
8178
8355
  }
8179
- type NodeWebpackOptions = false | NodeOptions;
8180
8356
  declare class NormalModule extends Module {
8181
8357
  constructor(__0: NormalModuleCreateData);
8182
8358
  request: string;
@@ -8596,6 +8772,11 @@ declare interface Optimization {
8596
8772
  * Minimizer(s) to use for minimizing the output.
8597
8773
  */
8598
8774
  minimizer?: (
8775
+ | undefined
8776
+ | null
8777
+ | false
8778
+ | ""
8779
+ | 0
8599
8780
  | ((this: Compiler, compiler: Compiler) => void)
8600
8781
  | WebpackPluginInstance
8601
8782
  | "..."
@@ -8683,7 +8864,7 @@ declare interface OptimizationSplitChunksCacheGroup {
8683
8864
  /**
8684
8865
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
8685
8866
  */
8686
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8867
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8687
8868
 
8688
8869
  /**
8689
8870
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -8810,7 +8991,7 @@ declare interface OptimizationSplitChunksOptions {
8810
8991
  /**
8811
8992
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8812
8993
  */
8813
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8994
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8814
8995
 
8815
8996
  /**
8816
8997
  * Sets the size types which are used when a number is used for sizes.
@@ -8833,7 +9014,7 @@ declare interface OptimizationSplitChunksOptions {
8833
9014
  /**
8834
9015
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8835
9016
  */
8836
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9017
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8837
9018
  /**
8838
9019
  * Maximal size hint for the on-demand chunks.
8839
9020
  */
@@ -9670,6 +9851,11 @@ declare interface PitchLoaderDefinitionFunction<
9670
9851
  ): string | void | Buffer | Promise<string | Buffer>;
9671
9852
  }
9672
9853
  type Plugin =
9854
+ | undefined
9855
+ | null
9856
+ | false
9857
+ | ""
9858
+ | 0
9673
9859
  | { apply: (arg0: Resolver) => void }
9674
9860
  | ((this: Resolver, arg1: Resolver) => void);
9675
9861
  declare interface PnpApiImpl {
@@ -9760,7 +9946,7 @@ declare class ProgressPlugin {
9760
9946
  apply(compiler: Compiler | MultiCompiler): void;
9761
9947
  static getReporter(
9762
9948
  compiler: Compiler
9763
- ): (p: number, ...args: string[]) => void;
9949
+ ): undefined | ((p: number, ...args: string[]) => void);
9764
9950
  static defaultOptions: {
9765
9951
  profile: boolean;
9766
9952
  modulesCount: number;
@@ -9770,6 +9956,10 @@ declare class ProgressPlugin {
9770
9956
  activeModules: boolean;
9771
9957
  entries: boolean;
9772
9958
  };
9959
+ static createDefaultHandler: (
9960
+ profile: undefined | null | boolean,
9961
+ logger: WebpackLogger
9962
+ ) => (percentage: number, msg: string, ...args: string[]) => void;
9773
9963
  }
9774
9964
  type ProgressPluginArgument =
9775
9965
  | ProgressPluginOptions
@@ -9888,6 +10078,7 @@ declare interface ProvidesObject {
9888
10078
  declare interface RawChunkGroupOptions {
9889
10079
  preloadOrder?: number;
9890
10080
  prefetchOrder?: number;
10081
+ fetchPriority?: "auto" | "low" | "high";
9891
10082
  }
9892
10083
  type RawLoaderDefinition<
9893
10084
  OptionsType = {},
@@ -10394,7 +10585,15 @@ declare interface ResolveOptionsWebpackOptions {
10394
10585
  /**
10395
10586
  * Plugins for the resolver.
10396
10587
  */
10397
- plugins?: (ResolvePluginInstance | "...")[];
10588
+ plugins?: (
10589
+ | undefined
10590
+ | null
10591
+ | false
10592
+ | ""
10593
+ | 0
10594
+ | ResolvePluginInstance
10595
+ | "..."
10596
+ )[];
10398
10597
 
10399
10598
  /**
10400
10599
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -10734,7 +10933,7 @@ declare interface RuleSetRule {
10734
10933
  /**
10735
10934
  * Only execute the first matching rule in this array.
10736
10935
  */
10737
- oneOf?: RuleSetRule[];
10936
+ oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10738
10937
 
10739
10938
  /**
10740
10939
  * Shortcut for use.options.
@@ -10794,7 +10993,7 @@ declare interface RuleSetRule {
10794
10993
  /**
10795
10994
  * Match and execute these rules when this rule is matched.
10796
10995
  */
10797
- rules?: RuleSetRule[];
10996
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10798
10997
 
10799
10998
  /**
10800
10999
  * Match module scheme.
@@ -10831,14 +11030,52 @@ declare interface RuleSetRule {
10831
11030
  */
10832
11031
  use?:
10833
11032
  | string
10834
- | RuleSetUseItem[]
11033
+ | (
11034
+ | undefined
11035
+ | null
11036
+ | string
11037
+ | false
11038
+ | 0
11039
+ | {
11040
+ /**
11041
+ * Unique loader options identifier.
11042
+ */
11043
+ ident?: string;
11044
+ /**
11045
+ * Loader name.
11046
+ */
11047
+ loader?: string;
11048
+ /**
11049
+ * Loader options.
11050
+ */
11051
+ options?: string | { [index: string]: any };
11052
+ }
11053
+ | ((data: object) =>
11054
+ | string
11055
+ | {
11056
+ /**
11057
+ * Unique loader options identifier.
11058
+ */
11059
+ ident?: string;
11060
+ /**
11061
+ * Loader name.
11062
+ */
11063
+ loader?: string;
11064
+ /**
11065
+ * Loader options.
11066
+ */
11067
+ options?: string | { [index: string]: any };
11068
+ }
11069
+ | __TypeWebpackOptions
11070
+ | __Type_2[])
11071
+ )[]
10835
11072
  | ((data: {
10836
11073
  resource: string;
10837
11074
  realResource: string;
10838
11075
  resourceQuery: string;
10839
11076
  issuer: string;
10840
11077
  compiler: string;
10841
- }) => RuleSetUseItem[])
11078
+ }) => __Type_2[])
10842
11079
  | {
10843
11080
  /**
10844
11081
  * Unique loader options identifier.
@@ -10853,35 +11090,56 @@ declare interface RuleSetRule {
10853
11090
  */
10854
11091
  options?: string | { [index: string]: any };
10855
11092
  }
10856
- | ((data: object) =>
10857
- | string
10858
- | {
10859
- /**
10860
- * Unique loader options identifier.
10861
- */
10862
- ident?: string;
10863
- /**
10864
- * Loader name.
10865
- */
10866
- loader?: string;
10867
- /**
10868
- * Loader options.
10869
- */
10870
- options?: string | { [index: string]: any };
10871
- }
10872
- | __TypeWebpackOptions
10873
- | RuleSetUseItem[]);
11093
+ | __TypeWebpackOptions;
10874
11094
  }
10875
11095
  type RuleSetUse =
10876
11096
  | string
10877
- | RuleSetUseItem[]
11097
+ | (
11098
+ | undefined
11099
+ | null
11100
+ | string
11101
+ | false
11102
+ | 0
11103
+ | {
11104
+ /**
11105
+ * Unique loader options identifier.
11106
+ */
11107
+ ident?: string;
11108
+ /**
11109
+ * Loader name.
11110
+ */
11111
+ loader?: string;
11112
+ /**
11113
+ * Loader options.
11114
+ */
11115
+ options?: string | { [index: string]: any };
11116
+ }
11117
+ | ((data: object) =>
11118
+ | string
11119
+ | {
11120
+ /**
11121
+ * Unique loader options identifier.
11122
+ */
11123
+ ident?: string;
11124
+ /**
11125
+ * Loader name.
11126
+ */
11127
+ loader?: string;
11128
+ /**
11129
+ * Loader options.
11130
+ */
11131
+ options?: string | { [index: string]: any };
11132
+ }
11133
+ | __TypeWebpackOptions
11134
+ | __Type_2[])
11135
+ )[]
10878
11136
  | ((data: {
10879
11137
  resource: string;
10880
11138
  realResource: string;
10881
11139
  resourceQuery: string;
10882
11140
  issuer: string;
10883
11141
  compiler: string;
10884
- }) => RuleSetUseItem[])
11142
+ }) => __Type_2[])
10885
11143
  | {
10886
11144
  /**
10887
11145
  * Unique loader options identifier.
@@ -10934,8 +11192,8 @@ declare class RuntimeModule extends Module {
10934
11192
  fullHash: boolean;
10935
11193
  dependentHash: boolean;
10936
11194
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
10937
- generate(): string;
10938
- getGeneratedCode(): string;
11195
+ generate(): null | string;
11196
+ getGeneratedCode(): null | string;
10939
11197
  shouldIsolate(): boolean;
10940
11198
 
10941
11199
  /**
@@ -10972,20 +11230,20 @@ declare interface RuntimeRequirementsContext {
10972
11230
  type RuntimeSpec = undefined | string | SortableSet<string>;
10973
11231
  declare class RuntimeSpecMap<T> {
10974
11232
  constructor(clone?: RuntimeSpecMap<T>);
10975
- get(runtime: RuntimeSpec): T;
11233
+ get(runtime: RuntimeSpec): undefined | T;
10976
11234
  has(runtime: RuntimeSpec): boolean;
10977
- set(runtime?: any, value?: any): void;
10978
- provide(runtime?: any, computer?: any): any;
10979
- delete(runtime?: any): void;
10980
- update(runtime?: any, fn?: any): void;
11235
+ set(runtime: RuntimeSpec, value: T): void;
11236
+ provide(runtime: RuntimeSpec, computer: () => any): any;
11237
+ delete(runtime: RuntimeSpec): void;
11238
+ update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
10981
11239
  keys(): RuntimeSpec[];
10982
11240
  values(): IterableIterator<T>;
10983
11241
  get size(): number;
10984
11242
  }
10985
11243
  declare class RuntimeSpecSet {
10986
- constructor(iterable?: any);
10987
- add(runtime?: any): void;
10988
- has(runtime?: any): boolean;
11244
+ constructor(iterable?: Iterable<RuntimeSpec>);
11245
+ add(runtime: RuntimeSpec): void;
11246
+ has(runtime: RuntimeSpec): boolean;
10989
11247
  get size(): number;
10990
11248
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
10991
11249
  }
@@ -11115,7 +11373,7 @@ declare abstract class RuntimeTemplate {
11115
11373
  /**
11116
11374
  * the module
11117
11375
  */
11118
- module: Module;
11376
+ module: null | Module;
11119
11377
  /**
11120
11378
  * the chunk graph
11121
11379
  */
@@ -11137,7 +11395,7 @@ declare abstract class RuntimeTemplate {
11137
11395
  /**
11138
11396
  * the module
11139
11397
  */
11140
- module: Module;
11398
+ module: null | Module;
11141
11399
  /**
11142
11400
  * the chunk graph
11143
11401
  */
@@ -11436,9 +11694,10 @@ declare interface ScopeInfo {
11436
11694
  definitions: StackedMap<string, ScopeInfo | VariableInfo>;
11437
11695
  topLevelScope: boolean | "arrow";
11438
11696
  inShorthand: string | boolean;
11697
+ inTaggedTemplateTag: boolean;
11698
+ inTry: boolean;
11439
11699
  isStrict: boolean;
11440
11700
  isAsmJs: boolean;
11441
- inTry: boolean;
11442
11701
  }
11443
11702
  declare interface Selector<A, B> {
11444
11703
  (input: A): B;
@@ -11543,10 +11802,10 @@ declare class SideEffectsFlagPlugin {
11543
11802
  */
11544
11803
  apply(compiler: Compiler): void;
11545
11804
  static moduleHasSideEffects(
11546
- moduleName?: any,
11547
- flagValue?: any,
11548
- cache?: any
11549
- ): any;
11805
+ moduleName: string,
11806
+ flagValue: undefined | string | boolean | string[],
11807
+ cache: Map<string, RegExp>
11808
+ ): undefined | boolean;
11550
11809
  }
11551
11810
  declare class SizeOnlySource extends Source {
11552
11811
  constructor(size: number);
@@ -11599,11 +11858,22 @@ declare abstract class Snapshot {
11599
11858
  getContextIterable(): Iterable<string>;
11600
11859
  getMissingIterable(): Iterable<string>;
11601
11860
  }
11861
+ declare interface SnapshotOptionsFileSystemInfo {
11862
+ /**
11863
+ * should use hash to snapshot
11864
+ */
11865
+ hash?: boolean;
11866
+
11867
+ /**
11868
+ * should use timestamp to snapshot
11869
+ */
11870
+ timestamp?: boolean;
11871
+ }
11602
11872
 
11603
11873
  /**
11604
11874
  * Options affecting how file system snapshots are created and validated.
11605
11875
  */
11606
- declare interface SnapshotOptions {
11876
+ declare interface SnapshotOptionsWebpackOptions {
11607
11877
  /**
11608
11878
  * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
11609
11879
  */
@@ -11829,7 +12099,7 @@ declare interface SourcePosition {
11829
12099
  column?: number;
11830
12100
  }
11831
12101
  declare interface SplitChunksOptions {
11832
- chunksFilter: (chunk: Chunk) => boolean;
12102
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
11833
12103
  defaultSizeTypes: string[];
11834
12104
  minSize: SplitChunksSizes;
11835
12105
  minSizeReduction: SplitChunksSizes;
@@ -12706,7 +12976,7 @@ declare interface UserResolveOptions {
12706
12976
  }
12707
12977
  declare abstract class VariableInfo {
12708
12978
  declaredScope: ScopeInfo;
12709
- freeName: string | true;
12979
+ freeName?: string | true;
12710
12980
  tagInfo?: TagInfo;
12711
12981
  }
12712
12982
  declare interface VariableInfoInterface {
@@ -12934,12 +13204,12 @@ declare class WebpackError extends Error {
12934
13204
  * Creates an instance of WebpackError.
12935
13205
  */
12936
13206
  constructor(message?: string);
12937
- details: any;
12938
- module: Module;
12939
- loc: DependencyLocation;
12940
- hideStack: boolean;
12941
- chunk: Chunk;
12942
- file: string;
13207
+ details?: string;
13208
+ module?: null | Module;
13209
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
13210
+ hideStack?: boolean;
13211
+ chunk?: Chunk;
13212
+ file?: string;
12943
13213
  serialize(__0: ObjectSerializerContext): void;
12944
13214
  deserialize(__0: ObjectDeserializerContext): void;
12945
13215
 
@@ -12987,7 +13257,7 @@ declare class WebpackOptionsApply extends OptionsApply {
12987
13257
  }
12988
13258
  declare class WebpackOptionsDefaulter {
12989
13259
  constructor();
12990
- process(options?: any): any;
13260
+ process(options: Configuration): WebpackOptionsNormalized;
12991
13261
  }
12992
13262
 
12993
13263
  /**
@@ -13111,7 +13381,7 @@ declare interface WebpackOptionsNormalized {
13111
13381
  /**
13112
13382
  * Include polyfills or mocks for various node stuff.
13113
13383
  */
13114
- node: NodeWebpackOptions;
13384
+ node: Node;
13115
13385
 
13116
13386
  /**
13117
13387
  * Enables/Disables integrated optimizations.
@@ -13137,6 +13407,11 @@ declare interface WebpackOptionsNormalized {
13137
13407
  * Add additional plugins to the compiler.
13138
13408
  */
13139
13409
  plugins: (
13410
+ | undefined
13411
+ | null
13412
+ | false
13413
+ | ""
13414
+ | 0
13140
13415
  | ((this: Compiler, compiler: Compiler) => void)
13141
13416
  | WebpackPluginInstance
13142
13417
  )[];
@@ -13169,7 +13444,7 @@ declare interface WebpackOptionsNormalized {
13169
13444
  /**
13170
13445
  * Options affecting how file system snapshots are created and validated.
13171
13446
  */
13172
- snapshot: SnapshotOptions;
13447
+ snapshot: SnapshotOptionsWebpackOptions;
13173
13448
 
13174
13449
  /**
13175
13450
  * Stats options object or preset name.
@@ -13234,7 +13509,45 @@ type __TypeWebpackOptions = (data: object) =>
13234
13509
  options?: string | { [index: string]: any };
13235
13510
  }
13236
13511
  | __TypeWebpackOptions
13237
- | RuleSetUseItem[];
13512
+ | __Type_2[];
13513
+ type __Type_2 =
13514
+ | undefined
13515
+ | null
13516
+ | string
13517
+ | false
13518
+ | 0
13519
+ | {
13520
+ /**
13521
+ * Unique loader options identifier.
13522
+ */
13523
+ ident?: string;
13524
+ /**
13525
+ * Loader name.
13526
+ */
13527
+ loader?: string;
13528
+ /**
13529
+ * Loader options.
13530
+ */
13531
+ options?: string | { [index: string]: any };
13532
+ }
13533
+ | ((data: object) =>
13534
+ | string
13535
+ | {
13536
+ /**
13537
+ * Unique loader options identifier.
13538
+ */
13539
+ ident?: string;
13540
+ /**
13541
+ * Loader name.
13542
+ */
13543
+ loader?: string;
13544
+ /**
13545
+ * Loader options.
13546
+ */
13547
+ options?: string | { [index: string]: any };
13548
+ }
13549
+ | __TypeWebpackOptions
13550
+ | __Type_2[]);
13238
13551
  declare function exports(
13239
13552
  options: Configuration,
13240
13553
  callback?: CallbackWebpack<Stats>
@@ -13362,6 +13675,7 @@ declare namespace exports {
13362
13675
  export let createScript: "__webpack_require__.ts";
13363
13676
  export let createScriptUrl: "__webpack_require__.tu";
13364
13677
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
13678
+ export let hasFetchPriority: "has fetch priority";
13365
13679
  export let chunkName: "__webpack_require__.cn";
13366
13680
  export let runtimeId: "__webpack_require__.j";
13367
13681
  export let getChunkScriptFilename: "__webpack_require__.u";
@@ -13465,7 +13779,7 @@ declare namespace exports {
13465
13779
  ) => void;
13466
13780
  export let setTopLevelSymbol: (
13467
13781
  state: ParserState,
13468
- symbol: TopLevelSymbol
13782
+ symbol?: TopLevelSymbol
13469
13783
  ) => void;
13470
13784
  export let getTopLevelSymbol: (
13471
13785
  state: ParserState
@@ -13473,7 +13787,7 @@ declare namespace exports {
13473
13787
  export let tagTopLevelSymbol: (
13474
13788
  parser: JavascriptParser,
13475
13789
  name: string
13476
- ) => TopLevelSymbol;
13790
+ ) => undefined | TopLevelSymbol;
13477
13791
  export let isDependencyUsedByExports: (
13478
13792
  dependency: Dependency,
13479
13793
  usedByExports: boolean | Set<string>,
@@ -13482,7 +13796,7 @@ declare namespace exports {
13482
13796
  ) => boolean;
13483
13797
  export let getDependencyUsedByExportsCondition: (
13484
13798
  dependency: Dependency,
13485
- usedByExports: boolean | Set<string>,
13799
+ usedByExports: undefined | boolean | Set<string>,
13486
13800
  moduleGraph: ModuleGraph
13487
13801
  ) =>
13488
13802
  | null
@@ -13623,7 +13937,7 @@ declare namespace exports {
13623
13937
  ) => RuntimeSpec;
13624
13938
  export let forEachRuntime: (
13625
13939
  runtime: RuntimeSpec,
13626
- fn: (arg0: string) => void,
13940
+ fn: (arg0?: string) => void,
13627
13941
  deterministicOrder?: boolean
13628
13942
  ) => void;
13629
13943
  export let getRuntimeKey: (runtime: RuntimeSpec) => string;
@@ -13672,7 +13986,7 @@ declare namespace exports {
13672
13986
  export const register: (
13673
13987
  Constructor: Constructor,
13674
13988
  request: string,
13675
- name: string,
13989
+ name: null | string,
13676
13990
  serializer: ObjectSerializer
13677
13991
  ) => void;
13678
13992
  export const registerLoader: (