webpack 5.85.1 → 5.87.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.

Potentially problematic release.


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

Files changed (140) hide show
  1. package/README.md +5 -2
  2. package/lib/APIPlugin.js +150 -99
  3. package/lib/CaseSensitiveModulesWarning.js +3 -1
  4. package/lib/Chunk.js +35 -17
  5. package/lib/ChunkGroup.js +11 -6
  6. package/lib/Compiler.js +4 -3
  7. package/lib/ConcatenationScope.js +2 -2
  8. package/lib/ConditionalInitFragment.js +11 -1
  9. package/lib/ConstPlugin.js +57 -29
  10. package/lib/ContextModule.js +4 -2
  11. package/lib/ContextModuleFactory.js +1 -0
  12. package/lib/DependenciesBlock.js +1 -1
  13. package/lib/DllModule.js +6 -0
  14. package/lib/EvalSourceMapDevToolPlugin.js +2 -1
  15. package/lib/ExternalModule.js +15 -8
  16. package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
  17. package/lib/Module.js +7 -1
  18. package/lib/ModuleDependencyError.js +4 -2
  19. package/lib/ModuleDependencyWarning.js +4 -2
  20. package/lib/ModuleGraph.js +31 -24
  21. package/lib/ModuleGraphConnection.js +19 -6
  22. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  23. package/lib/ModuleNotFoundError.js +5 -2
  24. package/lib/ModuleStoreError.js +2 -1
  25. package/lib/ModuleTypeConstants.js +7 -0
  26. package/lib/MultiWatching.js +4 -0
  27. package/lib/ProgressPlugin.js +71 -15
  28. package/lib/RuntimeGlobals.js +5 -0
  29. package/lib/RuntimePlugin.js +2 -1
  30. package/lib/RuntimeTemplate.js +20 -2
  31. package/lib/WebpackError.js +6 -5
  32. package/lib/WebpackOptionsApply.js +4 -2
  33. package/lib/WebpackOptionsDefaulter.js +10 -3
  34. package/lib/config/defaults.js +31 -2
  35. package/lib/css/CssExportsGenerator.js +9 -0
  36. package/lib/css/CssGenerator.js +1 -1
  37. package/lib/css/CssLoadingRuntimeModule.js +13 -6
  38. package/lib/css/CssModulesPlugin.js +42 -14
  39. package/lib/css/CssParser.js +12 -0
  40. package/lib/dependencies/ConstDependency.js +2 -2
  41. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
  42. package/lib/dependencies/ImportParserPlugin.js +25 -1
  43. package/lib/dependencies/JsonExportsDependency.js +1 -1
  44. package/lib/ids/SyncModuleIdsPlugin.js +1 -0
  45. package/lib/javascript/BasicEvaluatedExpression.js +23 -15
  46. package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
  47. package/lib/javascript/JavascriptModulesPlugin.js +1 -0
  48. package/lib/javascript/JavascriptParser.js +118 -58
  49. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  50. package/lib/json/JsonData.js +2 -2
  51. package/lib/json/JsonParser.js +25 -12
  52. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -1
  53. package/lib/optimize/AggressiveMergingPlugin.js +8 -0
  54. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  55. package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
  56. package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
  57. package/lib/optimize/InnerGraph.js +4 -4
  58. package/lib/optimize/LimitChunkCountPlugin.js +29 -4
  59. package/lib/optimize/MangleExportsPlugin.js +1 -1
  60. package/lib/optimize/MinMaxSizeWarning.js +5 -0
  61. package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
  62. package/lib/optimize/RealContentHashPlugin.js +80 -30
  63. package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
  64. package/lib/optimize/RuntimeChunkPlugin.js +9 -1
  65. package/lib/optimize/SideEffectsFlagPlugin.js +10 -1
  66. package/lib/optimize/SplitChunksPlugin.js +71 -31
  67. package/lib/performance/SizeLimitsPlugin.js +7 -4
  68. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +3 -1
  69. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  70. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +5 -2
  71. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +3 -1
  72. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +3 -1
  73. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  74. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  75. package/lib/rules/RuleSetCompiler.js +3 -3
  76. package/lib/rules/UseEffectRulePlugin.js +6 -4
  77. package/lib/runtime/AsyncModuleRuntimeModule.js +4 -1
  78. package/lib/runtime/AutoPublicPathRuntimeModule.js +3 -1
  79. package/lib/runtime/BaseUriRuntimeModule.js +2 -2
  80. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +4 -1
  81. package/lib/runtime/CompatRuntimeModule.js +6 -1
  82. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +4 -1
  83. package/lib/runtime/CreateScriptRuntimeModule.js +3 -1
  84. package/lib/runtime/CreateScriptUrlRuntimeModule.js +3 -1
  85. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +4 -1
  86. package/lib/runtime/EnsureChunkRuntimeModule.js +14 -3
  87. package/lib/runtime/GetChunkFilenameRuntimeModule.js +5 -9
  88. package/lib/runtime/GetFullHashRuntimeModule.js +3 -2
  89. package/lib/runtime/GetMainFilenameRuntimeModule.js +4 -1
  90. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +3 -1
  91. package/lib/runtime/HasOwnPropertyRuntimeModule.js +4 -1
  92. package/lib/runtime/LoadScriptRuntimeModule.js +63 -47
  93. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +4 -1
  94. package/lib/runtime/OnChunksLoadedRuntimeModule.js +3 -1
  95. package/lib/runtime/PublicPathRuntimeModule.js +3 -1
  96. package/lib/runtime/RelativeUrlRuntimeModule.js +4 -1
  97. package/lib/runtime/RuntimeIdRuntimeModule.js +5 -1
  98. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +8 -2
  99. package/lib/runtime/StartupEntrypointRuntimeModule.js +2 -1
  100. package/lib/serialization/BinaryMiddleware.js +143 -1
  101. package/lib/serialization/ErrorObjectSerializer.js +3 -0
  102. package/lib/serialization/ObjectMiddleware.js +9 -3
  103. package/lib/serialization/types.js +1 -1
  104. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  105. package/lib/sharing/ConsumeSharedRuntimeModule.js +13 -4
  106. package/lib/sharing/ProvideSharedDependency.js +11 -0
  107. package/lib/sharing/ProvideSharedModule.js +4 -0
  108. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  109. package/lib/sharing/ShareRuntimeModule.js +11 -4
  110. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  111. package/lib/sharing/utils.js +32 -5
  112. package/lib/util/AsyncQueue.js +4 -2
  113. package/lib/util/ParallelismFactorCalculator.js +10 -0
  114. package/lib/util/Semaphore.js +1 -1
  115. package/lib/util/createHash.js +30 -9
  116. package/lib/util/deprecation.js +10 -3
  117. package/lib/util/deterministicGrouping.js +50 -11
  118. package/lib/util/findGraphRoots.js +4 -2
  119. package/lib/util/memoize.js +3 -3
  120. package/lib/util/processAsyncTree.js +7 -1
  121. package/lib/util/registerExternalSerializer.js +1 -1
  122. package/lib/util/runtime.js +14 -1
  123. package/lib/util/smartGrouping.js +1 -1
  124. package/lib/validateSchema.js +6 -2
  125. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
  126. package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
  127. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -6
  128. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
  129. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
  130. package/lib/wasm-sync/WebAssemblyParser.js +6 -2
  131. package/lib/web/JsonpChunkLoadingRuntimeModule.js +13 -3
  132. package/lib/webpack.js +11 -2
  133. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +14 -15
  134. package/module.d.ts +1 -0
  135. package/package.json +4 -4
  136. package/schemas/WebpackOptions.check.js +1 -1
  137. package/schemas/WebpackOptions.json +51 -5
  138. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  139. package/schemas/plugins/css/CssParserOptions.json +1 -1
  140. package/types.d.ts +476 -218
