webpack 5.53.0 → 5.56.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 (64) hide show
  1. package/lib/AsyncDependenciesBlock.js +9 -2
  2. package/lib/CacheFacade.js +10 -3
  3. package/lib/ChunkGraph.js +19 -8
  4. package/lib/CodeGenerationResults.js +7 -2
  5. package/lib/Compilation.js +586 -143
  6. package/lib/Compiler.js +13 -4
  7. package/lib/DefinePlugin.js +13 -8
  8. package/lib/Dependency.js +11 -0
  9. package/lib/DependencyTemplates.js +8 -2
  10. package/lib/EvalDevToolModulePlugin.js +2 -1
  11. package/lib/EvalSourceMapDevToolPlugin.js +2 -1
  12. package/lib/ExternalModule.js +18 -9
  13. package/lib/FileSystemInfo.js +101 -170
  14. package/lib/FlagDependencyExportsPlugin.js +25 -16
  15. package/lib/JavascriptMetaInfoPlugin.js +6 -1
  16. package/lib/ModuleFactory.js +1 -0
  17. package/lib/ModuleFilenameHelpers.js +21 -7
  18. package/lib/ModuleGraph.js +90 -21
  19. package/lib/NormalModuleFactory.js +8 -43
  20. package/lib/SourceMapDevToolPlugin.js +7 -3
  21. package/lib/WebpackOptionsApply.js +19 -1
  22. package/lib/cache/PackFileCacheStrategy.js +2 -1
  23. package/lib/cache/getLazyHashedEtag.js +35 -8
  24. package/lib/config/defaults.js +18 -7
  25. package/lib/dependencies/CachedConstDependency.js +4 -3
  26. package/lib/dependencies/CommonJsExportRequireDependency.js +19 -9
  27. package/lib/dependencies/CommonJsFullRequireDependency.js +11 -9
  28. package/lib/dependencies/ConstDependency.js +12 -4
  29. package/lib/dependencies/ContextDependency.js +8 -0
  30. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +179 -163
  31. package/lib/dependencies/HarmonyImportDependency.js +4 -1
  32. package/lib/dependencies/JsonExportsDependency.js +7 -1
  33. package/lib/dependencies/ModuleDecoratorDependency.js +5 -2
  34. package/lib/dependencies/ModuleDependency.js +8 -0
  35. package/lib/dependencies/NullDependency.js +8 -4
  36. package/lib/dependencies/ProvidedDependency.js +6 -2
  37. package/lib/dependencies/PureExpressionDependency.js +5 -1
  38. package/lib/dependencies/RuntimeRequirementsDependency.js +5 -1
  39. package/lib/dependencies/WebAssemblyExportImportedDependency.js +9 -0
  40. package/lib/ids/IdHelpers.js +21 -8
  41. package/lib/ids/NamedChunkIdsPlugin.js +3 -0
  42. package/lib/ids/NamedModuleIdsPlugin.js +3 -1
  43. package/lib/index.js +6 -0
  44. package/lib/javascript/BasicEvaluatedExpression.js +3 -0
  45. package/lib/javascript/JavascriptParser.js +22 -4
  46. package/lib/javascript/JavascriptParserHelpers.js +0 -2
  47. package/lib/optimize/ConcatenatedModule.js +25 -4
  48. package/lib/optimize/InnerGraph.js +22 -2
  49. package/lib/optimize/ModuleConcatenationPlugin.js +2 -1
  50. package/lib/schemes/HttpUriPlugin.js +1 -2
  51. package/lib/serialization/BinaryMiddleware.js +11 -2
  52. package/lib/serialization/FileMiddleware.js +24 -7
  53. package/lib/serialization/ObjectMiddleware.js +19 -8
  54. package/lib/util/WeakTupleMap.js +95 -92
  55. package/lib/util/createHash.js +10 -0
  56. package/lib/util/hash/BatchedHash.js +65 -0
  57. package/lib/util/hash/xxhash64.js +154 -0
  58. package/lib/util/serialization.js +4 -4
  59. package/package.json +10 -6
  60. package/schemas/WebpackOptions.check.js +1 -1
  61. package/schemas/WebpackOptions.json +12 -0
  62. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  63. package/schemas/plugins/HashedModuleIdsPlugin.json +20 -2
  64. package/types.d.ts +205 -20
