webpack 5.84.1 → 5.85.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 (121) hide show
  1. package/lib/AsyncDependenciesBlock.js +2 -2
  2. package/lib/AutomaticPrefetchPlugin.js +1 -0
  3. package/lib/BannerPlugin.js +4 -0
  4. package/lib/CacheFacade.js +4 -0
  5. package/lib/ChunkGroup.js +5 -1
  6. package/lib/CleanPlugin.js +30 -7
  7. package/lib/CompatibilityPlugin.js +1 -1
  8. package/lib/Compilation.js +1 -1
  9. package/lib/Compiler.js +1 -1
  10. package/lib/ContextModuleFactory.js +1 -1
  11. package/lib/DllModuleFactory.js +1 -1
  12. package/lib/HookWebpackError.js +1 -1
  13. package/lib/IgnoreErrorModuleFactory.js +1 -1
  14. package/lib/Module.js +21 -9
  15. package/lib/ModuleFactory.js +1 -1
  16. package/lib/ModuleTypeConstants.js +2 -1
  17. package/lib/NormalModuleFactory.js +1 -1
  18. package/lib/NormalModuleReplacementPlugin.js +4 -2
  19. package/lib/NullFactory.js +1 -1
  20. package/lib/RecordIdsPlugin.js +4 -4
  21. package/lib/RuntimeModule.js +5 -5
  22. package/lib/RuntimePlugin.js +4 -0
  23. package/lib/RuntimeTemplate.js +2 -2
  24. package/lib/SelfModuleFactory.js +1 -1
  25. package/lib/Template.js +1 -1
  26. package/lib/UseStrictPlugin.js +4 -0
  27. package/lib/WarnDeprecatedOptionPlugin.js +7 -0
  28. package/lib/WatchIgnorePlugin.js +4 -0
  29. package/lib/WebpackOptionsApply.js +2 -1
  30. package/lib/asset/AssetGenerator.js +7 -2
  31. package/lib/asset/AssetModulesPlugin.js +7 -1
  32. package/lib/asset/AssetParser.js +4 -1
  33. package/lib/asset/RawDataUrlModule.js +5 -3
  34. package/lib/async-modules/InferAsyncModulesPlugin.js +1 -1
  35. package/lib/cache/PackFileCacheStrategy.js +7 -1
  36. package/lib/config/defaults.js +38 -10
  37. package/lib/config/normalization.js +2 -1
  38. package/lib/container/ContainerEntryModule.js +4 -0
  39. package/lib/container/ContainerEntryModuleFactory.js +1 -1
  40. package/lib/container/FallbackDependency.js +7 -0
  41. package/lib/container/FallbackItemDependency.js +3 -0
  42. package/lib/container/FallbackModule.js +4 -0
  43. package/lib/container/FallbackModuleFactory.js +1 -1
  44. package/lib/container/RemoteModule.js +4 -0
  45. package/lib/container/RemoteRuntimeModule.js +1 -0
  46. package/lib/container/RemoteToExternalDependency.js +3 -0
  47. package/lib/dependencies/CommonJsPlugin.js +14 -12
  48. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +1 -1
  49. package/lib/dependencies/HarmonyExports.js +3 -1
  50. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +18 -5
  51. package/lib/dependencies/HarmonyImportSpecifierDependency.js +75 -6
  52. package/lib/dependencies/WorkerPlugin.js +25 -1
  53. package/lib/esm/ModuleChunkFormatPlugin.js +13 -5
  54. package/lib/esm/ModuleChunkLoadingPlugin.js +9 -0
  55. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +10 -8
  56. package/lib/hmr/LazyCompilationPlugin.js +1 -1
  57. package/lib/ids/ChunkModuleIdRangePlugin.js +11 -0
  58. package/lib/ids/DeterministicChunkIdsPlugin.js +11 -2
  59. package/lib/ids/DeterministicModuleIdsPlugin.js +11 -7
  60. package/lib/ids/HashedModuleIdsPlugin.js +8 -1
  61. package/lib/ids/IdHelpers.js +6 -0
  62. package/lib/ids/NamedChunkIdsPlugin.js +13 -1
  63. package/lib/ids/NamedModuleIdsPlugin.js +14 -3
  64. package/lib/ids/OccurrenceChunkIdsPlugin.js +6 -2
  65. package/lib/ids/SyncModuleIdsPlugin.js +2 -2
  66. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
  67. package/lib/javascript/BasicEvaluatedExpression.js +11 -1
  68. package/lib/javascript/ChunkHelpers.js +2 -2
  69. package/lib/javascript/EnableChunkLoadingPlugin.js +4 -0
  70. package/lib/javascript/JavascriptModulesPlugin.js +24 -19
  71. package/lib/javascript/JavascriptParser.js +40 -16
  72. package/lib/javascript/StartupHelpers.js +1 -1
  73. package/lib/json/JsonGenerator.js +7 -5
  74. package/lib/json/JsonParser.js +1 -1
  75. package/lib/library/AbstractLibraryPlugin.js +4 -0
  76. package/lib/library/AssignLibraryPlugin.js +6 -4
  77. package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
  78. package/lib/library/ModuleLibraryPlugin.js +6 -3
  79. package/lib/library/SystemLibraryPlugin.js +1 -0
  80. package/lib/library/UmdLibraryPlugin.js +4 -0
  81. package/lib/node/CommonJsChunkLoadingPlugin.js +17 -2
  82. package/lib/node/NodeTemplatePlugin.js +10 -2
  83. package/lib/node/NodeWatchFileSystem.js +1 -1
  84. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +4 -1
  85. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +8 -0
  86. package/lib/node/ReadFileCompileWasmPlugin.js +19 -2
  87. package/lib/node/RequireChunkLoadingRuntimeModule.js +4 -1
  88. package/lib/runtime/AsyncModuleRuntimeModule.js +1 -1
  89. package/lib/runtime/AutoPublicPathRuntimeModule.js +5 -1
  90. package/lib/runtime/BaseUriRuntimeModule.js +5 -1
  91. package/lib/runtime/EnsureChunkRuntimeModule.js +3 -0
  92. package/lib/runtime/GetChunkFilenameRuntimeModule.js +35 -16
  93. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
  94. package/lib/runtime/LoadScriptRuntimeModule.js +1 -1
  95. package/lib/runtime/PublicPathRuntimeModule.js +5 -0
  96. package/lib/runtime/StartupChunkDependenciesPlugin.js +15 -0
  97. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -0
  98. package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -0
  99. package/lib/sharing/ProvideSharedModuleFactory.js +1 -1
  100. package/lib/util/createHash.js +1 -1
  101. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +9 -0
  102. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +9 -1
  103. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +13 -3
  104. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +19 -2
  105. package/lib/wasm-async/AsyncWebAssemblyParser.js +3 -0
  106. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +25 -1
  107. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +14 -5
  108. package/lib/wasm-sync/WebAssemblyGenerator.js +18 -5
  109. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
  110. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +12 -1
  111. package/lib/wasm-sync/WebAssemblyParser.js +9 -2
  112. package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
  113. package/lib/web/FetchCompileAsyncWasmPlugin.js +9 -0
  114. package/lib/web/FetchCompileWasmPlugin.js +19 -2
  115. package/lib/web/JsonpChunkLoadingPlugin.js +9 -0
  116. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +9 -0
  117. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  118. package/package.json +1 -1
  119. package/schemas/WebpackOptions.check.js +1 -1
  120. package/schemas/WebpackOptions.json +12 -0
  121. package/types.d.ts +186 -141
