webpack 5.86.0 → 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 (105) hide show
  1. package/README.md +5 -2
  2. package/lib/CaseSensitiveModulesWarning.js +3 -1
  3. package/lib/ChunkGroup.js +1 -0
  4. package/lib/Compiler.js +3 -1
  5. package/lib/ConcatenationScope.js +2 -2
  6. package/lib/ConditionalInitFragment.js +11 -1
  7. package/lib/ConstPlugin.js +57 -29
  8. package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
  9. package/lib/ModuleDependencyError.js +4 -2
  10. package/lib/ModuleDependencyWarning.js +4 -2
  11. package/lib/ModuleGraph.js +31 -24
  12. package/lib/ModuleGraphConnection.js +19 -6
  13. package/lib/ModuleInfoHeaderPlugin.js +9 -2
  14. package/lib/ModuleNotFoundError.js +5 -2
  15. package/lib/ModuleStoreError.js +2 -1
  16. package/lib/ModuleTypeConstants.js +7 -0
  17. package/lib/MultiWatching.js +4 -0
  18. package/lib/RuntimeGlobals.js +5 -0
  19. package/lib/RuntimePlugin.js +2 -1
  20. package/lib/RuntimeTemplate.js +20 -2
  21. package/lib/WebpackError.js +6 -5
  22. package/lib/WebpackOptionsApply.js +1 -1
  23. package/lib/WebpackOptionsDefaulter.js +10 -3
  24. package/lib/config/defaults.js +31 -2
  25. package/lib/css/CssModulesPlugin.js +5 -2
  26. package/lib/css/CssParser.js +12 -0
  27. package/lib/dependencies/ConstDependency.js +2 -2
  28. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
  29. package/lib/dependencies/ImportParserPlugin.js +25 -1
  30. package/lib/ids/SyncModuleIdsPlugin.js +1 -0
  31. package/lib/javascript/BasicEvaluatedExpression.js +23 -15
  32. package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
  33. package/lib/javascript/JavascriptParser.js +118 -58
  34. package/lib/javascript/JavascriptParserHelpers.js +37 -15
  35. package/lib/performance/SizeLimitsPlugin.js +7 -4
  36. package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +3 -1
  37. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
  38. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +5 -2
  39. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +3 -1
  40. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +3 -1
  41. package/lib/rules/BasicEffectRulePlugin.js +4 -0
  42. package/lib/rules/BasicMatcherRulePlugin.js +5 -0
  43. package/lib/rules/RuleSetCompiler.js +3 -3
  44. package/lib/rules/UseEffectRulePlugin.js +6 -4
  45. package/lib/runtime/AsyncModuleRuntimeModule.js +4 -1
  46. package/lib/runtime/AutoPublicPathRuntimeModule.js +3 -1
  47. package/lib/runtime/BaseUriRuntimeModule.js +2 -2
  48. package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +4 -1
  49. package/lib/runtime/CompatRuntimeModule.js +6 -1
  50. package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +4 -1
  51. package/lib/runtime/CreateScriptRuntimeModule.js +3 -1
  52. package/lib/runtime/CreateScriptUrlRuntimeModule.js +3 -1
  53. package/lib/runtime/DefinePropertyGettersRuntimeModule.js +4 -1
  54. package/lib/runtime/EnsureChunkRuntimeModule.js +14 -3
  55. package/lib/runtime/GetChunkFilenameRuntimeModule.js +5 -9
  56. package/lib/runtime/GetFullHashRuntimeModule.js +3 -2
  57. package/lib/runtime/GetMainFilenameRuntimeModule.js +4 -1
  58. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +3 -1
  59. package/lib/runtime/HasOwnPropertyRuntimeModule.js +4 -1
  60. package/lib/runtime/LoadScriptRuntimeModule.js +63 -47
  61. package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +4 -1
  62. package/lib/runtime/OnChunksLoadedRuntimeModule.js +3 -1
  63. package/lib/runtime/PublicPathRuntimeModule.js +3 -1
  64. package/lib/runtime/RelativeUrlRuntimeModule.js +4 -1
  65. package/lib/runtime/RuntimeIdRuntimeModule.js +5 -1
  66. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +8 -2
  67. package/lib/runtime/StartupEntrypointRuntimeModule.js +2 -1
  68. package/lib/serialization/ObjectMiddleware.js +6 -3
  69. package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
  70. package/lib/sharing/ConsumeSharedRuntimeModule.js +13 -4
  71. package/lib/sharing/ProvideSharedDependency.js +11 -0
  72. package/lib/sharing/ProvideSharedModule.js +4 -0
  73. package/lib/sharing/ProvideSharedPlugin.js +22 -21
  74. package/lib/sharing/ShareRuntimeModule.js +11 -4
  75. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  76. package/lib/sharing/utils.js +32 -5
  77. package/lib/util/AsyncQueue.js +4 -2
  78. package/lib/util/ParallelismFactorCalculator.js +10 -0
  79. package/lib/util/Semaphore.js +1 -1
  80. package/lib/util/createHash.js +30 -9
  81. package/lib/util/deprecation.js +10 -3
  82. package/lib/util/deterministicGrouping.js +50 -11
  83. package/lib/util/findGraphRoots.js +4 -2
  84. package/lib/util/memoize.js +3 -3
  85. package/lib/util/processAsyncTree.js +7 -1
  86. package/lib/util/registerExternalSerializer.js +1 -1
  87. package/lib/util/runtime.js +14 -1
  88. package/lib/util/smartGrouping.js +1 -1
  89. package/lib/validateSchema.js +6 -2
  90. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
  91. package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
  92. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -6
  93. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
  94. package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
  95. package/lib/wasm-sync/WebAssemblyParser.js +6 -2
  96. package/lib/web/JsonpChunkLoadingRuntimeModule.js +13 -3
  97. package/lib/webpack.js +11 -2
  98. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +14 -15
  99. package/module.d.ts +1 -0
  100. package/package.json +4 -4
  101. package/schemas/WebpackOptions.check.js +1 -1
  102. package/schemas/WebpackOptions.json +39 -5
  103. package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
  104. package/schemas/plugins/css/CssParserOptions.json +1 -1
  105. package/types.d.ts +433 -184
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,
@@ -491,7 +492,7 @@ declare interface BaseResolveRequest {
491
492
  }