@@ -699,6 +699,10 @@
699
699
  }
700
700
  ]
701
701
  },
702
+ "cacheUnaffected": {
703
+ "description": "Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.",
704
+ "type": "boolean"
705
+ },
702
706
  "futureDefaults": {
703
707
  "description": "Apply defaults of next major version.",
704
708
  "type": "boolean"
@@ -1027,6 +1031,10 @@
1027
1031
  "type": "number",
1028
1032
  "minimum": 0
1029
1033
  },
1034
+ "memoryCacheUnaffected": {
1035
+ "description": "Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.",
1036
+ "type": "boolean"
1037
+ },
1030
1038
  "name": {
1031
1039
  "description": "Name for the cache. Different names will lead to different coexisting caches.",
1032
1040
  "type": "string"
@@ -1655,6 +1663,10 @@
1655
1663
  "type": "object",
1656
1664
  "additionalProperties": false,
1657
1665
  "properties": {
1666
+ "cacheUnaffected": {
1667
+ "description": "Additionally cache computation of modules that are unchanged and reference only unchanged modules.",
1668
+ "type": "boolean"
1669
+ },
1658
1670
  "maxGenerations": {
1659
1671
  "description": "Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).",
1660
1672
  "type": "number",
@@ -3,4 +3,4 @@
3
3
  * DO NOT MODIFY BY HAND.
4
4
  * Run `yarn special-lint-fix` to update
5
5
  */
6
- const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function t(e,{instancePath:s="",parentData:i,parentDataProperty:n,rootData:a=e}={}){if(!e||"object"!=typeof e||Array.isArray(e))return t.errors=[{params:{type:"object"}}],!1;{const s=0;for(const r in e)if("context"!==r&&"hashDigest"!==r&&"hashDigestLength"!==r&&"hashFunction"!==r)return t.errors=[{params:{additionalProperty:r}}],!1;if(0===s){if(void 0!==e.context){let s=e.context;const i=0;if(0===i){if("string"!=typeof s)return t.errors=[{params:{type:"string"}}],!1;if(s.includes("!")||!0!==r.test(s))return t.errors=[{params:{}}],!1}var o=0===i}else o=!0;if(o){if(void 0!==e.hashDigest){let r=e.hashDigest;const s=0;if("hex"!==r&&"latin1"!==r&&"base64"!==r)return t.errors=[{params:{}}],!1;o=0===s}else o=!0;if(o){if(void 0!==e.hashDigestLength){let r=e.hashDigestLength;const s=0;if(0===s){if("number"!=typeof r||!isFinite(r))return t.errors=[{params:{type:"number"}}],!1;if(r<1||isNaN(r))return t.errors=[{params:{comparison:">=",limit:1}}],!1}o=0===s}else o=!0;if(o)if(void 0!==e.hashFunction){let r=e.hashFunction;const s=0;if(0===s){if("string"!=typeof r)return t.errors=[{params:{type:"string"}}],!1;if(r.length<1)return t.errors=[{params:{}}],!1}o=0===s}else o=!0}}}}return t.errors=null,!0}module.exports=t,module.exports.default=t;
6
+ const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function e(r,{instancePath:s="",parentData:n,parentDataProperty:i,rootData:a=r}={}){let o=null,l=0;if(0===l){if(!r||"object"!=typeof r||Array.isArray(r))return e.errors=[{params:{type:"object"}}],!1;{const s=l;for(const t in r)if("context"!==t&&"hashDigest"!==t&&"hashDigestLength"!==t&&"hashFunction"!==t)return e.errors=[{params:{additionalProperty:t}}],!1;if(s===l){if(void 0!==r.context){let s=r.context;const n=l;if(l===n){if("string"!=typeof s)return e.errors=[{params:{type:"string"}}],!1;if(s.includes("!")||!0!==t.test(s))return e.errors=[{params:{}}],!1}var u=n===l}else u=!0;if(u){if(void 0!==r.hashDigest){let t=r.hashDigest;const s=l;if("hex"!==t&&"latin1"!==t&&"base64"!==t)return e.errors=[{params:{}}],!1;u=s===l}else u=!0;if(u){if(void 0!==r.hashDigestLength){let t=r.hashDigestLength;const s=l;if(l===s){if("number"!=typeof t||!isFinite(t))return e.errors=[{params:{type:"number"}}],!1;if(t<1||isNaN(t))return e.errors=[{params:{comparison:">=",limit:1}}],!1}u=s===l}else u=!0;if(u)if(void 0!==r.hashFunction){let t=r.hashFunction;const s=l,n=l;let i=!1,a=null;const p=l,h=l;let c=!1;const m=l;if(l===m)if("string"==typeof t){if(t.length<1){const t={params:{}};null===o?o=[t]:o.push(t),l++}}else{const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}var f=m===l;if(c=c||f,!c){const e=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=e===l,c=c||f}if(c)l=h,null!==o&&(h?o.length=h:o=null);else{const t={params:{}};null===o?o=[t]:o.push(t),l++}if(p===l&&(i=!0,a=0),!i){const t={params:{passingSchemas:a}};return null===o?o=[t]:o.push(t),l++,e.errors=o,!1}l=n,null!==o&&(n?o.length=n:o=null),u=s===l}else u=!0}}}}}return e.errors=o,0===l}module.exports=e,module.exports.default=e;
@@ -1,4 +1,19 @@
1
1
  {
2
+ "definitions": {
3
+ "HashFunction": {
4
+ "description": "Algorithm used for generation the hash (see node.js crypto package).",
5
+ "anyOf": [
6
+ {
7
+ "type": "string",
8
+ "minLength": 1
9
+ },
10
+ {
11
+ "instanceof": "Function",
12
+ "tsType": "typeof import('../../lib/util/Hash')"
13
+ }
14
+ ]
15
+ }
16
+ },
2
17
  "title": "HashedModuleIdsPluginOptions",
3
18
  "type": "object",
4
19
  "additionalProperties": false,
@@ -19,8 +34,11 @@
19
34
  },
20
35
  "hashFunction": {
21
36
  "description": "The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.",
22
- "type": "string",
23
- "minLength": 1
37
+ "oneOf": [
38
+ {
39
+ "$ref": "#/definitions/HashFunction"
40
+ }
41
+ ]
24
42
  }
25
43
  }
26
44
  }
package/types.d.ts CHANGED
@@ -759,7 +759,7 @@ declare class Chunk {
759
759
  ): Record<string | number, Record<string, (string | number)[]>>;
760
760
  }