package/types.d.ts CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  ConditionalExpression,
28
28
  ContinueStatement,
29
29
  DebuggerStatement,
30
+ Directive,
30
31
  DoWhileStatement,
31
32
  EmptyStatement,
32
33
  ExportAllDeclaration,
@@ -167,14 +168,20 @@ declare interface AdditionalData {
167
168
  webpackAST: object;
168
169
  }
169
170
  declare class AggressiveMergingPlugin {
170
- constructor(options?: any);
171
- options: any;
171
+ constructor(options?: AggressiveMergingPluginOptions);
172
+ options: AggressiveMergingPluginOptions;
172
173
 
173
174
  /**
174
175
  * Apply the plugin
175
176
  */
176
177
  apply(compiler: Compiler): void;
177
178
  }
179
+ declare interface AggressiveMergingPluginOptions {
180
+ /**
181
+ * minimal size reduction to trigger merging
182
+ */
183
+ minSizeReduce?: number;
184
+ }
178
185
  declare class AggressiveSplittingPlugin {
179
186
  constructor(options?: AggressiveSplittingPluginOptions);
180
187
  options: AggressiveSplittingPluginOptions;
@@ -485,7 +492,7 @@ declare interface BaseResolveRequest {
485
492
  }
486
493
  declare abstract class BasicEvaluatedExpression {
487
494
  type: number;
488
- range: [number, number];
495
+ range?: [number, number];
489
496
  falsy: boolean;
490
497
  truthy: boolean;
491
498
  nullish?: boolean;
@@ -500,15 +507,89 @@ declare abstract class BasicEvaluatedExpression {
500
507
  array?: any[];
501
508
  items?: BasicEvaluatedExpression[];
502
509
  options?: BasicEvaluatedExpression[];
503
- prefix?: BasicEvaluatedExpression;
504
- postfix?: BasicEvaluatedExpression;
505
- wrappedInnerExpressions: BasicEvaluatedExpression[];
510
+ prefix?: null | BasicEvaluatedExpression;
511
+ postfix?: null | BasicEvaluatedExpression;
512
+ wrappedInnerExpressions?: BasicEvaluatedExpression[];
506
513
  identifier?: string | VariableInfoInterface;
507
- rootInfo: string | VariableInfoInterface;
508
- getMembers: () => string[];
509
- getMembersOptionals: () => boolean[];
510
- getMemberRanges: () => [number, number][];
511
- expression: NodeEstreeIndex;
514
+ rootInfo?: string | VariableInfoInterface;
515
+ getMembers?: () => string[];
516
+ getMembersOptionals?: () => boolean[];
517
+ getMemberRanges?: () => [number, number][];
518
+ expression?:
519
+ | UnaryExpression
520
+ | ArrayExpression
521
+ | ArrowFunctionExpression
522
+ | AssignmentExpression
523
+ | AwaitExpression
524
+ | BinaryExpression
525
+ | SimpleCallExpression
526
+ | NewExpression
527
+ | ChainExpression
528
+ | ClassExpression
529
+ | ConditionalExpression
530
+ | FunctionExpression
531
+ | Identifier
532
+ | ImportExpression
533
+ | SimpleLiteral
534
+ | RegExpLiteral
535
+ | BigIntLiteral
536
+ | LogicalExpression
537
+ | MemberExpression
538
+ | MetaProperty
539
+ | ObjectExpression
540
+ | SequenceExpression
541
+ | TaggedTemplateExpression
542
+ | TemplateLiteral
543
+ | ThisExpression
544
+ | UpdateExpression
545
+ | YieldExpression
546
+ | FunctionDeclaration
547
+ | VariableDeclaration
548
+ | ClassDeclaration
549
+ | PrivateIdentifier
550
+ | ExpressionStatement
551
+ | BlockStatement
552
+ | StaticBlock
553
+ | EmptyStatement
554
+ | DebuggerStatement
555
+ | WithStatement
556
+ | ReturnStatement
557
+ | LabeledStatement
558
+ | BreakStatement
559
+ | ContinueStatement
560
+ | IfStatement
561
+ | SwitchStatement
562
+ | ThrowStatement
563
+ | TryStatement
564
+ | WhileStatement
565
+ | DoWhileStatement
566
+ | ForStatement
567
+ | ForInStatement
568
+ | ForOfStatement
569
+ | ImportDeclaration
570
+ | ExportNamedDeclaration
571
+ | ExportDefaultDeclaration
572
+ | ExportAllDeclaration
573
+ | MethodDefinition
574
+ | PropertyDefinition
575
+ | VariableDeclarator
576
+ | Program
577
+ | SwitchCase
578
+ | CatchClause
579
+ | ObjectPattern
580
+ | ArrayPattern
581
+ | RestElement
582
+ | AssignmentPattern
583
+ | SpreadElement
584
+ | Property
585
+ | AssignmentProperty
586
+ | ClassBody
587
+ | ImportSpecifier
588
+ | ImportDefaultSpecifier
589
+ | ImportNamespaceSpecifier
590
+ | ExportSpecifier
591
+ | Super
592
+ | TemplateElement;
512
593
  isUnknown(): boolean;
513
594
  isNull(): boolean;
514
595
  isUndefined(): boolean;
@@ -561,7 +642,7 @@ declare abstract class BasicEvaluatedExpression {
561
642
  * Creates a string representation of this evaluated expression.
562
643
  */
563
644
  asString(): undefined | string;
564
- setString(string?: any): BasicEvaluatedExpression;
645
+ setString(string: string): BasicEvaluatedExpression;
565
646
  setUndefined(): BasicEvaluatedExpression;
566
647
  setNull(): BasicEvaluatedExpression;
567
648
 
@@ -600,8 +681,8 @@ declare abstract class BasicEvaluatedExpression {
600
681
  * Wraps an array of expressions with a prefix and postfix expression.
601
682
  */
602
683
  setWrapped(
603
- prefix: null | BasicEvaluatedExpression,
604
- postfix: BasicEvaluatedExpression,
684
+ prefix: undefined | null | BasicEvaluatedExpression,
685
+ postfix: undefined | null | BasicEvaluatedExpression,
605
686
  innerExpressions: BasicEvaluatedExpression[]
606
687
  ): BasicEvaluatedExpression;
607
688
 
@@ -656,7 +737,86 @@ declare abstract class BasicEvaluatedExpression {
656
737
  /**
657
738
  * Set the expression node for the expression.
658
739
  */
659
- setExpression(expression: NodeEstreeIndex): BasicEvaluatedExpression;
740
+ setExpression(
741
+ expression?:
742
+ | UnaryExpression
743
+ | ArrayExpression
744
+ | ArrowFunctionExpression
745
+ | AssignmentExpression
746
+ | AwaitExpression
747
+ | BinaryExpression
748
+ | SimpleCallExpression
749
+ | NewExpression
750
+ | ChainExpression
751
+ | ClassExpression
752
+ | ConditionalExpression
753
+ | FunctionExpression
754
+ | Identifier
755
+ | ImportExpression
756
+ | SimpleLiteral
757
+ | RegExpLiteral
758
+ | BigIntLiteral
759
+ | LogicalExpression
760
+ | MemberExpression
761
+ | MetaProperty
762
+ | ObjectExpression
763
+ | SequenceExpression
764
+ | TaggedTemplateExpression
765
+ | TemplateLiteral
766
+ | ThisExpression
767
+ | UpdateExpression
768
+ | YieldExpression
769
+ | FunctionDeclaration
770
+ | VariableDeclaration
771
+ | ClassDeclaration
772
+ | PrivateIdentifier
773
+ | ExpressionStatement
774
+ | BlockStatement
775
+ | StaticBlock
776
+ | EmptyStatement
777
+ | DebuggerStatement
778
+ | WithStatement
779
+ | ReturnStatement
780
+ | LabeledStatement
781
+ | BreakStatement
782
+ | ContinueStatement
783
+ | IfStatement
784
+ | SwitchStatement
785
+ | ThrowStatement
786
+ | TryStatement
787
+ | WhileStatement
788
+ | DoWhileStatement
789
+ | ForStatement
790
+ | ForInStatement
791
+ | ForOfStatement
792
+ | ImportDeclaration
793
+ | ExportNamedDeclaration
794
+ | ExportDefaultDeclaration
795
+ | ExportAllDeclaration
796
+ | MethodDefinition
797
+ | PropertyDefinition
798
+ | VariableDeclarator
799
+ | Program
800
+ | SwitchCase
801
+ | CatchClause
802
+ | ObjectPattern
803
+ | ArrayPattern
804
+ | RestElement
805
+ | AssignmentPattern
806
+ | SpreadElement
807
+ | Property
808
+ | AssignmentProperty
809
+ | ClassBody
810
+ | ImportSpecifier
811
+ | ImportDefaultSpecifier
812
+ | ImportNamespaceSpecifier
813
+ | ExportSpecifier
814
+ | Super
815
+ | TemplateElement
816
+ ): BasicEvaluatedExpression;
817
+ }
818
+ declare interface BuildInfo {
819
+ [index: string]: any;
660
820
  }
661
821
  type BuildMeta = KnownBuildMeta & Record<string, any>;
662
822
  declare abstract class ByTypeGenerator extends Generator {
@@ -749,7 +909,7 @@ declare interface CacheGroupSource {
749
909
  chunks?: Chunk[],
750
910
  key?: string
751
911
  ) => undefined | string;
752
- chunksFilter?: (chunk: Chunk) => boolean;
912
+ chunksFilter?: (chunk: Chunk) => undefined | boolean;
753
913
  enforce?: boolean;
754
914
  minSize: SplitChunksSizes;
755
915
  minSizeReduction: SplitChunksSizes;
@@ -762,7 +922,7 @@ declare interface CacheGroupSource {
762
922
  maxInitialRequests?: number;
763
923
  filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
764
924
  idHint?: string;
765
- automaticNameDelimiter: string;
925
+ automaticNameDelimiter?: string;
766
926
  reuseExistingChunk?: boolean;
767
927
  usedExports?: boolean;
768
928
  }
@@ -809,19 +969,13 @@ type Cell<T> = undefined | T;
809
969
  declare class Chunk {
810
970
  constructor(name?: string, backCompat?: boolean);
811
971
  id: null | string | number;
812
- ids: null | (string | number)[];
972
+ ids: null | ChunkId[];
813
973
  debugId: number;
814
- name: string;
974
+ name?: string;
815
975
  idNameHints: SortableSet<string>;
816
976
  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);
977
+ filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
978
+ cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
825
979
  runtime: RuntimeSpec;
826
980
  files: Set<string>;
827
981
  auxiliaryFiles: Set<string>;
@@ -878,7 +1032,7 @@ declare class Chunk {
878
1032
  getChildrenOfTypeInOrder(
879
1033
  chunkGraph: ChunkGraph,
880
1034
  type: string
881
- ): { onChunks: Chunk[]; chunks: Set<Chunk> }[];
1035
+ ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
882
1036
  getChildIdsByOrdersMap(
883
1037
  chunkGraph: ChunkGraph,
884
1038
  includeDirectChildren?: boolean,
@@ -1066,7 +1220,7 @@ declare abstract class ChunkGroup {
1066
1220
  options: ChunkGroupOptions;
1067
1221
  chunks: Chunk[];
1068
1222
  origins: OriginRecord[];
1069
- index: number;
1223
+ index?: number;
1070
1224
 
1071
1225
  /**
1072
1226
  * when a new chunk is added to a chunkGroup, addingOptions will occur.
@@ -1147,7 +1301,7 @@ declare abstract class ChunkGroup {
1147
1301
  /**
1148
1302
  * Gets the top-down index of a module in this ChunkGroup
1149
1303
  */
1150
- getModulePreOrderIndex(module: Module): number;
1304
+ getModulePreOrderIndex(module: Module): undefined | number;
1151
1305
 
1152
1306
  /**
1153
1307
  * Sets the bottom-up index of a module in this ChunkGroup
@@ -1157,10 +1311,10 @@ declare abstract class ChunkGroup {
1157
1311
  /**
1158
1312
  * Gets the bottom-up index of a module in this ChunkGroup
1159
1313
  */
1160
- getModulePostOrderIndex(module: Module): number;
1314
+ getModulePostOrderIndex(module: Module): undefined | number;
1161
1315
  checkConstraints(): void;
1162
- getModuleIndex: (module: Module) => number;
1163
- getModuleIndex2: (module: Module) => number;
1316
+ getModuleIndex: (module: Module) => undefined | number;
1317
+ getModuleIndex2: (module: Module) => undefined | number;
1164
1318
  }
1165
1319
  type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
1166
1320
  declare interface ChunkHashContext {
@@ -1184,6 +1338,7 @@ declare interface ChunkHashContext {
1184
1338
  */
1185
1339
  chunkGraph: ChunkGraph;
1186
1340
  }
1341
+ type ChunkId = string | number;
1187
1342
  declare interface ChunkMaps {
1188
1343
  hash: Record<string | number, string>;
1189
1344
  contentHash: Record<string | number, Record<string, string>>;
@@ -2192,7 +2347,7 @@ declare class ConcatenationScope {
2192
2347
  static isModuleReference(name: string): boolean;
2193
2348
  static matchModuleReference(
2194
2349
  name: string
2195
- ): ModuleReferenceOptions & { index: number };
2350
+ ): null | (ModuleReferenceOptions & { index: number });
2196
2351
  static DEFAULT_EXPORT: string;
2197
2352
  static NAMESPACE_OBJECT_EXPORT: string;
2198
2353
  }
@@ -2374,6 +2529,11 @@ declare interface Configuration {
2374
2529
  * Add additional plugins to the compiler.
2375
2530
  */
2376
2531
  plugins?: (
2532
+ | undefined
2533
+ | null
2534
+ | false
2535
+ | ""
2536
+ | 0
2377
2537
  | ((this: Compiler, compiler: Compiler) => void)
2378
2538
  | WebpackPluginInstance
2379
2539
  )[];
@@ -2451,7 +2611,7 @@ declare class ConstDependency extends NullDependency {
2451
2611
  constructor(
2452
2612
  expression: string,
2453
2613
  range: number | [number, number],
2454
- runtimeRequirements?: string[]
2614
+ runtimeRequirements?: null | string[]
2455
2615
  );
2456
2616
  expression: string;
2457
2617
  range: number | [number, number];
@@ -2682,6 +2842,7 @@ declare interface ContextModuleOptions {
2682
2842
  * exports referenced from modules (won't be mangled)
2683
2843
  */
2684
2844
  referencedExports?: string[][];
2845
+ layer?: string;
2685
2846
  resource: string | false | string[];
2686
2847
  resourceQuery?: string;
2687
2848
  resourceFragment?: string;
@@ -2757,7 +2918,7 @@ declare interface DepConstructor {
2757
2918
  declare abstract class DependenciesBlock {
2758
2919
  dependencies: Dependency[];
2759
2920
  blocks: AsyncDependenciesBlock[];
2760
- parent: DependenciesBlock;
2921
+ parent?: DependenciesBlock;
2761
2922
  getRootBlock(): DependenciesBlock;
2762
2923
 
2763
2924
  /**
@@ -4190,7 +4351,7 @@ declare interface FactorizeModuleOptions {
4190
4351
  type FakeHook<T> = T & FakeHookMarker;
4191
4352
  declare interface FakeHookMarker {}
4192
4353
  declare interface FallbackCacheGroup {
4193
- chunksFilter: (chunk: Chunk) => boolean;
4354
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
4194
4355
  minSize: SplitChunksSizes;
4195
4356
  maxAsyncSize: SplitChunksSizes;
4196
4357
  maxInitialSize: SplitChunksSizes;
@@ -5373,8 +5534,14 @@ declare class JavascriptParser extends Parser {
5373
5534
  unhandledExpressionMemberChain: HookMap<
5374
5535
  SyncBailHook<[Expression, string[]], boolean | void>
5375
5536
  >;
5376
- expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
5377
- expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
5537
+ expressionConditionalOperator: SyncBailHook<
5538
+ [ConditionalExpression],
5539
+ boolean | void
5540
+ >;
5541
+ expressionLogicalOperator: SyncBailHook<
5542
+ [LogicalExpression],
5543
+ boolean | void
5544
+ >;
5378
5545
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
5379
5546
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
5380
5547
  }>;
@@ -5438,7 +5605,7 @@ declare class JavascriptParser extends Parser {
5438
5605
  | ExportDefaultDeclaration
5439
5606
  | ExportAllDeclaration
5440
5607
  )[];
5441
- prevStatement:
5608
+ prevStatement?:
5442
5609
  | UnaryExpression
5443
5610
  | ArrayExpression
5444
5611
  | ArrowFunctionExpression
@@ -5827,43 +5994,75 @@ declare class JavascriptParser extends Parser {
5827
5994
  callHooksForExpressionWithFallback<T, R>(
5828
5995
  hookMap: HookMap<SyncBailHook<T, R>>,
5829
5996
  expr: MemberExpression,
5830
- fallback: (
5831
- arg0: string,
5832
- arg1: string | ScopeInfo | VariableInfo,
5833
- arg2: () => string[]
5834
- ) => any,
5835
- defined: (arg0: string) => any,
5997
+ fallback:
5998
+ | undefined
5999
+ | ((
6000
+ arg0: string,
6001
+ arg1: string | ScopeInfo | VariableInfo,
6002
+ arg2: () => string[]
6003
+ ) => any),
6004
+ defined: undefined | ((arg0: string) => any),
5836
6005
  ...args: AsArray<T>
5837
- ): R;
6006
+ ): undefined | R;
5838
6007
  callHooksForName<T, R>(
5839
6008
  hookMap: HookMap<SyncBailHook<T, R>>,
5840
6009
  name: string,
5841
6010
  ...args: AsArray<T>
5842
- ): R;
6011
+ ): undefined | R;
5843
6012
  callHooksForInfo<T, R>(
5844
6013
  hookMap: HookMap<SyncBailHook<T, R>>,
5845
6014
  info: ExportedVariableInfo,
5846
6015
  ...args: AsArray<T>
5847
- ): R;
6016
+ ): undefined | R;
5848
6017
  callHooksForInfoWithFallback<T, R>(
5849
6018
  hookMap: HookMap<SyncBailHook<T, R>>,
5850
6019
  info: ExportedVariableInfo,
5851
- fallback: (arg0: string) => any,
5852
- defined: () => any,
6020
+ fallback: undefined | ((arg0: string) => any),
6021
+ defined: undefined | (() => any),
5853
6022
  ...args: AsArray<T>
5854
- ): R;
6023
+ ): undefined | R;
5855
6024
  callHooksForNameWithFallback<T, R>(
5856
6025
  hookMap: HookMap<SyncBailHook<T, R>>,
5857
6026
  name: string,
5858
- fallback: (arg0: string) => any,
5859
- defined: () => any,
6027
+ fallback: undefined | ((arg0: string) => any),
6028
+ defined: undefined | (() => any),
5860
6029
  ...args: AsArray<T>
5861
- ): R;
6030
+ ): undefined | R;
5862
6031
  inScope(params: any, fn: () => void): void;
5863
- inClassScope(hasThis?: any, params?: any, fn?: any): void;
5864
- inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
5865
- inBlockScope(fn?: any): void;
5866
- detectMode(statements?: any): void;
6032
+ inClassScope(hasThis: boolean, params: any, fn: () => void): void;
6033
+ inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
6034
+ inBlockScope(fn: () => void): void;
6035
+ detectMode(
6036
+ statements: (
6037
+ | FunctionDeclaration
6038
+ | VariableDeclaration
6039
+ | ClassDeclaration
6040
+ | ExpressionStatement
6041
+ | BlockStatement
6042
+ | StaticBlock
6043
+ | EmptyStatement
6044
+ | DebuggerStatement
6045
+ | WithStatement
6046
+ | ReturnStatement
6047
+ | LabeledStatement
6048
+ | BreakStatement
6049
+ | ContinueStatement
6050
+ | IfStatement
6051
+ | SwitchStatement
6052
+ | ThrowStatement
6053
+ | TryStatement
6054
+ | WhileStatement
6055
+ | DoWhileStatement
6056
+ | ForStatement
6057
+ | ForInStatement
6058
+ | ForOfStatement
6059
+ | ImportDeclaration
6060
+ | ExportNamedDeclaration
6061
+ | ExportDefaultDeclaration
6062
+ | ExportAllDeclaration
6063
+ | Directive
6064
+ )[]
6065
+ ): void;
5867
6066
  enterPatterns(patterns?: any, onIdent?: any): void;
5868
6067
  enterPattern(pattern?: any, onIdent?: any): void;
5869
6068
  enterIdentifier(pattern: Identifier, onIdent?: any): void;
@@ -5871,7 +6070,7 @@ declare class JavascriptParser extends Parser {
5871
6070
  enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
5872
6071
  enterRestElement(pattern: RestElement, onIdent?: any): void;
5873
6072
  enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
5874
- evaluateExpression(expression: Expression): BasicEvaluatedExpression;
6073
+ evaluateExpression(expression?: any): BasicEvaluatedExpression;
5875
6074
  parseString(expression: Expression): string;
5876
6075
  parseCalculatedString(expression?: any): any;
5877
6076
  evaluate(source: string): BasicEvaluatedExpression;
@@ -5915,7 +6114,7 @@ declare class JavascriptParser extends Parser {
5915
6114
  getComments(range: [number, number]): any[];
5916
6115
  isAsiPosition(pos: number): boolean;
5917
6116
  unsetAsiPosition(pos: number): void;
5918
- isStatementLevelExpression(expr?: any): boolean;
6117
+ isStatementLevelExpression(expr: Expression): boolean;
5919
6118
  getTagData(name?: any, tag?: any): any;
5920
6119
  tagVariable(name?: any, tag?: any, data?: any): void;
5921
6120
  defineVariable(name: string): void;
@@ -5959,19 +6158,22 @@ declare class JavascriptParser extends Parser {
5959
6158
  membersOptionals: boolean[];
5960
6159
  memberRanges: [number, number][];
5961
6160
  };
5962
- getFreeInfoFromVariable(varName: string): {
5963
- name: string;
5964
- info: string | VariableInfo;
5965
- };
6161
+ getFreeInfoFromVariable(
6162
+ varName: string
6163
+ ): undefined | { name: string; info: string | VariableInfo };
5966
6164
  getMemberExpressionInfo(
5967
6165
  expression: MemberExpression,
5968
6166
  allowedTypes: number
5969
6167
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5970
- getNameForExpression(expression: MemberExpression): {
5971
- name: string;
5972
- rootInfo: ExportedVariableInfo;
5973
- getMembers: () => string[];
5974
- };
6168
+ getNameForExpression(
6169
+ expression: MemberExpression
6170
+ ):
6171
+ | undefined
6172
+ | {
6173
+ name: string;
6174
+ rootInfo: ExportedVariableInfo;
6175
+ getMembers: () => string[];
6176
+ };
5975
6177
  static ALLOWED_MEMBER_TYPES_ALL: 3;
5976
6178
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
5977
6179
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
@@ -6008,6 +6210,11 @@ declare interface JavascriptParserOptions {
6008
6210
  */
6009
6211
  createRequire?: string | boolean;
6010
6212
 
6213
+ /**
6214
+ * Specifies global fetchPriority for dynamic import.
6215
+ */
6216
+ dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6217
+
6011
6218
  /**
6012
6219
  * Specifies global mode for dynamic import.
6013
6220
  */
@@ -6818,7 +7025,7 @@ declare interface LoadScriptCompilationHooks {
6818
7025
  createScript: SyncWaterfallHook<[string, Chunk]>;
6819
7026
  }
6820
7027
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
6821
- constructor(withCreateScriptUrl?: boolean);
7028
+ constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
6822
7029
  static getCompilationHooks(
6823
7030
  compilation: Compilation
6824
7031
  ): LoadScriptCompilationHooks;
@@ -7267,16 +7474,16 @@ declare class Module extends DependenciesBlock {
7267
7474
  useSourceMap: boolean;
7268
7475
  useSimpleSourceMap: boolean;
7269
7476
  buildMeta?: BuildMeta;
7270
- buildInfo?: Record<string, any>;
7477
+ buildInfo?: BuildInfo;
7271
7478
  presentationalDependencies?: Dependency[];
7272
7479
  codeGenerationDependencies?: Dependency[];
7273
7480
  id: string | number;
7274
7481
  get hash(): string;
7275
7482
  get renderedHash(): string;
7276
7483
  profile: null | ModuleProfile;
7277
- index: number;
7278
- index2: number;
7279
- depth: number;
7484
+ index: null | number;
7485
+ index2: null | number;
7486
+ depth: null | number;
7280
7487
  issuer: null | Module;
7281
7488
  get usedExports(): null | boolean | SortableSet<string>;
7282
7489
  get optimizationBailout(): (
@@ -7560,11 +7767,11 @@ declare class ModuleGraph {
7560
7767
  filterConnection: (arg0: ModuleGraphConnection) => boolean
7561
7768
  ): void;
7562
7769
  addExtraReason(module: Module, explanation: string): void;
7563
- getResolvedModule(dependency: Dependency): Module;
7770
+ getResolvedModule(dependency: Dependency): null | Module;
7564
7771
  getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
7565
- getModule(dependency: Dependency): Module;
7566
- getOrigin(dependency: Dependency): Module;
7567
- getResolvedOrigin(dependency: Dependency): Module;
7772
+ getModule(dependency: Dependency): null | Module;
7773
+ getOrigin(dependency: Dependency): null | Module;
7774
+ getResolvedOrigin(dependency: Dependency): null | Module;
7568
7775
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
7569
7776
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
7570
7777
  getIncomingConnectionsByOriginModule(
@@ -7593,19 +7800,19 @@ declare class ModuleGraph {
7593
7800
  module: Module,
7594
7801
  runtime: RuntimeSpec
7595
7802
  ): null | boolean | SortableSet<string>;
7596
- getPreOrderIndex(module: Module): number;
7597
- getPostOrderIndex(module: Module): number;
7803
+ getPreOrderIndex(module: Module): null | number;
7804
+ getPostOrderIndex(module: Module): null | number;
7598
7805
  setPreOrderIndex(module: Module, index: number): void;
7599
7806
  setPreOrderIndexIfUnset(module: Module, index: number): boolean;
7600
7807
  setPostOrderIndex(module: Module, index: number): void;
7601
7808
  setPostOrderIndexIfUnset(module: Module, index: number): boolean;
7602
- getDepth(module: Module): number;
7809
+ getDepth(module: Module): null | number;
7603
7810
  setDepth(module: Module, depth: number): void;
7604
7811
  setDepthIfLower(module: Module, depth: number): boolean;
7605
7812
  isAsync(module: Module): boolean;
7606
7813
  setAsync(module: Module): void;
7607
7814
  getMeta(thing?: any): Object;
7608
- getMetaIfExisting(thing?: any): Object;
7815
+ getMetaIfExisting(thing?: any): undefined | Object;
7609
7816
  freeze(cacheStage?: string): void;
7610
7817
  unfreeze(): void;
7611
7818
  cached<T extends any[], V>(
@@ -7646,11 +7853,11 @@ declare class ModuleGraphConnection {
7646
7853
  module: Module;
7647
7854
  weak: boolean;
7648
7855
  conditional: boolean;
7649
- condition: (
7856
+ condition?: (
7650
7857
  arg0: ModuleGraphConnection,
7651
7858
  arg1: RuntimeSpec
7652
7859
  ) => ConnectionState;
7653
- explanations: Set<string>;
7860
+ explanations?: Set<string>;
7654
7861
  clone(): ModuleGraphConnection;
7655
7862
  addCondition(
7656
7863
  condition: (
@@ -7681,7 +7888,7 @@ declare interface ModuleOptions {
7681
7888
  /**
7682
7889
  * An array of rules applied by default for modules.
7683
7890
  */
7684
- defaultRules?: (RuleSetRule | "...")[];
7891
+ defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7685
7892
 
7686
7893
  /**
7687
7894
  * Enable warnings for full dynamic dependencies.
@@ -7721,7 +7928,7 @@ declare interface ModuleOptions {
7721
7928
  /**
7722
7929
  * An array of rules applied for modules.
7723
7930
  */
7724
- rules?: (RuleSetRule | "...")[];
7931
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7725
7932
 
7726
7933
  /**
7727
7934
  * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
@@ -7781,7 +7988,7 @@ declare interface ModuleOptionsNormalized {
7781
7988
  /**
7782
7989
  * An array of rules applied by default for modules.
7783
7990
  */
7784
- defaultRules: (RuleSetRule | "...")[];
7991
+ defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7785
7992
 
7786
7993
  /**
7787
7994
  * Specify options for each generator.
@@ -7801,7 +8008,7 @@ declare interface ModuleOptionsNormalized {
7801
8008
  /**
7802
8009
  * An array of rules applied for modules.
7803
8010
  */
7804
- rules: (RuleSetRule | "...")[];
8011
+ rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7805
8012
 
7806
8013
  /**
7807
8014
  * Cache the resolving of module requests.
@@ -7973,7 +8180,7 @@ declare abstract class MultiStats {
7973
8180
  declare abstract class MultiWatching {
7974
8181
  watchings: Watching[];
7975
8182
  compiler: MultiCompiler;
7976
- invalidate(callback?: any): void;
8183
+ invalidate(callback?: CallbackFunction<void>): void;
7977
8184
  suspend(): void;
7978
8185
  resume(): void;
7979
8186
  close(callback: CallbackFunction<void>): void;
@@ -8035,6 +8242,7 @@ declare class NoEmitOnErrorsPlugin {
8035
8242
  */
8036
8243
  apply(compiler: Compiler): void;
8037
8244
  }
8245
+ type Node = false | NodeOptions;
8038
8246
  declare class NodeEnvironmentPlugin {
8039
8247
  constructor(options: {
8040
8248
  /**
@@ -8054,81 +8262,6 @@ declare class NodeEnvironmentPlugin {
8054
8262
  */
8055
8263
  apply(compiler: Compiler): void;
8056
8264
  }
8057
- type NodeEstreeIndex =
8058
- | UnaryExpression
8059
- | ArrayExpression
8060
- | ArrowFunctionExpression
8061
- | AssignmentExpression
8062
- | AwaitExpression
8063
- | BinaryExpression
8064
- | SimpleCallExpression
8065
- | NewExpression
8066
- | ChainExpression
8067
- | ClassExpression
8068
- | ConditionalExpression
8069
- | FunctionExpression
8070
- | Identifier
8071
- | ImportExpression
8072
- | SimpleLiteral
8073
- | RegExpLiteral
8074
- | BigIntLiteral
8075
- | LogicalExpression
8076
- | MemberExpression
8077
- | MetaProperty
8078
- | ObjectExpression
8079
- | SequenceExpression
8080
- | TaggedTemplateExpression
8081
- | TemplateLiteral
8082
- | ThisExpression
8083
- | UpdateExpression
8084
- | YieldExpression
8085
- | FunctionDeclaration
8086
- | VariableDeclaration
8087
- | ClassDeclaration
8088
- | PrivateIdentifier
8089
- | ExpressionStatement
8090
- | BlockStatement
8091
- | StaticBlock
8092
- | EmptyStatement
8093
- | DebuggerStatement
8094
- | WithStatement
8095
- | ReturnStatement
8096
- | LabeledStatement
8097
- | BreakStatement
8098
- | ContinueStatement
8099
- | IfStatement
8100
- | SwitchStatement
8101
- | ThrowStatement
8102
- | TryStatement
8103
- | WhileStatement
8104
- | DoWhileStatement
8105
- | ForStatement
8106
- | ForInStatement
8107
- | ForOfStatement
8108
- | ImportDeclaration
8109
- | ExportNamedDeclaration
8110
- | ExportDefaultDeclaration
8111
- | ExportAllDeclaration
8112
- | MethodDefinition
8113
- | PropertyDefinition
8114
- | VariableDeclarator
8115
- | Program
8116
- | SwitchCase
8117
- | CatchClause
8118
- | ObjectPattern
8119
- | ArrayPattern
8120
- | RestElement
8121
- | AssignmentPattern
8122
- | SpreadElement
8123
- | Property
8124
- | AssignmentProperty
8125
- | ClassBody
8126
- | ImportSpecifier
8127
- | ImportDefaultSpecifier
8128
- | ImportNamespaceSpecifier
8129
- | ExportSpecifier
8130
- | Super
8131
- | TemplateElement;
8132
8265
 
8133
8266
  /**
8134
8267
  * Options object for node compatibility features.
@@ -8179,7 +8312,6 @@ declare interface NodeTemplatePluginOptions {
8179
8312
  */
8180
8313
  asyncChunkLoading?: boolean;
8181
8314
  }
8182
- type NodeWebpackOptions = false | NodeOptions;
8183
8315
  declare class NormalModule extends Module {
8184
8316
  constructor(__0: NormalModuleCreateData);
8185
8317
  request: string;
@@ -8599,6 +8731,11 @@ declare interface Optimization {
8599
8731
  * Minimizer(s) to use for minimizing the output.
8600
8732
  */
8601
8733
  minimizer?: (
8734
+ | undefined
8735
+ | null
8736
+ | false
8737
+ | ""
8738
+ | 0
8602
8739
  | ((this: Compiler, compiler: Compiler) => void)
8603
8740
  | WebpackPluginInstance
8604
8741
  | "..."
@@ -8686,7 +8823,7 @@ declare interface OptimizationSplitChunksCacheGroup {
8686
8823
  /**
8687
8824
  * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
8688
8825
  */
8689
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8826
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8690
8827
 
8691
8828
  /**
8692
8829
  * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
@@ -8813,7 +8950,7 @@ declare interface OptimizationSplitChunksOptions {
8813
8950
  /**
8814
8951
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8815
8952
  */
8816
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8953
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8817
8954
 
8818
8955
  /**
8819
8956
  * Sets the size types which are used when a number is used for sizes.
@@ -8836,7 +8973,7 @@ declare interface OptimizationSplitChunksOptions {
8836
8973
  /**
8837
8974
  * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
8838
8975
  */
8839
- chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8976
+ chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
8840
8977
  /**
8841
8978
  * Maximal size hint for the on-demand chunks.
8842
8979
  */
@@ -9673,6 +9810,11 @@ declare interface PitchLoaderDefinitionFunction<
9673
9810
  ): string | void | Buffer | Promise<string | Buffer>;
9674
9811
  }
9675
9812
  type Plugin =
9813
+ | undefined
9814
+ | null
9815
+ | false
9816
+ | ""
9817
+ | 0
9676
9818
  | { apply: (arg0: Resolver) => void }
9677
9819
  | ((this: Resolver, arg1: Resolver) => void);
9678
9820
  declare interface PnpApiImpl {
@@ -9763,7 +9905,7 @@ declare class ProgressPlugin {
9763
9905
  apply(compiler: Compiler | MultiCompiler): void;
9764
9906
  static getReporter(
9765
9907
  compiler: Compiler
9766
- ): (p: number, ...args: string[]) => void;
9908
+ ): undefined | ((p: number, ...args: string[]) => void);
9767
9909
  static defaultOptions: {
9768
9910
  profile: boolean;
9769
9911
  modulesCount: number;
@@ -9773,6 +9915,10 @@ declare class ProgressPlugin {
9773
9915
  activeModules: boolean;
9774
9916
  entries: boolean;
9775
9917
  };
9918
+ static createDefaultHandler: (
9919
+ profile: undefined | null | boolean,
9920
+ logger: WebpackLogger
9921
+ ) => (percentage: number, msg: string, ...args: string[]) => void;
9776
9922
  }
9777
9923
  type ProgressPluginArgument =
9778
9924
  | ProgressPluginOptions
@@ -9891,6 +10037,7 @@ declare interface ProvidesObject {
9891
10037
  declare interface RawChunkGroupOptions {
9892
10038
  preloadOrder?: number;
9893
10039
  prefetchOrder?: number;
10040
+ fetchPriority?: "auto" | "low" | "high";
9894
10041
  }
9895
10042
  type RawLoaderDefinition<
9896
10043
  OptionsType = {},
@@ -10397,7 +10544,15 @@ declare interface ResolveOptionsWebpackOptions {
10397
10544
  /**
10398
10545
  * Plugins for the resolver.
10399
10546
  */
10400
- plugins?: (ResolvePluginInstance | "...")[];
10547
+ plugins?: (
10548
+ | undefined
10549
+ | null
10550
+ | false
10551
+ | ""
10552
+ | 0
10553
+ | ResolvePluginInstance
10554
+ | "..."
10555
+ )[];
10401
10556
 
10402
10557
  /**
10403
10558
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -10737,7 +10892,7 @@ declare interface RuleSetRule {
10737
10892
  /**
10738
10893
  * Only execute the first matching rule in this array.
10739
10894
  */
10740
- oneOf?: RuleSetRule[];
10895
+ oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10741
10896
 
10742
10897
  /**
10743
10898
  * Shortcut for use.options.
@@ -10797,7 +10952,7 @@ declare interface RuleSetRule {
10797
10952
  /**
10798
10953
  * Match and execute these rules when this rule is matched.
10799
10954
  */
10800
- rules?: RuleSetRule[];
10955
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10801
10956
 
10802
10957
  /**
10803
10958
  * Match module scheme.
@@ -10834,14 +10989,52 @@ declare interface RuleSetRule {
10834
10989
  */
10835
10990
  use?:
10836
10991
  | string
10837
- | RuleSetUseItem[]
10992
+ | (
10993
+ | undefined
10994
+ | null
10995
+ | string
10996
+ | false
10997
+ | 0
10998
+ | {
10999
+ /**
11000
+ * Unique loader options identifier.
11001
+ */
11002
+ ident?: string;
11003
+ /**
11004
+ * Loader name.
11005
+ */
11006
+ loader?: string;
11007
+ /**
11008
+ * Loader options.
11009
+ */
11010
+ options?: string | { [index: string]: any };
11011
+ }
11012
+ | ((data: object) =>
11013
+ | string
11014
+ | {
11015
+ /**
11016
+ * Unique loader options identifier.
11017
+ */
11018
+ ident?: string;
11019
+ /**
11020
+ * Loader name.
11021
+ */
11022
+ loader?: string;
11023
+ /**
11024
+ * Loader options.
11025
+ */
11026
+ options?: string | { [index: string]: any };
11027
+ }
11028
+ | __TypeWebpackOptions
11029
+ | __Type_2[])
11030
+ )[]
10838
11031
  | ((data: {
10839
11032
  resource: string;
10840
11033
  realResource: string;
10841
11034
  resourceQuery: string;
10842
11035
  issuer: string;
10843
11036
  compiler: string;
10844
- }) => RuleSetUseItem[])
11037
+ }) => __Type_2[])
10845
11038
  | {
10846
11039
  /**
10847
11040
  * Unique loader options identifier.
@@ -10856,35 +11049,56 @@ declare interface RuleSetRule {
10856
11049
  */
10857
11050
  options?: string | { [index: string]: any };
10858
11051
  }
10859
- | ((data: object) =>
10860
- | string
10861
- | {
10862
- /**
10863
- * Unique loader options identifier.
10864
- */
10865
- ident?: string;
10866
- /**
10867
- * Loader name.
10868
- */
10869
- loader?: string;
10870
- /**
10871
- * Loader options.
10872
- */
10873
- options?: string | { [index: string]: any };
10874
- }
10875
- | __TypeWebpackOptions
10876
- | RuleSetUseItem[]);
11052
+ | __TypeWebpackOptions;
10877
11053
  }
10878
11054
  type RuleSetUse =
10879
11055
  | string
10880
- | RuleSetUseItem[]
11056
+ | (
11057
+ | undefined
11058
+ | null
11059
+ | string
11060
+ | false
11061
+ | 0
11062
+ | {
11063
+ /**
11064
+ * Unique loader options identifier.
11065
+ */
11066
+ ident?: string;
11067
+ /**
11068
+ * Loader name.
11069
+ */
11070
+ loader?: string;
11071
+ /**
11072
+ * Loader options.
11073
+ */
11074
+ options?: string | { [index: string]: any };
11075
+ }
11076
+ | ((data: object) =>
11077
+ | string
11078
+ | {
11079
+ /**
11080
+ * Unique loader options identifier.
11081
+ */
11082
+ ident?: string;
11083
+ /**
11084
+ * Loader name.
11085
+ */
11086
+ loader?: string;
11087
+ /**
11088
+ * Loader options.
11089
+ */
11090
+ options?: string | { [index: string]: any };
11091
+ }
11092
+ | __TypeWebpackOptions
11093
+ | __Type_2[])
11094
+ )[]
10881
11095
  | ((data: {
10882
11096
  resource: string;
10883
11097
  realResource: string;
10884
11098
  resourceQuery: string;
10885
11099
  issuer: string;
10886
11100
  compiler: string;
10887
- }) => RuleSetUseItem[])
11101
+ }) => __Type_2[])
10888
11102
  | {
10889
11103
  /**
10890
11104
  * Unique loader options identifier.
@@ -10975,20 +11189,20 @@ declare interface RuntimeRequirementsContext {
10975
11189
  type RuntimeSpec = undefined | string | SortableSet<string>;
10976
11190
  declare class RuntimeSpecMap<T> {
10977
11191
  constructor(clone?: RuntimeSpecMap<T>);
10978
- get(runtime: RuntimeSpec): T;
11192
+ get(runtime: RuntimeSpec): undefined | T;
10979
11193
  has(runtime: RuntimeSpec): boolean;
10980
11194
  set(runtime?: any, value?: any): void;
10981
11195
  provide(runtime?: any, computer?: any): any;
10982
- delete(runtime?: any): void;
11196
+ delete(runtime: RuntimeSpec): void;
10983
11197
  update(runtime?: any, fn?: any): void;
10984
11198
  keys(): RuntimeSpec[];
10985
11199
  values(): IterableIterator<T>;
10986
11200
  get size(): number;
10987
11201
  }
10988
11202
  declare class RuntimeSpecSet {
10989
- constructor(iterable?: any);
10990
- add(runtime?: any): void;
10991
- has(runtime?: any): boolean;
11203
+ constructor(iterable?: Iterable<RuntimeSpec>);
11204
+ add(runtime: RuntimeSpec): void;
11205
+ has(runtime: RuntimeSpec): boolean;
10992
11206
  get size(): number;
10993
11207
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
10994
11208
  }
@@ -11546,10 +11760,10 @@ declare class SideEffectsFlagPlugin {
11546
11760
  */
11547
11761
  apply(compiler: Compiler): void;
11548
11762
  static moduleHasSideEffects(
11549
- moduleName?: any,
11550
- flagValue?: any,
11551
- cache?: any
11552
- ): any;
11763
+ moduleName: string,
11764
+ flagValue: undefined | string | boolean | string[],
11765
+ cache: Map<string, RegExp>
11766
+ ): undefined | boolean;
11553
11767
  }
11554
11768
  declare class SizeOnlySource extends Source {
11555
11769
  constructor(size: number);
@@ -11832,7 +12046,7 @@ declare interface SourcePosition {
11832
12046
  column?: number;
11833
12047
  }
11834
12048
  declare interface SplitChunksOptions {
11835
- chunksFilter: (chunk: Chunk) => boolean;
12049
+ chunksFilter: (chunk: Chunk) => undefined | boolean;
11836
12050
  defaultSizeTypes: string[];
11837
12051
  minSize: SplitChunksSizes;
11838
12052
  minSizeReduction: SplitChunksSizes;
@@ -12709,7 +12923,7 @@ declare interface UserResolveOptions {
12709
12923
  }
12710
12924
  declare abstract class VariableInfo {
12711
12925
  declaredScope: ScopeInfo;
12712
- freeName: string | true;
12926
+ freeName?: string | true;
12713
12927
  tagInfo?: TagInfo;
12714
12928
  }
12715
12929
  declare interface VariableInfoInterface {
@@ -12937,12 +13151,12 @@ declare class WebpackError extends Error {
12937
13151
  * Creates an instance of WebpackError.
12938
13152
  */
12939
13153
  constructor(message?: string);
12940
- details: any;
12941
- module: Module;
12942
- loc: DependencyLocation;
12943
- hideStack: boolean;
12944
- chunk: Chunk;
12945
- file: string;
13154
+ details?: string;
13155
+ module?: null | Module;
13156
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
13157
+ hideStack?: boolean;
13158
+ chunk?: Chunk;
13159
+ file?: string;
12946
13160
  serialize(__0: ObjectSerializerContext): void;
12947
13161
  deserialize(__0: ObjectDeserializerContext): void;
12948
13162
 
@@ -12990,7 +13204,7 @@ declare class WebpackOptionsApply extends OptionsApply {
12990
13204
  }
12991
13205
  declare class WebpackOptionsDefaulter {
12992
13206
  constructor();
12993
- process(options?: any): any;
13207
+ process(options: Configuration): WebpackOptionsNormalized;
12994
13208
  }
12995
13209
 
12996
13210
  /**
@@ -13114,7 +13328,7 @@ declare interface WebpackOptionsNormalized {
13114
13328
  /**
13115
13329
  * Include polyfills or mocks for various node stuff.
13116
13330
  */
13117
- node: NodeWebpackOptions;
13331
+ node: Node;
13118
13332
 
13119
13333
  /**
13120
13334
  * Enables/Disables integrated optimizations.
@@ -13140,6 +13354,11 @@ declare interface WebpackOptionsNormalized {
13140
13354
  * Add additional plugins to the compiler.
13141
13355
  */
13142
13356
  plugins: (
13357
+ | undefined
13358
+ | null
13359
+ | false
13360
+ | ""
13361
+ | 0
13143
13362
  | ((this: Compiler, compiler: Compiler) => void)
13144
13363
  | WebpackPluginInstance
13145
13364
  )[];
@@ -13237,7 +13456,45 @@ type __TypeWebpackOptions = (data: object) =>
13237
13456
  options?: string | { [index: string]: any };
13238
13457
  }
13239
13458
  | __TypeWebpackOptions
13240
- | RuleSetUseItem[];
13459
+ | __Type_2[];
13460
+ type __Type_2 =
13461
+ | undefined
13462
+ | null
13463
+ | string
13464
+ | false
13465
+ | 0
13466
+ | {
13467
+ /**
13468
+ * Unique loader options identifier.
13469
+ */
13470
+ ident?: string;
13471
+ /**
13472
+ * Loader name.
13473
+ */
13474
+ loader?: string;
13475
+ /**
13476
+ * Loader options.
13477
+ */
13478
+ options?: string | { [index: string]: any };
13479
+ }
13480
+ | ((data: object) =>
13481
+ | string
13482
+ | {
13483
+ /**
13484
+ * Unique loader options identifier.
13485
+ */
13486
+ ident?: string;
13487
+ /**
13488
+ * Loader name.
13489
+ */
13490
+ loader?: string;
13491
+ /**
13492
+ * Loader options.
13493
+ */
13494
+ options?: string | { [index: string]: any };
13495
+ }
13496
+ | __TypeWebpackOptions
13497
+ | __Type_2[]);
13241
13498
  declare function exports(
13242
13499
  options: Configuration,
13243
13500
  callback?: CallbackWebpack<Stats>
@@ -13365,6 +13622,7 @@ declare namespace exports {
13365
13622
  export let createScript: "__webpack_require__.ts";
13366
13623
  export let createScriptUrl: "__webpack_require__.tu";
13367
13624
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
13625
+ export let hasFetchPriority: "has fetch priority";
13368
13626
  export let chunkName: "__webpack_require__.cn";
13369
13627
  export let runtimeId: "__webpack_require__.j";
13370
13628
  export let getChunkScriptFilename: "__webpack_require__.u";
@@ -13468,7 +13726,7 @@ declare namespace exports {
13468
13726
  ) => void;
13469
13727
  export let setTopLevelSymbol: (
13470
13728
  state: ParserState,
13471
- symbol: TopLevelSymbol
13729
+ symbol?: TopLevelSymbol
13472
13730
  ) => void;
13473
13731
  export let getTopLevelSymbol: (
13474
13732
  state: ParserState
@@ -13476,7 +13734,7 @@ declare namespace exports {
13476
13734
  export let tagTopLevelSymbol: (
13477
13735
  parser: JavascriptParser,
13478
13736
  name: string
13479
- ) => TopLevelSymbol;
13737
+ ) => undefined | TopLevelSymbol;
13480
13738
  export let isDependencyUsedByExports: (
13481
13739
  dependency: Dependency,
13482
13740
  usedByExports: boolean | Set<string>,
@@ -13675,7 +13933,7 @@ declare namespace exports {
13675
13933
  export const register: (
13676
13934
  Constructor: Constructor,
13677
13935
  request: string,
13678
- name: string,
13936
+ name: null | string,
13679
13937
  serializer: ObjectSerializer
13680
13938
  ) => void;
13681
13939
  export const registerLoader: (