492
493
  declare abstract class BasicEvaluatedExpression {
493
494
  type: number;
494
- range: [number, number];
495
+ range?: [number, number];
495
496
  falsy: boolean;
496
497
  truthy: boolean;
497
498
  nullish?: boolean;
@@ -506,15 +507,89 @@ declare abstract class BasicEvaluatedExpression {
506
507
  array?: any[];
507
508
  items?: BasicEvaluatedExpression[];
508
509
  options?: BasicEvaluatedExpression[];
509
- prefix?: BasicEvaluatedExpression;
510
- postfix?: BasicEvaluatedExpression;
511
- wrappedInnerExpressions: BasicEvaluatedExpression[];
510
+ prefix?: null | BasicEvaluatedExpression;
511
+ postfix?: null | BasicEvaluatedExpression;
512
+ wrappedInnerExpressions?: BasicEvaluatedExpression[];
512
513
  identifier?: string | VariableInfoInterface;
513
- rootInfo: string | VariableInfoInterface;
514
- getMembers: () => string[];
515
- getMembersOptionals: () => boolean[];
516
- getMemberRanges: () => [number, number][];
517
- 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;
518
593
  isUnknown(): boolean;
519
594
  isNull(): boolean;
520
595
  isUndefined(): boolean;
@@ -567,7 +642,7 @@ declare abstract class BasicEvaluatedExpression {
567
642
  * Creates a string representation of this evaluated expression.
568
643
  */
569
644
  asString(): undefined | string;
570
- setString(string?: any): BasicEvaluatedExpression;
645
+ setString(string: string): BasicEvaluatedExpression;
571
646
  setUndefined(): BasicEvaluatedExpression;
572
647
  setNull(): BasicEvaluatedExpression;
573
648
 
@@ -606,8 +681,8 @@ declare abstract class BasicEvaluatedExpression {
606
681
  * Wraps an array of expressions with a prefix and postfix expression.
607
682
  */
608
683
  setWrapped(
609
- prefix: null | BasicEvaluatedExpression,
610
- postfix: BasicEvaluatedExpression,
684
+ prefix: undefined | null | BasicEvaluatedExpression,
685
+ postfix: undefined | null | BasicEvaluatedExpression,
611
686
  innerExpressions: BasicEvaluatedExpression[]
612
687
  ): BasicEvaluatedExpression;
613
688
 
@@ -662,7 +737,83 @@ declare abstract class BasicEvaluatedExpression {
662
737
  /**
663
738
  * Set the expression node for the expression.
664
739
  */
665
- 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;
666
817
  }
667
818
  declare interface BuildInfo {
668
819
  [index: string]: any;
@@ -2196,7 +2347,7 @@ declare class ConcatenationScope {
2196
2347
  static isModuleReference(name: string): boolean;
2197
2348
  static matchModuleReference(
2198
2349
  name: string
2199
- ): ModuleReferenceOptions & { index: number };
2350
+ ): null | (ModuleReferenceOptions & { index: number });
2200
2351
  static DEFAULT_EXPORT: string;
2201
2352
  static NAMESPACE_OBJECT_EXPORT: string;
2202
2353
  }
@@ -2378,6 +2529,11 @@ declare interface Configuration {
2378
2529
  * Add additional plugins to the compiler.
2379
2530
  */
2380
2531
  plugins?: (
2532
+ | undefined
2533
+ | null
2534
+ | false
2535
+ | ""
2536
+ | 0
2381
2537
  | ((this: Compiler, compiler: Compiler) => void)
2382
2538
  | WebpackPluginInstance
2383
2539
  )[];
@@ -2455,7 +2611,7 @@ declare class ConstDependency extends NullDependency {
2455
2611
  constructor(
2456
2612
  expression: string,
2457
2613
  range: number | [number, number],
2458
- runtimeRequirements?: string[]
2614
+ runtimeRequirements?: null | string[]
2459
2615
  );
2460
2616
  expression: string;
2461
2617
  range: number | [number, number];
@@ -5378,8 +5534,14 @@ declare class JavascriptParser extends Parser {
5378
5534
  unhandledExpressionMemberChain: HookMap<
5379
5535
  SyncBailHook<[Expression, string[]], boolean | void>
5380
5536
  >;
5381
- expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
5382
- expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
5537
+ expressionConditionalOperator: SyncBailHook<
5538
+ [ConditionalExpression],
5539
+ boolean | void
5540
+ >;
5541
+ expressionLogicalOperator: SyncBailHook<
5542
+ [LogicalExpression],
5543
+ boolean | void
5544
+ >;
5383
5545
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
5384
5546
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
5385
5547
  }>;
@@ -5443,7 +5605,7 @@ declare class JavascriptParser extends Parser {
5443
5605
  | ExportDefaultDeclaration
5444
5606
  | ExportAllDeclaration
5445
5607
  )[];
5446
- prevStatement:
5608
+ prevStatement?:
5447
5609
  | UnaryExpression
5448
5610
  | ArrayExpression
5449
5611
  | ArrowFunctionExpression
@@ -5832,43 +5994,75 @@ declare class JavascriptParser extends Parser {
5832
5994
  callHooksForExpressionWithFallback<T, R>(
5833
5995
  hookMap: HookMap<SyncBailHook<T, R>>,
5834
5996
  expr: MemberExpression,
5835
- fallback: (
5836
- arg0: string,
5837
- arg1: string | ScopeInfo | VariableInfo,
5838
- arg2: () => string[]
5839
- ) => any,
5840
- 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),
5841
6005
  ...args: AsArray<T>
5842
- ): R;
6006
+ ): undefined | R;
5843
6007
  callHooksForName<T, R>(
5844
6008
  hookMap: HookMap<SyncBailHook<T, R>>,
5845
6009
  name: string,
5846
6010
  ...args: AsArray<T>
5847
- ): R;
6011
+ ): undefined | R;
5848
6012
  callHooksForInfo<T, R>(
5849
6013
  hookMap: HookMap<SyncBailHook<T, R>>,
5850
6014
  info: ExportedVariableInfo,
5851
6015
  ...args: AsArray<T>
5852
- ): R;
6016
+ ): undefined | R;
5853
6017
  callHooksForInfoWithFallback<T, R>(
5854
6018
  hookMap: HookMap<SyncBailHook<T, R>>,
5855
6019
  info: ExportedVariableInfo,
5856
- fallback: (arg0: string) => any,
5857
- defined: () => any,
6020
+ fallback: undefined | ((arg0: string) => any),
6021
+ defined: undefined | (() => any),
5858
6022
  ...args: AsArray<T>
5859
- ): R;
6023
+ ): undefined | R;
5860
6024
  callHooksForNameWithFallback<T, R>(
5861
6025
  hookMap: HookMap<SyncBailHook<T, R>>,
5862
6026
  name: string,
5863
- fallback: (arg0: string) => any,
5864
- defined: () => any,
6027
+ fallback: undefined | ((arg0: string) => any),
6028
+ defined: undefined | (() => any),
5865
6029
  ...args: AsArray<T>
5866
- ): R;
6030
+ ): undefined | R;
5867
6031
  inScope(params: any, fn: () => void): void;
5868
- inClassScope(hasThis?: any, params?: any, fn?: any): void;
5869
- inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
5870
- inBlockScope(fn?: any): void;
5871
- 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;
5872
6066
  enterPatterns(patterns?: any, onIdent?: any): void;
5873
6067
  enterPattern(pattern?: any, onIdent?: any): void;
5874
6068
  enterIdentifier(pattern: Identifier, onIdent?: any): void;
@@ -5876,7 +6070,7 @@ declare class JavascriptParser extends Parser {
5876
6070
  enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
5877
6071
  enterRestElement(pattern: RestElement, onIdent?: any): void;
5878
6072
  enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
5879
- evaluateExpression(expression: Expression): BasicEvaluatedExpression;
6073
+ evaluateExpression(expression?: any): BasicEvaluatedExpression;
5880
6074
  parseString(expression: Expression): string;
5881
6075
  parseCalculatedString(expression?: any): any;
5882
6076
  evaluate(source: string): BasicEvaluatedExpression;
@@ -5920,7 +6114,7 @@ declare class JavascriptParser extends Parser {
5920
6114
  getComments(range: [number, number]): any[];
5921
6115
  isAsiPosition(pos: number): boolean;
5922
6116
  unsetAsiPosition(pos: number): void;
5923
- isStatementLevelExpression(expr?: any): boolean;
6117
+ isStatementLevelExpression(expr: Expression): boolean;
5924
6118
  getTagData(name?: any, tag?: any): any;
5925
6119
  tagVariable(name?: any, tag?: any, data?: any): void;
5926
6120
  defineVariable(name: string): void;
@@ -5964,19 +6158,22 @@ declare class JavascriptParser extends Parser {
5964
6158
  membersOptionals: boolean[];
5965
6159
  memberRanges: [number, number][];
5966
6160
  };
5967
- getFreeInfoFromVariable(varName: string): {
5968
- name: string;
5969
- info: string | VariableInfo;
5970
- };
6161
+ getFreeInfoFromVariable(
6162
+ varName: string
6163
+ ): undefined | { name: string; info: string | VariableInfo };
5971
6164
  getMemberExpressionInfo(
5972
6165
  expression: MemberExpression,
5973
6166
  allowedTypes: number
5974
6167
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5975
- getNameForExpression(expression: MemberExpression): {
5976
- name: string;
5977
- rootInfo: ExportedVariableInfo;
5978
- getMembers: () => string[];
5979
- };
6168
+ getNameForExpression(
6169
+ expression: MemberExpression
6170
+ ):
6171
+ | undefined
6172
+ | {
6173
+ name: string;
6174
+ rootInfo: ExportedVariableInfo;
6175
+ getMembers: () => string[];
6176
+ };
5980
6177
  static ALLOWED_MEMBER_TYPES_ALL: 3;
5981
6178
  static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
5982
6179
  static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
@@ -6013,6 +6210,11 @@ declare interface JavascriptParserOptions {
6013
6210
  */
6014
6211
  createRequire?: string | boolean;
6015
6212
 
6213
+ /**
6214
+ * Specifies global fetchPriority for dynamic import.
6215
+ */
6216
+ dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6217
+
6016
6218
  /**
6017
6219
  * Specifies global mode for dynamic import.
6018
6220
  */
@@ -6823,7 +7025,7 @@ declare interface LoadScriptCompilationHooks {
6823
7025
  createScript: SyncWaterfallHook<[string, Chunk]>;
6824
7026
  }
6825
7027
  declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
6826
- constructor(withCreateScriptUrl?: boolean);
7028
+ constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
6827
7029
  static getCompilationHooks(
6828
7030
  compilation: Compilation
6829
7031
  ): LoadScriptCompilationHooks;
@@ -7279,9 +7481,9 @@ declare class Module extends DependenciesBlock {
7279
7481
  get hash(): string;
7280
7482
  get renderedHash(): string;
7281
7483
  profile: null | ModuleProfile;
7282
- index: number;
7283
- index2: number;
7284
- depth: number;
7484
+ index: null | number;
7485
+ index2: null | number;
7486
+ depth: null | number;
7285
7487
  issuer: null | Module;
7286
7488
  get usedExports(): null | boolean | SortableSet<string>;
7287
7489
  get optimizationBailout(): (
@@ -7565,11 +7767,11 @@ declare class ModuleGraph {
7565
7767
  filterConnection: (arg0: ModuleGraphConnection) => boolean
7566
7768
  ): void;
7567
7769
  addExtraReason(module: Module, explanation: string): void;
7568
- getResolvedModule(dependency: Dependency): Module;
7770
+ getResolvedModule(dependency: Dependency): null | Module;
7569
7771
  getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
7570
- getModule(dependency: Dependency): Module;
7571
- getOrigin(dependency: Dependency): Module;
7572
- getResolvedOrigin(dependency: Dependency): Module;
7772
+ getModule(dependency: Dependency): null | Module;
7773
+ getOrigin(dependency: Dependency): null | Module;
7774
+ getResolvedOrigin(dependency: Dependency): null | Module;
7573
7775
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
7574
7776
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
7575
7777
  getIncomingConnectionsByOriginModule(
@@ -7598,19 +7800,19 @@ declare class ModuleGraph {
7598
7800
  module: Module,
7599
7801
  runtime: RuntimeSpec
7600
7802
  ): null | boolean | SortableSet<string>;
7601
- getPreOrderIndex(module: Module): number;
7602
- getPostOrderIndex(module: Module): number;
7803
+ getPreOrderIndex(module: Module): null | number;
7804
+ getPostOrderIndex(module: Module): null | number;
7603
7805
  setPreOrderIndex(module: Module, index: number): void;
7604
7806
  setPreOrderIndexIfUnset(module: Module, index: number): boolean;
7605
7807
  setPostOrderIndex(module: Module, index: number): void;
7606
7808
  setPostOrderIndexIfUnset(module: Module, index: number): boolean;
7607
- getDepth(module: Module): number;
7809
+ getDepth(module: Module): null | number;
7608
7810
  setDepth(module: Module, depth: number): void;
7609
7811
  setDepthIfLower(module: Module, depth: number): boolean;
7610
7812
  isAsync(module: Module): boolean;
7611
7813
  setAsync(module: Module): void;
7612
7814
  getMeta(thing?: any): Object;
7613
- getMetaIfExisting(thing?: any): Object;
7815
+ getMetaIfExisting(thing?: any): undefined | Object;
7614
7816
  freeze(cacheStage?: string): void;
7615
7817
  unfreeze(): void;
7616
7818
  cached<T extends any[], V>(
@@ -7651,11 +7853,11 @@ declare class ModuleGraphConnection {
7651
7853
  module: Module;
7652
7854
  weak: boolean;
7653
7855
  conditional: boolean;
7654
- condition: (
7856
+ condition?: (
7655
7857
  arg0: ModuleGraphConnection,
7656
7858
  arg1: RuntimeSpec
7657
7859
  ) => ConnectionState;
7658
- explanations: Set<string>;
7860
+ explanations?: Set<string>;
7659
7861
  clone(): ModuleGraphConnection;
7660
7862
  addCondition(
7661
7863
  condition: (
@@ -7686,7 +7888,7 @@ declare interface ModuleOptions {
7686
7888
  /**
7687
7889
  * An array of rules applied by default for modules.
7688
7890
  */
7689
- defaultRules?: (RuleSetRule | "...")[];
7891
+ defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7690
7892
 
7691
7893
  /**
7692
7894
  * Enable warnings for full dynamic dependencies.
@@ -7726,7 +7928,7 @@ declare interface ModuleOptions {
7726
7928
  /**
7727
7929
  * An array of rules applied for modules.
7728
7930
  */
7729
- rules?: (RuleSetRule | "...")[];
7931
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7730
7932
 
7731
7933
  /**
7732
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'.
@@ -7786,7 +7988,7 @@ declare interface ModuleOptionsNormalized {
7786
7988
  /**
7787
7989
  * An array of rules applied by default for modules.
7788
7990
  */
7789
- defaultRules: (RuleSetRule | "...")[];
7991
+ defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7790
7992
 
7791
7993
  /**
7792
7994
  * Specify options for each generator.
@@ -7806,7 +8008,7 @@ declare interface ModuleOptionsNormalized {
7806
8008
  /**
7807
8009
  * An array of rules applied for modules.
7808
8010
  */
7809
- rules: (RuleSetRule | "...")[];
8011
+ rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
7810
8012
 
7811
8013
  /**
7812
8014
  * Cache the resolving of module requests.
@@ -7978,7 +8180,7 @@ declare abstract class MultiStats {
7978
8180
  declare abstract class MultiWatching {
7979
8181
  watchings: Watching[];
7980
8182
  compiler: MultiCompiler;
7981
- invalidate(callback?: any): void;
8183
+ invalidate(callback?: CallbackFunction<void>): void;
7982
8184
  suspend(): void;
7983
8185
  resume(): void;
7984
8186
  close(callback: CallbackFunction<void>): void;
@@ -8040,6 +8242,7 @@ declare class NoEmitOnErrorsPlugin {
8040
8242
  */
8041
8243
  apply(compiler: Compiler): void;
8042
8244
  }
8245
+ type Node = false | NodeOptions;
8043
8246
  declare class NodeEnvironmentPlugin {
8044
8247
  constructor(options: {
8045
8248
  /**
@@ -8059,81 +8262,6 @@ declare class NodeEnvironmentPlugin {
8059
8262
  */
8060
8263
  apply(compiler: Compiler): void;
8061
8264
  }
8062
- type NodeEstreeIndex =
8063
- | UnaryExpression
8064
- | ArrayExpression
8065
- | ArrowFunctionExpression
8066
- | AssignmentExpression
8067
- | AwaitExpression
8068
- | BinaryExpression
8069
- | SimpleCallExpression
8070
- | NewExpression
8071
- | ChainExpression
8072
- | ClassExpression
8073
- | ConditionalExpression
8074
- | FunctionExpression
8075
- | Identifier
8076
- | ImportExpression
8077
- | SimpleLiteral
8078
- | RegExpLiteral
8079
- | BigIntLiteral
8080
- | LogicalExpression
8081
- | MemberExpression
8082
- | MetaProperty
8083
- | ObjectExpression
8084
- | SequenceExpression
8085
- | TaggedTemplateExpression
8086
- | TemplateLiteral
8087
- | ThisExpression
8088
- | UpdateExpression
8089
- | YieldExpression
8090
- | FunctionDeclaration
8091
- | VariableDeclaration
8092
- | ClassDeclaration
8093
- | PrivateIdentifier
8094
- | ExpressionStatement
8095
- | BlockStatement
8096
- | StaticBlock
8097
- | EmptyStatement
8098
- | DebuggerStatement
8099
- | WithStatement
8100
- | ReturnStatement
8101
- | LabeledStatement
8102
- | BreakStatement
8103
- | ContinueStatement
8104
- | IfStatement
8105
- | SwitchStatement
8106
- | ThrowStatement
8107
- | TryStatement
8108
- | WhileStatement
8109
- | DoWhileStatement
8110
- | ForStatement
8111
- | ForInStatement
8112
- | ForOfStatement
8113
- | ImportDeclaration
8114
- | ExportNamedDeclaration
8115
- | ExportDefaultDeclaration
8116
- | ExportAllDeclaration
8117
- | MethodDefinition
8118
- | PropertyDefinition
8119
- | VariableDeclarator
8120
- | Program
8121
- | SwitchCase
8122
- | CatchClause
8123
- | ObjectPattern
8124
- | ArrayPattern
8125
- | RestElement
8126
- | AssignmentPattern
8127
- | SpreadElement
8128
- | Property
8129
- | AssignmentProperty
8130
- | ClassBody
8131
- | ImportSpecifier
8132
- | ImportDefaultSpecifier
8133
- | ImportNamespaceSpecifier
8134
- | ExportSpecifier
8135
- | Super
8136
- | TemplateElement;
8137
8265
 
8138
8266
  /**
8139
8267
  * Options object for node compatibility features.
@@ -8184,7 +8312,6 @@ declare interface NodeTemplatePluginOptions {
8184
8312
  */
8185
8313
  asyncChunkLoading?: boolean;
8186
8314
  }
8187
- type NodeWebpackOptions = false | NodeOptions;
8188
8315
  declare class NormalModule extends Module {
8189
8316
  constructor(__0: NormalModuleCreateData);
8190
8317
  request: string;
@@ -8604,6 +8731,11 @@ declare interface Optimization {
8604
8731
  * Minimizer(s) to use for minimizing the output.
8605
8732
  */
8606
8733
  minimizer?: (
8734
+ | undefined
8735
+ | null
8736
+ | false
8737
+ | ""
8738
+ | 0
8607
8739
  | ((this: Compiler, compiler: Compiler) => void)
8608
8740
  | WebpackPluginInstance
8609
8741
  | "..."
@@ -9678,6 +9810,11 @@ declare interface PitchLoaderDefinitionFunction<
9678
9810
  ): string | void | Buffer | Promise<string | Buffer>;
9679
9811
  }
9680
9812
  type Plugin =
9813
+ | undefined
9814
+ | null
9815
+ | false
9816
+ | ""
9817
+ | 0
9681
9818
  | { apply: (arg0: Resolver) => void }
9682
9819
  | ((this: Resolver, arg1: Resolver) => void);
9683
9820
  declare interface PnpApiImpl {
@@ -9900,6 +10037,7 @@ declare interface ProvidesObject {
9900
10037
  declare interface RawChunkGroupOptions {
9901
10038
  preloadOrder?: number;
9902
10039
  prefetchOrder?: number;
10040
+ fetchPriority?: "auto" | "low" | "high";
9903
10041
  }
9904
10042
  type RawLoaderDefinition<
9905
10043
  OptionsType = {},
@@ -10406,7 +10544,15 @@ declare interface ResolveOptionsWebpackOptions {
10406
10544
  /**
10407
10545
  * Plugins for the resolver.
10408
10546
  */
10409
- plugins?: (ResolvePluginInstance | "...")[];
10547
+ plugins?: (
10548
+ | undefined
10549
+ | null
10550
+ | false
10551
+ | ""
10552
+ | 0
10553
+ | ResolvePluginInstance
10554
+ | "..."
10555
+ )[];
10410
10556
 
10411
10557
  /**
10412
10558
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -10746,7 +10892,7 @@ declare interface RuleSetRule {
10746
10892
  /**
10747
10893
  * Only execute the first matching rule in this array.
10748
10894
  */
10749
- oneOf?: RuleSetRule[];
10895
+ oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10750
10896
 
10751
10897
  /**
10752
10898
  * Shortcut for use.options.
@@ -10806,7 +10952,7 @@ declare interface RuleSetRule {
10806
10952
  /**
10807
10953
  * Match and execute these rules when this rule is matched.
10808
10954
  */
10809
- rules?: RuleSetRule[];
10955
+ rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
10810
10956
 
10811
10957
  /**
10812
10958
  * Match module scheme.
@@ -10843,14 +10989,52 @@ declare interface RuleSetRule {
10843
10989
  */
10844
10990
  use?:
10845
10991
  | string
10846
- | 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
+ )[]
10847
11031
  | ((data: {
10848
11032
  resource: string;
10849
11033
  realResource: string;
10850
11034
  resourceQuery: string;
10851
11035
  issuer: string;
10852
11036
  compiler: string;
10853
- }) => RuleSetUseItem[])
11037
+ }) => __Type_2[])
10854
11038
  | {
10855
11039
  /**
10856
11040
  * Unique loader options identifier.
@@ -10865,35 +11049,56 @@ declare interface RuleSetRule {
10865
11049
  */
10866
11050
  options?: string | { [index: string]: any };
10867
11051
  }
10868
- | ((data: object) =>
10869
- | string
10870
- | {
10871
- /**
10872
- * Unique loader options identifier.
10873
- */
10874
- ident?: string;
10875
- /**
10876
- * Loader name.
10877
- */
10878
- loader?: string;
10879
- /**
10880
- * Loader options.
10881
- */
10882
- options?: string | { [index: string]: any };
10883
- }
10884
- | __TypeWebpackOptions
10885
- | RuleSetUseItem[]);
11052
+ | __TypeWebpackOptions;
10886
11053
  }
10887
11054
  type RuleSetUse =
10888
11055
  | string
10889
- | 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
+ )[]
10890
11095
  | ((data: {
10891
11096
  resource: string;
10892
11097
  realResource: string;
10893
11098
  resourceQuery: string;
10894
11099
  issuer: string;
10895
11100
  compiler: string;
10896
- }) => RuleSetUseItem[])
11101
+ }) => __Type_2[])
10897
11102
  | {
10898
11103
  /**
10899
11104
  * Unique loader options identifier.
@@ -10984,20 +11189,20 @@ declare interface RuntimeRequirementsContext {
10984
11189
  type RuntimeSpec = undefined | string | SortableSet<string>;
10985
11190
  declare class RuntimeSpecMap<T> {
10986
11191
  constructor(clone?: RuntimeSpecMap<T>);
10987
- get(runtime: RuntimeSpec): T;
11192
+ get(runtime: RuntimeSpec): undefined | T;
10988
11193
  has(runtime: RuntimeSpec): boolean;
10989
11194
  set(runtime?: any, value?: any): void;
10990
11195
  provide(runtime?: any, computer?: any): any;
10991
- delete(runtime?: any): void;
11196
+ delete(runtime: RuntimeSpec): void;
10992
11197
  update(runtime?: any, fn?: any): void;
10993
11198
  keys(): RuntimeSpec[];
10994
11199
  values(): IterableIterator<T>;
10995
11200
  get size(): number;
10996
11201
  }
10997
11202
  declare class RuntimeSpecSet {
10998
- constructor(iterable?: any);
10999
- add(runtime?: any): void;
11000
- has(runtime?: any): boolean;
11203
+ constructor(iterable?: Iterable<RuntimeSpec>);
11204
+ add(runtime: RuntimeSpec): void;
11205
+ has(runtime: RuntimeSpec): boolean;
11001
11206
  get size(): number;
11002
11207
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
11003
11208
  }
@@ -12718,7 +12923,7 @@ declare interface UserResolveOptions {
12718
12923
  }
12719
12924
  declare abstract class VariableInfo {
12720
12925
  declaredScope: ScopeInfo;
12721
- freeName: string | true;
12926
+ freeName?: string | true;
12722
12927
  tagInfo?: TagInfo;
12723
12928
  }
12724
12929
  declare interface VariableInfoInterface {
@@ -12946,12 +13151,12 @@ declare class WebpackError extends Error {
12946
13151
  * Creates an instance of WebpackError.
12947
13152
  */
12948
13153
  constructor(message?: string);
12949
- details: any;
12950
- module: Module;
12951
- loc: DependencyLocation;
12952
- hideStack: boolean;
12953
- chunk: Chunk;
12954
- file: string;
13154
+ details?: string;
13155
+ module?: null | Module;
13156
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
13157
+ hideStack?: boolean;
13158
+ chunk?: Chunk;
13159
+ file?: string;
12955
13160
  serialize(__0: ObjectSerializerContext): void;
12956
13161
  deserialize(__0: ObjectDeserializerContext): void;
12957
13162
 
@@ -12999,7 +13204,7 @@ declare class WebpackOptionsApply extends OptionsApply {
12999
13204
  }
13000
13205
  declare class WebpackOptionsDefaulter {
13001
13206
  constructor();
13002
- process(options?: any): any;
13207
+ process(options: Configuration): WebpackOptionsNormalized;
13003
13208
  }
13004
13209
 
13005
13210
  /**
@@ -13123,7 +13328,7 @@ declare interface WebpackOptionsNormalized {
13123
13328
  /**
13124
13329
  * Include polyfills or mocks for various node stuff.
13125
13330
  */
13126
- node: NodeWebpackOptions;
13331
+ node: Node;
13127
13332
 
13128
13333
  /**
13129
13334
  * Enables/Disables integrated optimizations.
@@ -13149,6 +13354,11 @@ declare interface WebpackOptionsNormalized {
13149
13354
  * Add additional plugins to the compiler.
13150
13355
  */
13151
13356
  plugins: (
13357
+ | undefined
13358
+ | null
13359
+ | false
13360
+ | ""
13361
+ | 0
13152
13362
  | ((this: Compiler, compiler: Compiler) => void)
13153
13363
  | WebpackPluginInstance
13154
13364
  )[];
@@ -13246,7 +13456,45 @@ type __TypeWebpackOptions = (data: object) =>
13246
13456
  options?: string | { [index: string]: any };
13247
13457
  }
13248
13458
  | __TypeWebpackOptions
13249
- | 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[]);
13250
13498
  declare function exports(
13251
13499
  options: Configuration,
13252
13500
  callback?: CallbackWebpack<Stats>
@@ -13374,6 +13622,7 @@ declare namespace exports {
13374
13622
  export let createScript: "__webpack_require__.ts";
13375
13623
  export let createScriptUrl: "__webpack_require__.tu";
13376
13624
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
13625
+ export let hasFetchPriority: "has fetch priority";
13377
13626
  export let chunkName: "__webpack_require__.cn";
13378
13627
  export let runtimeId: "__webpack_require__.j";
13379
13628
  export let getChunkScriptFilename: "__webpack_require__.u";
@@ -13684,7 +13933,7 @@ declare namespace exports {
13684
13933
  export const register: (
13685
13934
  Constructor: Constructor,
13686
13935
  request: string,
13687
- name: string,
13936
+ name: null | string,
13688
13937
  serializer: ObjectSerializer
13689
13938
  ) => void;
13690
13939
  export const registerLoader: (