@@ -744,10 +744,18 @@
744
744
  "description": "The environment supports an async import() function to import EcmaScript modules.",
745
745
  "type": "boolean"
746
746
  },
747
+ "dynamicImportInWorker": {
748
+ "description": "The environment supports an async import() is available when creating a worker.",
749
+ "type": "boolean"
750
+ },
747
751
  "forOf": {
748
752
  "description": "The environment supports 'for of' iteration ('for (const x of array) { ... }').",
749
753
  "type": "boolean"
750
754
  },
755
+ "globalThis": {
756
+ "description": "The environment supports 'globalThis'.",
757
+ "type": "boolean"
758
+ },
751
759
  "module": {
752
760
  "description": "The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').",
753
761
  "type": "boolean"
@@ -1254,6 +1262,10 @@
1254
1262
  "description": "Track and log detailed timing information for individual cache items.",
1255
1263
  "type": "boolean"
1256
1264
  },
1265
+ "readonly": {
1266
+ "description": "Enable/disable readonly mode.",
1267
+ "type": "boolean"
1268
+ },
1257
1269
  "store": {
1258
1270
  "description": "When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).",
1259
1271
  "enum": ["pack"]
package/types.d.ts CHANGED
@@ -356,7 +356,7 @@ declare class AsyncDependenciesBlock extends DependenciesBlock {
356
356
  };
357
357
  loc?: SyntheticDependencyLocation | RealDependencyLocation;
358
358
  request?: string;
359
- chunkName: string;
359
+ chunkName?: string;
360
360
  module: any;
361
361
  }