761
761
  declare class ChunkGraph {
762
- constructor(moduleGraph: ModuleGraph);
762
+ constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
763
763
  moduleGraph: ModuleGraph;
764
764
  connectChunkAndModule(chunk: Chunk, module: Module): void;
765
765
  disconnectChunkAndModule(chunk: Chunk, module: Module): void;
@@ -891,7 +891,8 @@ declare class ChunkGraph {
891
891
  addModuleRuntimeRequirements(
892
892
  module: Module,
893
893
  runtime: RuntimeSpec,
894
- items: Set<string>
894
+ items: Set<string>,
895
+ transferOwnership?: boolean
895
896
  ): void;
896
897
  addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
897
898
  addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
@@ -1298,7 +1299,7 @@ declare class Compilation {
1298
1299
  /**
1299
1300
  * Creates an instance of Compilation.
1300
1301
  */
1301
- constructor(compiler: Compiler);
1302
+ constructor(compiler: Compiler, params: CompilationParams);
1302
1303
  hooks: Readonly<{
1303
1304
  buildModule: SyncHook<[Module]>;
1304
1305
  rebuildModule: SyncHook<[Module]>;
@@ -1454,16 +1455,22 @@ declare class Compilation {
1454
1455
  outputOptions: OutputNormalized;
1455
1456
  bail: boolean;
1456
1457
  profile: boolean;
1458
+ params: CompilationParams;
1457
1459
  mainTemplate: MainTemplate;
1458
1460
  chunkTemplate: ChunkTemplate;
1459
1461
  runtimeTemplate: RuntimeTemplate;
1460
1462
  moduleTemplates: { javascript: ModuleTemplate };
1463
+ moduleMemCaches?: WeakMap<Module, WeakTupleMap<any, any>>;
1461
1464
  moduleGraph: ModuleGraph;
1462
1465
  chunkGraph: ChunkGraph;
1463
1466
  codeGenerationResults: CodeGenerationResults;
1464
1467
  processDependenciesQueue: AsyncQueue<Module, Module, Module>;
1465
1468
  addModuleQueue: AsyncQueue<Module, string, Module>;
1466
- factorizeQueue: AsyncQueue<FactorizeModuleOptions, string, Module>;
1469
+ factorizeQueue: AsyncQueue<
1470
+ FactorizeModuleOptions,
1471
+ string,
1472
+ Module | ModuleFactoryResult
1473
+ >;
1467
1474
  buildQueue: AsyncQueue<Module, Module, Module>;
1468
1475
  rebuildQueue: AsyncQueue<Module, Module, Module>;
1469
1476
 
@@ -1546,10 +1553,6 @@ declare class Compilation {
1546
1553
  __0: HandleModuleCreationOptions,
1547
1554
  callback: (err?: WebpackError, result?: Module) => void
1548
1555
  ): void;
1549
- factorizeModule(
1550
- options: FactorizeModuleOptions,
1551
- callback: (err?: WebpackError, result?: Module) => void
1552
- ): void;
1553
1556
  addModuleChain(
1554
1557
  context: string,
1555
1558
  dependency: Dependency,
@@ -1594,7 +1597,7 @@ declare class Compilation {
1594
1597
  reportDependencyErrorsAndWarnings(
1595
1598
  module: Module,
1596
1599
  blocks: DependenciesBlock[]
1597
- ): void;
1600
+ ): boolean;
1598
1601
  codeGeneration(callback?: any): void;
1599
1602
  processRuntimeRequirements(__0?: {
1600
1603
  /**
@@ -1716,6 +1719,16 @@ declare class Compilation {
1716
1719
  callback: (err?: WebpackError, result?: ExecuteModuleResult) => void
1717
1720
  ): void;
1718
1721
  checkConstraints(): void;
1722
+ factorizeModule: {
1723
+ (
1724
+ options: FactorizeModuleOptions & { factoryResult?: false },
1725
+ callback: (err?: WebpackError, result?: Module) => void
1726
+ ): void;
1727
+ (
1728
+ options: FactorizeModuleOptions & { factoryResult: true },
1729
+ callback: (err?: WebpackError, result?: ModuleFactoryResult) => void
1730
+ ): void;
1731
+ };
1719
1732
 
1720
1733
  /**
1721
1734
  * Add additional assets to the compilation.
@@ -1894,6 +1907,14 @@ declare class Compiler {
1894
1907
  context: string;
1895
1908
  requestShortener: RequestShortener;
1896
1909
  cache: Cache;
1910
+ moduleMemCaches?: WeakMap<
1911
+ Module,
1912
+ {
1913
+ hash: string;
1914
+ references: WeakMap<Dependency, Module>;
1915
+ memCache: WeakTupleMap<any, any>;
1916
+ }
1917
+ >;
1897
1918
  compilerPath: string;
1898
1919
  running: boolean;
1899
1920
  idle: boolean;
@@ -1917,7 +1938,7 @@ declare class Compiler {
1917
1938
  plugins?: WebpackPluginInstance[]
1918
1939
  ): Compiler;
1919
1940
  isChild(): boolean;
1920
- createCompilation(): Compilation;
1941
+ createCompilation(params?: any): Compilation;
1921
1942
  newCompilation(params: CompilationParams): Compilation;
1922
1943
  createNormalModuleFactory(): NormalModuleFactory;
1923
1944
  createContextModuleFactory(): ContextModuleFactory;
@@ -2237,6 +2258,7 @@ declare class ConstDependency extends NullDependency {
2237
2258
  static Template: typeof ConstDependencyTemplate;
2238
2259
  static NO_EXPORTS_REFERENCED: string[][];
2239
2260
  static EXPORTS_OBJECT_REFERENCED: string[][];
2261
+ static TRANSITIVE: typeof TRANSITIVE;
2240
2262
  }
2241
2263
  declare class ConstDependencyTemplate extends NullDependencyTemplate {
2242
2264
  constructor();
@@ -2550,6 +2572,7 @@ declare class Dependency {
2550
2572
  readonly category: string;
2551
2573
  loc: DependencyLocation;
2552
2574
  getResourceIdentifier(): null | string;
2575
+ couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
2553
2576
 
2554
2577
  /**
2555
2578
  * Returns the referenced module and export
@@ -2604,6 +2627,7 @@ declare class Dependency {
2604
2627
  readonly disconnect: any;
2605
2628
  static NO_EXPORTS_REFERENCED: string[][];
2606
2629
  static EXPORTS_OBJECT_REFERENCED: string[][];
2630
+ static TRANSITIVE: typeof TRANSITIVE;
2607
2631
  }
2608
2632
  declare interface DependencyConstructor {
2609
2633
  new (...args: any[]): Dependency;
@@ -3282,6 +3306,11 @@ declare interface Experiments {
3282
3306
  */
3283
3307
  buildHttp?: boolean | HttpUriOptions;
3284
3308
 
3309
+ /**
3310
+ * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
3311
+ */
3312
+ cacheUnaffected?: boolean;
3313
+
3285
3314
  /**
3286
3315
  * Apply defaults of next major version.
3287
3316
  */
@@ -3810,6 +3839,11 @@ declare interface FactorizeModuleOptions {
3810
3839
  currentProfile: ModuleProfile;
3811
3840
  factory: ModuleFactory;
3812
3841
  dependencies: Dependency[];
3842
+
3843
+ /**
3844
+ * return full ModuleFactoryResult instead of only module
3845
+ */
3846
+ factoryResult?: boolean;
3813
3847
  originModule: null | Module;
3814
3848
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
3815
3849
  context?: string;
@@ -3909,6 +3943,11 @@ declare interface FileCacheOptions {
3909
3943
  */
3910
3944
  maxMemoryGenerations?: number;
3911
3945
 
3946
+ /**
3947
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
3948
+ */
3949
+ memoryCacheUnaffected?: boolean;
3950
+
3912
3951
  /**
3913
3952
  * Name for the cache. Different names will lead to different coexisting caches.
3914
3953
  */
@@ -4306,7 +4345,7 @@ declare interface HashedModuleIdsPluginOptions {
4306
4345
  /**
4307
4346
  * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
4308
4347
  */
4309
- hashFunction?: string;
4348
+ hashFunction?: string | typeof Hash;
4310
4349
  }
4311
4350
  declare abstract class HelperRuntimeModule extends RuntimeModule {}
4312
4351
  declare class HotModuleReplacementPlugin {
@@ -6304,6 +6343,11 @@ declare interface MapOptions {
6304
6343
  * Options object for in-memory caching.
6305
6344
  */
6306
6345
  declare interface MemoryCacheOptions {
6346
+ /**
6347
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
6348
+ */
6349
+ cacheUnaffected?: boolean;
6350
+
6307
6351
  /**
6308
6352
  * Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).
6309
6353
  */
@@ -6500,6 +6544,7 @@ declare class ModuleDependency extends Dependency {
6500
6544
  static Template: typeof DependencyTemplate;
6501
6545
  static NO_EXPORTS_REFERENCED: string[][];
6502
6546
  static EXPORTS_OBJECT_REFERENCED: string[][];
6547
+ static TRANSITIVE: typeof TRANSITIVE;
6503
6548
  }
6504
6549
  declare abstract class ModuleFactory {
6505
6550
  create(
@@ -6526,6 +6571,11 @@ declare interface ModuleFactoryResult {
6526
6571
  fileDependencies?: Set<string>;
6527
6572
  contextDependencies?: Set<string>;
6528
6573
  missingDependencies?: Set<string>;
6574
+
6575
+ /**
6576
+ * allow to use the unsafe cache
6577
+ */
6578
+ cacheable?: boolean;
6529
6579
  }
6530
6580
  declare class ModuleFederationPlugin {
6531
6581
  constructor(options: ModuleFederationPluginOptions);
@@ -6683,12 +6733,16 @@ declare class ModuleGraph {
6683
6733
  setAsync(module: Module): void;
6684
6734
  getMeta(thing?: any): Object;
6685
6735
  getMetaIfExisting(thing?: any): Object;
6686
- freeze(): void;
6736
+ freeze(cacheStage?: string): void;
6687
6737
  unfreeze(): void;
6688
6738
  cached<T extends any[], V>(
6689
6739
  fn: (moduleGraph: ModuleGraph, ...args: T) => V,
6690
6740
  ...args: T
6691
6741
  ): V;
6742
+ setModuleMemCaches(
6743
+ moduleMemCaches: WeakMap<Module, WeakTupleMap<any, any>>
6744
+ ): void;
6745
+ dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
6692
6746
  static getModuleGraphForModule(
6693
6747
  module: Module,
6694
6748
  deprecateMessage: string,
@@ -7342,8 +7396,6 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
7342
7396
  }>;
7343
7397
  resolverFactory: ResolverFactory;
7344
7398
  ruleSet: RuleSet;
7345
- unsafeCache: boolean;
7346
- cachePredicate: Function;
7347
7399
  context: string;
7348
7400
  fs: InputFileSystem;
7349
7401
  parserCache: Map<string, WeakMap<Object, any>>;
@@ -7487,6 +7539,7 @@ declare class NullDependency extends Dependency {
7487
7539
  static Template: typeof NullDependencyTemplate;
7488
7540
  static NO_EXPORTS_REFERENCED: string[][];
7489
7541
  static EXPORTS_OBJECT_REFERENCED: string[][];
7542
+ static TRANSITIVE: typeof TRANSITIVE;
7490
7543
  }
7491
7544
  declare class NullDependencyTemplate extends DependencyTemplate {
7492
7545
  constructor();
@@ -9783,6 +9836,7 @@ declare class RuntimeChunkPlugin {
9783
9836
  */
9784
9837
  apply(compiler: Compiler): void;
9785
9838
  }
9839
+ type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
9786
9840
  declare class RuntimeModule extends Module {
9787
9841
  constructor(name: string, stage?: number);
9788
9842
  name: string;
@@ -9829,7 +9883,8 @@ declare interface RuntimeRequirementsContext {
9829
9883
  codeGenerationResults: CodeGenerationResults;
9830
9884
  }
9831
9885
  type RuntimeSpec = undefined | string | SortableSet<string>;
9832
- declare abstract class RuntimeSpecMap<T> {
9886
+ declare class RuntimeSpecMap<T> {
9887
+ constructor(clone?: RuntimeSpecMap<T>);
9833
9888
  get(runtime: RuntimeSpec): T;
9834
9889
  has(runtime: RuntimeSpec): boolean;
9835
9890
  set(runtime?: any, value?: any): void;
@@ -9840,7 +9895,8 @@ declare abstract class RuntimeSpecMap<T> {
9840
9895
  values(): IterableIterator<T>;
9841
9896
  readonly size?: number;
9842
9897
  }
9843
- declare abstract class RuntimeSpecSet {
9898
+ declare class RuntimeSpecSet {
9899
+ constructor(iterable?: any);
9844
9900
  add(runtime?: any): void;
9845
9901
  has(runtime?: any): boolean;
9846
9902
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
@@ -11256,6 +11312,7 @@ declare interface SyntheticDependencyLocation {
11256
11312
  index?: number;
11257
11313
  }
11258
11314
  declare const TOMBSTONE: unique symbol;
11315
+ declare const TRANSITIVE: unique symbol;
11259
11316
  declare const TRANSITIVE_ONLY: unique symbol;
11260
11317
  declare interface TagInfo {
11261
11318
  tag: any;
@@ -11299,6 +11356,10 @@ declare interface TimestampAndHash {
11299
11356
  timestamp?: number;
11300
11357
  hash: string;
11301
11358
  }
11359
+ declare class TopLevelSymbol {
11360
+ constructor(name: string);
11361
+ name: string;
11362
+ }
11302
11363
 
11303
11364
  /**
11304
11365
  * Use a Trusted Types policy to create urls for chunks.
@@ -11616,6 +11677,14 @@ declare abstract class Watching {
11616
11677
  resume(): void;
11617
11678
  close(callback: CallbackFunction<void>): void;
11618
11679
  }
11680
+ declare abstract class WeakTupleMap<T extends any[], V> {
11681
+ set(...args: [T, ...V[]]): void;
11682
+ has(...args: T): boolean;
11683
+ get(...args: T): V;
11684
+ provide(...args: [T, ...(() => V)[]]): V;
11685
+ delete(...args: T): void;
11686
+ clear(): void;
11687
+ }
11619
11688
  declare interface WebAssemblyRenderContext {
11620
11689
  /**
11621
11690
  * the chunk
@@ -12022,10 +12091,23 @@ declare namespace exports {
12022
12091
  export let NAMESPACE: string;
12023
12092
  export let REGEXP_NAMESPACE: RegExp;
12024
12093
  export let createFilename: (
12025
- module: any,
12094
+ module: string | Module,
12026
12095
  options: any,
12027
- __2: { requestShortener: any; chunkGraph: any }
12028
- ) => any;
12096
+ __2: {
12097
+ /**
12098
+ * requestShortener
12099
+ */
12100
+ requestShortener: RequestShortener;
12101
+ /**
12102
+ * chunk graph
12103
+ */
12104
+ chunkGraph: ChunkGraph;
12105
+ /**
12106
+ * the hash function to use
12107
+ */
12108
+ hashFunction: string | typeof Hash;
12109
+ }
12110
+ ) => string;
12029
12111
  export let replaceDuplicates: (
12030
12112
  array?: any,
12031
12113
  fn?: any,
@@ -12142,6 +12224,52 @@ declare namespace exports {
12142
12224
  };
12143
12225
  }
12144
12226
  export namespace optimize {
12227
+ export namespace InnerGraph {
12228
+ export let bailout: (parserState: ParserState) => void;
12229
+ export let enable: (parserState: ParserState) => void;
12230
+ export let isEnabled: (parserState: ParserState) => boolean;
12231
+ export let addUsage: (
12232
+ state: ParserState,
12233
+ symbol: null | TopLevelSymbol,
12234
+ usage: string | true | TopLevelSymbol
12235
+ ) => void;
12236
+ export let addVariableUsage: (
12237
+ parser: JavascriptParser,
12238
+ name: string,
12239
+ usage: string | true | TopLevelSymbol
12240
+ ) => void;
12241
+ export let inferDependencyUsage: (state: ParserState) => void;
12242
+ export let onUsage: (
12243
+ state: ParserState,
12244
+ onUsageCallback: (arg0?: boolean | Set<string>) => void
12245
+ ) => void;
12246
+ export let setTopLevelSymbol: (
12247
+ state: ParserState,
12248
+ symbol: TopLevelSymbol
12249
+ ) => void;
12250
+ export let getTopLevelSymbol: (
12251
+ state: ParserState
12252
+ ) => void | TopLevelSymbol;
12253
+ export let tagTopLevelSymbol: (
12254
+ parser: JavascriptParser,
12255
+ name: string
12256
+ ) => TopLevelSymbol;
12257
+ export let isDependencyUsedByExports: (
12258
+ dependency: Dependency,
12259
+ usedByExports: boolean | Set<string>,
12260
+ moduleGraph: ModuleGraph,
12261
+ runtime: RuntimeSpec
12262
+ ) => boolean;
12263
+ export let getDependencyUsedByExportsCondition: (
12264
+ dependency: Dependency,
12265
+ usedByExports: boolean | Set<string>,
12266
+ moduleGraph: ModuleGraph
12267
+ ) =>
12268
+ | null
12269
+ | false
12270
+ | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
12271
+ export { TopLevelSymbol, topLevelSymbolTag };
12272
+ }
12145
12273
  export {
12146
12274
  AggressiveMergingPlugin,
12147
12275
  AggressiveSplittingPlugin,
@@ -12267,6 +12395,59 @@ declare namespace exports {
12267
12395
  b: DependencyLocation
12268
12396
  ) => 0 | 1 | -1;
12269
12397
  }
12398
+ export namespace runtime {
12399
+ export let getEntryRuntime: (
12400
+ compilation: Compilation,
12401
+ name: string,
12402
+ options?: EntryOptions
12403
+ ) => RuntimeSpec;
12404
+ export let forEachRuntime: (
12405
+ runtime: RuntimeSpec,
12406
+ fn: (arg0: string) => void,
12407
+ deterministicOrder?: boolean
12408
+ ) => void;
12409
+ export let getRuntimeKey: (runtime: RuntimeSpec) => string;
12410
+ export let keyToRuntime: (key: string) => RuntimeSpec;
12411
+ export let runtimeToString: (runtime: RuntimeSpec) => string;
12412
+ export let runtimeConditionToString: (
12413
+ runtimeCondition: RuntimeCondition
12414
+ ) => string;
12415
+ export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
12416
+ export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
12417
+ export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
12418
+ export let mergeRuntimeCondition: (
12419
+ a: RuntimeCondition,
12420
+ b: RuntimeCondition,
12421
+ runtime: RuntimeSpec
12422
+ ) => RuntimeCondition;
12423
+ export let mergeRuntimeConditionNonFalse: (
12424
+ a: undefined | string | true | SortableSet<string>,
12425
+ b: undefined | string | true | SortableSet<string>,
12426
+ runtime: RuntimeSpec
12427
+ ) => undefined | string | true | SortableSet<string>;
12428
+ export let mergeRuntimeOwned: (
12429
+ a: RuntimeSpec,
12430
+ b: RuntimeSpec
12431
+ ) => RuntimeSpec;
12432
+ export let intersectRuntime: (
12433
+ a: RuntimeSpec,
12434
+ b: RuntimeSpec
12435
+ ) => RuntimeSpec;
12436
+ export let subtractRuntime: (
12437
+ a: RuntimeSpec,
12438
+ b: RuntimeSpec
12439
+ ) => RuntimeSpec;
12440
+ export let subtractRuntimeCondition: (
12441
+ a: RuntimeCondition,
12442
+ b: RuntimeCondition,
12443
+ runtime: RuntimeSpec
12444
+ ) => RuntimeCondition;
12445
+ export let filterRuntime: (
12446
+ runtime: RuntimeSpec,
12447
+ filter: (arg0: RuntimeSpec) => boolean
12448
+ ) => undefined | string | boolean | SortableSet<string>;
12449
+ export { RuntimeSpecMap, RuntimeSpecSet };
12450
+ }
12270
12451
  export namespace serialization {
12271
12452
  export const register: (
12272
12453
  Constructor: Constructor,
@@ -12281,7 +12462,10 @@ declare namespace exports {
12281
12462
  export const registerNotSerializable: (Constructor: Constructor) => void;
12282
12463
  export const NOT_SERIALIZABLE: object;
12283
12464
  export const buffersSerializer: Serializer;
12284
- export let createFileSerializer: (fs?: any) => Serializer;
12465
+ export let createFileSerializer: (
12466
+ fs?: any,
12467
+ hashFunction?: any
12468
+ ) => Serializer;
12285
12469
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
12286
12470
  }
12287
12471
  export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
@@ -12409,5 +12593,6 @@ declare namespace exports {
12409
12593
  LoaderContext
12410
12594
  };
12411
12595
  }
12596
+ declare const topLevelSymbolTag: unique symbol;
12412
12597
 
12413
12598
  export = exports;