362
362
  declare abstract class AsyncQueue<T, K, R> {
@@ -383,18 +383,28 @@ declare abstract class AsyncQueue<T, K, R> {
383
383
  clear(): void;
384
384
  }
385
385
  declare class AsyncWebAssemblyModulesPlugin {
386
- constructor(options?: any);
387
- options: any;
386
+ constructor(options: AsyncWebAssemblyModulesPluginOptions);
387
+ options: AsyncWebAssemblyModulesPluginOptions;
388
388
 
389
389
  /**
390
390
  * Apply the plugin
391
391
  */
392
392
  apply(compiler: Compiler): void;
393
- renderModule(module?: any, renderContext?: any, hooks?: any): any;
393
+ renderModule(
394
+ module: Module,
395
+ renderContext: WebAssemblyRenderContext,
396
+ hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
397
+ ): Source;
394
398
  static getCompilationHooks(
395
399
  compilation: Compilation
396
400
  ): CompilationHooksAsyncWebAssemblyModulesPlugin;
397
401
  }
402
+ declare interface AsyncWebAssemblyModulesPluginOptions {
403
+ /**
404
+ * mangle imports
405
+ */
406
+ mangleImports?: boolean;
407
+ }
398
408
  declare class AutomaticPrefetchPlugin {
399
409
  constructor();
400
410
 
@@ -497,6 +507,7 @@ declare abstract class BasicEvaluatedExpression {
497
507
  rootInfo: string | VariableInfoInterface;
498
508
  getMembers: () => string[];
499
509
  getMembersOptionals: () => boolean[];
510
+ getMemberRangeStarts: () => number[];
500
511
  expression: NodeEstreeIndex;
501
512
  isUnknown(): boolean;
502
513
  isNull(): boolean;
@@ -581,7 +592,8 @@ declare abstract class BasicEvaluatedExpression {
581
592
  identifier: string | VariableInfoInterface,
582
593
  rootInfo: string | VariableInfoInterface,
583
594
  getMembers: () => string[],
584
- getMembersOptionals?: () => boolean[]
595
+ getMembersOptionals?: () => boolean[],
596
+ getMemberRangeStarts?: () => number[]
585
597
  ): BasicEvaluatedExpression;
586
598
 
587
599
  /**
@@ -776,6 +788,7 @@ declare interface CallExpressionInfo {
776
788
  name: string;
777
789
  getMembers: () => string[];
778
790
  getMembersOptionals: () => boolean[];
791
+ getMemberRangeStarts: () => number[];
779
792
  }
780
793
  declare interface CallbackAsyncQueue<T> {
781
794
  (err?: null | WebpackError, result?: T): any;
@@ -1106,9 +1119,9 @@ declare abstract class ChunkGroup {
1106
1119
  removeParent(chunkGroup: ChunkGroup): boolean;
1107
1120
  addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
1108
1121
  get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
1109
- getBlocks(): any[];
1122
+ getBlocks(): AsyncDependenciesBlock[];
1110
1123
  getNumberOfBlocks(): number;
1111
- hasBlock(block?: any): boolean;
1124
+ hasBlock(block: AsyncDependenciesBlock): boolean;
1112
1125
  get blocksIterable(): Iterable<AsyncDependenciesBlock>;
1113
1126
  addBlock(block: AsyncDependenciesBlock): boolean;
1114
1127
  addOrigin(module: Module, loc: DependencyLocation, request: string): void;
@@ -1177,14 +1190,35 @@ declare interface ChunkMaps {
1177
1190
  name: Record<string | number, string>;
1178
1191
  }
1179
1192
  declare class ChunkModuleIdRangePlugin {
1180
- constructor(options?: any);
1181
- options: any;
1193
+ constructor(options: ChunkModuleIdRangePluginOptions);
1194
+ options: ChunkModuleIdRangePluginOptions;
1182
1195
 
1183
1196
  /**
1184
1197
  * Apply the plugin
1185
1198
  */
1186
1199
  apply(compiler: Compiler): void;
1187
1200
  }
1201
+ declare interface ChunkModuleIdRangePluginOptions {
1202
+ /**
1203
+ * the chunk name
1204
+ */
1205
+ name: string;
1206
+
1207
+ /**
1208
+ * order
1209
+ */
1210
+ order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
1211
+
1212
+ /**
1213
+ * start id
1214
+ */
1215
+ start?: number;
1216
+
1217
+ /**
1218
+ * end id
1219
+ */
1220
+ end?: number;
1221
+ }
1188
1222
  declare interface ChunkModuleMaps {
1189
1223
  id: Record<string | number, (string | number)[]>;
1190
1224
  hash: Record<string | number, string>;
@@ -1482,7 +1516,7 @@ declare class Compilation {
1482
1516
  any
1483
1517
  >;
1484
1518
  afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
1485
- shouldRecord: SyncBailHook<[], boolean>;
1519
+ shouldRecord: SyncBailHook<[], undefined | boolean>;
1486
1520
  additionalChunkRuntimeRequirements: SyncHook<
1487
1521
  [Chunk, Set<string>, RuntimeRequirementsContext]
1488
1522
  >;
@@ -1990,8 +2024,8 @@ declare interface CompilationHooksJavascriptModulesPlugin {
1990
2024
  [Module, RenderBootstrapContext],
1991
2025
  string
1992
2026
  >;
1993
- embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
1994
- strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
2027
+ embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
2028
+ strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
1995
2029
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
1996
2030
  useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
1997
2031
  }
@@ -2006,7 +2040,7 @@ declare class Compiler {
2006
2040
  constructor(context: string, options?: WebpackOptionsNormalized);
2007
2041
  hooks: Readonly<{
2008
2042
  initialize: SyncHook<[]>;
2009
- shouldEmit: SyncBailHook<[Compilation], boolean>;
2043
+ shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
2010
2044
  done: AsyncSeriesHook<[Stats]>;
2011
2045
  afterDone: SyncHook<[Stats]>;
2012
2046
  additionalPass: AsyncSeriesHook<[]>;
@@ -2892,73 +2926,65 @@ declare abstract class DependencyTemplates {
2892
2926
  clone(): DependencyTemplates;
2893
2927
  }
2894
2928
  declare class DeterministicChunkIdsPlugin {
2895
- constructor(options?: any);
2896
- options: any;
2929
+ constructor(options?: DeterministicChunkIdsPluginOptions);
2930
+ options: DeterministicChunkIdsPluginOptions;
2897
2931
 
2898
2932
  /**
2899
2933
  * Apply the plugin
2900
2934
  */
2901
2935
  apply(compiler: Compiler): void;
2902
2936
  }
2937
+ declare interface DeterministicChunkIdsPluginOptions {
2938
+ /**
2939
+ * context for ids
2940
+ */
2941
+ context?: string;
2942
+
2943
+ /**
2944
+ * maximum length of ids
2945
+ */
2946
+ maxLength?: number;
2947
+ }
2903
2948
  declare class DeterministicModuleIdsPlugin {
2904
- constructor(options?: {
2905
- /**
2906
- * context relative to which module identifiers are computed
2907
- */
2908
- context?: string;
2909
- /**
2910
- * selector function for modules
2911
- */
2912
- test?: (arg0: Module) => boolean;
2913
- /**
2914
- * maximum id length in digits (used as starting point)
2915
- */
2916
- maxLength?: number;
2917
- /**
2918
- * hash salt for ids
2919
- */
2920
- salt?: number;
2921
- /**
2922
- * do not increase the maxLength to find an optimal id space size
2923
- */
2924
- fixedLength?: boolean;
2925
- /**
2926
- * throw an error when id conflicts occur (instead of rehashing)
2927
- */
2928
- failOnConflict?: boolean;
2929
- });
2930
- options: {
2931
- /**
2932
- * context relative to which module identifiers are computed
2933
- */
2934
- context?: string;
2935
- /**
2936
- * selector function for modules
2937
- */
2938
- test?: (arg0: Module) => boolean;
2939
- /**
2940
- * maximum id length in digits (used as starting point)
2941
- */
2942
- maxLength?: number;
2943
- /**
2944
- * hash salt for ids
2945
- */
2946
- salt?: number;
2947
- /**
2948
- * do not increase the maxLength to find an optimal id space size
2949
- */
2950
- fixedLength?: boolean;
2951
- /**
2952
- * throw an error when id conflicts occur (instead of rehashing)
2953
- */
2954
- failOnConflict?: boolean;
2955
- };
2949
+ constructor(options?: DeterministicModuleIdsPluginOptions);
2950
+ options: DeterministicModuleIdsPluginOptions;
2956
2951
 
2957
2952
  /**
2958
2953
  * Apply the plugin
2959
2954
  */
2960
2955
  apply(compiler: Compiler): void;
2961
2956
  }
2957
+ declare interface DeterministicModuleIdsPluginOptions {
2958
+ /**
2959
+ * context relative to which module identifiers are computed
2960
+ */
2961
+ context?: string;
2962
+
2963
+ /**
2964
+ * selector function for modules
2965
+ */
2966
+ test?: (arg0: Module) => boolean;
2967
+
2968
+ /**
2969
+ * maximum id length in digits (used as starting point)
2970
+ */
2971
+ maxLength?: number;
2972
+
2973
+ /**
2974
+ * hash salt for ids
2975
+ */
2976
+ salt?: number;
2977
+
2978
+ /**
2979
+ * do not increase the maxLength to find an optimal id space size
2980
+ */
2981
+ fixedLength?: boolean;
2982
+
2983
+ /**
2984
+ * throw an error when id conflicts occur (instead of rehashing)
2985
+ */
2986
+ failOnConflict?: boolean;
2987
+ }
2962
2988
 
2963
2989
  /**
2964
2990
  * Options for the webpack-dev-server.
@@ -3491,11 +3517,21 @@ declare interface Environment {
3491
3517
  */
3492
3518
  dynamicImport?: boolean;
3493
3519
 
3520
+ /**
3521
+ * The environment supports an async import() is available when creating a worker.
3522
+ */
3523
+ dynamicImportInWorker?: boolean;
3524
+
3494
3525
  /**
3495
3526
  * The environment supports 'for of' iteration ('for (const x of array) { ... }').
3496
3527
  */
3497
3528
  forOf?: boolean;
3498
3529
 
3530
+ /**
3531
+ * The environment supports 'globalThis'.
3532
+ */
3533
+ globalThis?: boolean;
3534
+
3499
3535
  /**
3500
3536
  * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
3501
3537
  */
@@ -3955,6 +3991,7 @@ declare interface ExpressionExpressionInfo {
3955
3991
  name: string;
3956
3992
  getMembers: () => string[];
3957
3993
  getMembersOptionals: () => boolean[];
3994
+ getMemberRangeStarts: () => number[];
3958
3995
  }
3959
3996
  declare interface ExtensionAliasOption {
3960
3997
  alias: string | string[];
@@ -4168,14 +4205,20 @@ declare class FetchCompileAsyncWasmPlugin {
4168
4205
  apply(compiler: Compiler): void;
4169
4206
  }
4170
4207
  declare class FetchCompileWasmPlugin {
4171
- constructor(options?: any);
4172
- options: any;
4208
+ constructor(options?: FetchCompileWasmPluginOptions);
4209
+ options: FetchCompileWasmPluginOptions;
4173
4210
 
4174
4211
  /**
4175
4212
  * Apply the plugin
4176
4213
  */
4177
4214
  apply(compiler: Compiler): void;
4178
4215
  }
4216
+ declare interface FetchCompileWasmPluginOptions {
4217
+ /**
4218
+ * mangle imports
4219
+ */
4220
+ mangleImports?: boolean;
4221
+ }
4179
4222
 
4180
4223
  /**
4181
4224
  * Options object for persistent file-based caching.
@@ -4261,6 +4304,11 @@ declare interface FileCacheOptions {
4261
4304
  */
4262
4305
  profile?: boolean;
4263
4306
 
4307
+ /**
4308
+ * Enable/disable readonly mode.
4309
+ */
4310
+ readonly?: boolean;
4311
+
4264
4312
  /**
4265
4313
  * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
4266
4314
  */
@@ -4679,7 +4727,11 @@ declare interface HashableObject {
4679
4727
  declare class HashedModuleIdsPlugin {
4680
4728
  constructor(options?: HashedModuleIdsPluginOptions);
4681
4729
  options: HashedModuleIdsPluginOptions;
4682
- apply(compiler?: any): void;
4730
+
4731
+ /**
4732
+ * Apply the plugin
4733
+ */
4734
+ apply(compiler: Compiler): void;
4683
4735
  }
4684
4736
  declare interface HashedModuleIdsPluginOptions {
4685
4737
  /**
@@ -5291,7 +5343,10 @@ declare class JavascriptParser extends Parser {
5291
5343
  topLevelAwait: SyncBailHook<[Expression], boolean | void>;
5292
5344
  call: HookMap<SyncBailHook<[BaseCallExpression], boolean | void>>;
5293
5345
  callMemberChain: HookMap<
5294
- SyncBailHook<[CallExpression, string[], boolean[]], boolean | void>
5346
+ SyncBailHook<
5347
+ [CallExpression, string[], boolean[], number[]],
5348
+ boolean | void
5349
+ >
5295
5350
  >;
5296
5351
  memberChainOfCallMemberChain: HookMap<
5297
5352
  SyncBailHook<
@@ -5310,7 +5365,7 @@ declare class JavascriptParser extends Parser {
5310
5365
  binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
5311
5366
  expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
5312
5367
  expressionMemberChain: HookMap<
5313
- SyncBailHook<[Expression, string[], boolean[]], boolean | void>
5368
+ SyncBailHook<[Expression, string[], boolean[], number[]], boolean | void>
5314
5369
  >;
5315
5370
  unhandledExpressionMemberChain: HookMap<
5316
5371
  SyncBailHook<[Expression, string[]], boolean | void>
@@ -5899,6 +5954,7 @@ declare class JavascriptParser extends Parser {
5899
5954
  | YieldExpression
5900
5955
  | Super;
5901
5956
  membersOptionals: boolean[];
5957
+ memberRangeStarts: number[];
5902
5958
  };
5903
5959
  getFreeInfoFromVariable(varName: string): {
5904
5960
  name: string;
@@ -7028,6 +7084,12 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
7028
7084
  * Example: "web"
7029
7085
  */
7030
7086
  target: string;
7087
+
7088
+ /**
7089
+ * Tell what kind of ES-features may be used in the generated runtime-code.
7090
+ * Example: { arrowFunction: true }
7091
+ */
7092
+ environment: Environment;
7031
7093
  }
7032
7094
  declare class LoaderTargetPlugin {
7033
7095
  constructor(target: string);
@@ -7191,64 +7253,18 @@ declare interface MinChunkSizePluginOptions {
7191
7253
  minChunkSize: number;
7192
7254
  }
7193
7255
  declare class Module extends DependenciesBlock {
7194
- constructor(
7195
- type:
7196
- | ""
7197
- | "runtime"
7198
- | "javascript/auto"
7199
- | "javascript/dynamic"
7200
- | "javascript/esm"
7201
- | "json"
7202
- | "webassembly/async"
7203
- | "webassembly/sync"
7204
- | "css"
7205
- | "css/global"
7206
- | "css/module"
7207
- | "asset"
7208
- | "asset/inline"
7209
- | "asset/resource"
7210
- | "asset/source"
7211
- | "asset/raw-data-url"
7212
- | "fallback-module"
7213
- | "remote-module"
7214
- | "provide-module"
7215
- | "consume-shared-module"
7216
- | "lazy-compilation-proxy",
7217
- context?: string,
7218
- layer?: string
7219
- );
7220
- type:
7221
- | ""
7222
- | "runtime"
7223
- | "javascript/auto"
7224
- | "javascript/dynamic"
7225
- | "javascript/esm"
7226
- | "json"
7227
- | "webassembly/async"
7228
- | "webassembly/sync"
7229
- | "css"
7230
- | "css/global"
7231
- | "css/module"
7232
- | "asset"
7233
- | "asset/inline"
7234
- | "asset/resource"
7235
- | "asset/source"
7236
- | "asset/raw-data-url"
7237
- | "fallback-module"
7238
- | "remote-module"
7239
- | "provide-module"
7240
- | "consume-shared-module"
7241
- | "lazy-compilation-proxy";
7256
+ constructor(type: string, context?: null | string, layer?: null | string);
7257
+ type: string;
7242
7258
  context: null | string;
7243
7259
  layer: null | string;
7244
7260
  needId: boolean;
7245
7261
  debugId: number;
7246
- resolveOptions: ResolveOptionsWebpackOptions;
7262
+ resolveOptions?: ResolveOptionsWebpackOptions;
7247
7263
  factoryMeta?: object;
7248
7264
  useSourceMap: boolean;
7249
7265
  useSimpleSourceMap: boolean;
7250
- buildMeta: BuildMeta;
7251
- buildInfo: Record<string, any>;
7266
+ buildMeta?: BuildMeta;
7267
+ buildInfo?: Record<string, any>;
7252
7268
  presentationalDependencies?: Dependency[];
7253
7269
  codeGenerationDependencies?: Dependency[];
7254
7270
  id: string | number;
@@ -7265,9 +7281,9 @@ declare class Module extends DependenciesBlock {
7265
7281
  | ((requestShortener: RequestShortener) => string)
7266
7282
  )[];
7267
7283
  get optional(): boolean;
7268
- addChunk(chunk?: any): boolean;
7269
- removeChunk(chunk?: any): void;
7270
- isInChunk(chunk?: any): boolean;
7284
+ addChunk(chunk: Chunk): boolean;
7285
+ removeChunk(chunk: Chunk): void;
7286
+ isInChunk(chunk: Chunk): boolean;
7271
7287
  isEntryModule(): boolean;
7272
7288
  getChunks(): Chunk[];
7273
7289
  getNumberOfChunks(): number;
@@ -7397,7 +7413,7 @@ declare class ModuleDependency extends Dependency {
7397
7413
  declare abstract class ModuleFactory {
7398
7414
  create(
7399
7415
  data: ModuleFactoryCreateData,
7400
- callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
7416
+ callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
7401
7417
  ): void;
7402
7418
  }
7403
7419
  declare interface ModuleFactoryCreateData {
@@ -7960,24 +7976,41 @@ declare abstract class MultiWatching {
7960
7976
  close(callback: CallbackFunction<void>): void;
7961
7977
  }
7962
7978
  declare class NamedChunkIdsPlugin {
7963
- constructor(options?: any);
7964
- delimiter: any;
7965
- context: any;
7979
+ constructor(options?: NamedChunkIdsPluginOptions);
7980
+ delimiter: string;
7981
+ context?: string;
7966
7982
 
7967
7983
  /**
7968
7984
  * Apply the plugin
7969
7985
  */
7970
7986
  apply(compiler: Compiler): void;
7971
7987
  }
7988
+ declare interface NamedChunkIdsPluginOptions {
7989
+ /**
7990
+ * context
7991
+ */
7992
+ context?: string;
7993
+
7994
+ /**
7995
+ * delimiter
7996
+ */
7997
+ delimiter?: string;
7998
+ }
7972
7999
  declare class NamedModuleIdsPlugin {
7973
- constructor(options?: any);
7974
- options: any;
8000
+ constructor(options?: NamedModuleIdsPluginOptions);
8001
+ options: NamedModuleIdsPluginOptions;
7975
8002
 
7976
8003
  /**
7977
8004
  * Apply the plugin
7978
8005
  */
7979
8006
  apply(compiler: Compiler): void;
7980
8007
  }
8008
+ declare interface NamedModuleIdsPluginOptions {
8009
+ /**
8010
+ * context
8011
+ */
8012
+ context?: string;
8013
+ }
7981
8014
  declare class NaturalModuleIdsPlugin {
7982
8015
  constructor();
7983
8016
 
@@ -8130,13 +8163,19 @@ declare class NodeTargetPlugin {
8130
8163
  apply(compiler: Compiler): void;
8131
8164
  }
8132
8165
  declare class NodeTemplatePlugin {
8133
- constructor(options?: any);
8166
+ constructor(options?: NodeTemplatePluginOptions);
8134
8167
 
8135
8168
  /**
8136
8169
  * Apply the plugin
8137
8170
  */
8138
8171
  apply(compiler: Compiler): void;
8139
8172
  }
8173
+ declare interface NodeTemplatePluginOptions {
8174
+ /**
8175
+ * enable async chunk loading
8176
+ */
8177
+ asyncChunkLoading?: boolean;
8178
+ }
8140
8179
  type NodeWebpackOptions = false | NodeOptions;
8141
8180
  declare class NormalModule extends Module {
8142
8181
  constructor(__0: NormalModuleCreateData);
@@ -9886,14 +9925,20 @@ declare interface RawSourceMap {
9886
9925
  file: string;
9887
9926
  }
9888
9927
  declare class ReadFileCompileWasmPlugin {
9889
- constructor(options?: any);
9890
- options: any;
9928
+ constructor(options?: ReadFileCompileWasmPluginOptions);
9929
+ options: ReadFileCompileWasmPluginOptions;
9891
9930
 
9892
9931
  /**
9893
9932
  * Apply the plugin
9894
9933
  */
9895
9934
  apply(compiler: Compiler): void;
9896
9935
  }
9936
+ declare interface ReadFileCompileWasmPluginOptions {
9937
+ /**
9938
+ * mangle imports
9939
+ */
9940
+ mangleImports?: boolean;
9941
+ }
9897
9942
  declare interface ReaddirOptions {
9898
9943
  encoding?:
9899
9944
  | null
@@ -10883,9 +10928,9 @@ declare class RuntimeModule extends Module {
10883
10928
  constructor(name: string, stage?: number);
10884
10929
  name: string;
10885
10930
  stage: number;
10886
- compilation: Compilation;
10887
- chunk: Chunk;
10888
- chunkGraph: ChunkGraph;
10931
+ compilation?: Compilation;
10932
+ chunk?: Chunk;
10933
+ chunkGraph?: ChunkGraph;
10889
10934
  fullHash: boolean;
10890
10935
  dependentHash: boolean;
10891
10936
  attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
@@ -11254,7 +11299,7 @@ declare abstract class RuntimeTemplate {
11254
11299
  /**
11255
11300
  * when false, call context will not be preserved
11256
11301
  */
11257
- callContext: boolean;
11302
+ callContext: null | boolean;
11258
11303
  /**
11259
11304
  * when true and accessing the default exports, interop code will be generated
11260
11305
  */
@@ -12460,7 +12505,7 @@ declare class Template {
12460
12505
  modules: Module[],
12461
12506
  renderModule: (arg0: Module) => Source,
12462
12507
  prefix?: string
12463
- ): Source;
12508
+ ): null | Source;
12464
12509
  static renderRuntimeModules(
12465
12510
  runtimeModules: RuntimeModule[],
12466
12511
  renderContext: RenderContext & {
@@ -13514,7 +13559,7 @@ declare namespace exports {
13514
13559
  export { ProfilingPlugin };
13515
13560
  }
13516
13561
  export namespace util {
13517
- export const createHash: (algorithm: string | typeof Hash) => Hash;
13562
+ export const createHash: (algorithm?: string | typeof Hash) => Hash;
13518
13563
  export namespace comparators {
13519
13564
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
13520
13565
  export let compareModulesByIdentifier: (