webpack 5.51.2 → 5.54.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 (62) 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 +207 -16
  6. package/lib/Compiler.js +9 -1
  7. package/lib/DependencyTemplates.js +8 -2
  8. package/lib/EvalDevToolModulePlugin.js +2 -1
  9. package/lib/EvalSourceMapDevToolPlugin.js +2 -1
  10. package/lib/ExternalModule.js +36 -18
  11. package/lib/FileSystemInfo.js +101 -170
  12. package/lib/FlagDependencyExportsPlugin.js +43 -16
  13. package/lib/InitFragment.js +23 -0
  14. package/lib/JavascriptMetaInfoPlugin.js +6 -1
  15. package/lib/MemCache.js +45 -0
  16. package/lib/ModuleFilenameHelpers.js +21 -7
  17. package/lib/NodeStuffInWebError.js +34 -0
  18. package/lib/NodeStuffPlugin.js +59 -16
  19. package/lib/NormalModuleFactory.js +7 -4
  20. package/lib/SourceMapDevToolPlugin.js +7 -3
  21. package/lib/WebpackOptionsApply.js +20 -4
  22. package/lib/cache/PackFileCacheStrategy.js +183 -53
  23. package/lib/cache/getLazyHashedEtag.js +35 -8
  24. package/lib/config/defaults.js +32 -13
  25. package/lib/dependencies/CachedConstDependency.js +4 -3
  26. package/lib/dependencies/ConstDependency.js +12 -4
  27. package/lib/dependencies/JsonExportsDependency.js +7 -1
  28. package/lib/dependencies/LoaderPlugin.js +94 -98
  29. package/lib/dependencies/ModuleDecoratorDependency.js +5 -2
  30. package/lib/dependencies/ProvidedDependency.js +6 -2
  31. package/lib/dependencies/PureExpressionDependency.js +5 -1
  32. package/lib/dependencies/RuntimeRequirementsDependency.js +5 -1
  33. package/lib/ids/IdHelpers.js +21 -8
  34. package/lib/ids/NamedChunkIdsPlugin.js +3 -0
  35. package/lib/ids/NamedModuleIdsPlugin.js +3 -1
  36. package/lib/index.js +6 -0
  37. package/lib/javascript/BasicEvaluatedExpression.js +3 -0
  38. package/lib/javascript/JavascriptParser.js +22 -4
  39. package/lib/javascript/JavascriptParserHelpers.js +0 -2
  40. package/lib/node/NodeTargetPlugin.js +1 -0
  41. package/lib/optimize/ConcatenatedModule.js +25 -4
  42. package/lib/optimize/InnerGraph.js +22 -2
  43. package/lib/optimize/MangleExportsPlugin.js +21 -4
  44. package/lib/optimize/ModuleConcatenationPlugin.js +2 -1
  45. package/lib/runtime/RelativeUrlRuntimeModule.js +1 -1
  46. package/lib/schemes/HttpUriPlugin.js +1 -2
  47. package/lib/serialization/BinaryMiddleware.js +11 -2
  48. package/lib/serialization/FileMiddleware.js +24 -7
  49. package/lib/serialization/ObjectMiddleware.js +23 -12
  50. package/lib/util/createHash.js +10 -0
  51. package/lib/util/hash/BatchedHash.js +65 -0
  52. package/lib/util/hash/xxhash64.js +154 -0
  53. package/lib/util/internalSerializables.js +2 -0
  54. package/lib/util/serialization.js +10 -6
  55. package/package.json +13 -9
  56. package/schemas/WebpackOptions.check.js +1 -1
  57. package/schemas/WebpackOptions.json +17 -5
  58. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  59. package/schemas/plugins/HashedModuleIdsPlugin.json +20 -2
  60. package/schemas/plugins/IgnorePlugin.check.js +1 -1
  61. package/schemas/plugins/IgnorePlugin.json +4 -2
  62. package/types.d.ts +166 -17
@@ -699,8 +699,12 @@
699
699
  }
700
700
  ]
701
701
  },
702
- "executeModule": {
703
- "description": "Enable build-time execution of modules from the module graph for plugins and loaders.",
702
+ "cacheUnaffected": {
703
+ "description": "Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.",
704
+ "type": "boolean"
705
+ },
706
+ "futureDefaults": {
707
+ "description": "Apply defaults of next major version.",
704
708
  "type": "boolean"
705
709
  },
706
710
  "layers": {
@@ -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",
@@ -1944,15 +1956,15 @@
1944
1956
  "properties": {
1945
1957
  "__dirname": {
1946
1958
  "description": "Include a polyfill for the '__dirname' variable.",
1947
- "enum": [false, true, "mock", "eval-only"]
1959
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1948
1960
  },
1949
1961
  "__filename": {
1950
1962
  "description": "Include a polyfill for the '__filename' variable.",
1951
- "enum": [false, true, "mock", "eval-only"]
1963
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1952
1964
  },
1953
1965
  "global": {
1954
1966
  "description": "Include a polyfill for the 'global' variable.",
1955
- "type": "boolean"
1967
+ "enum": [false, true, "warn"]
1956
1968
  }
1957
1969
  }
1958
1970
  },
@@ -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
  }
@@ -3,4 +3,4 @@
3
3
  * DO NOT MODIFY BY HAND.
4
4
  * Run `yarn special-lint-fix` to update
5
5
  */
6
- "use strict";function e(t,{instancePath:o="",parentData:s,parentDataProperty:r,rootData:n=t}={}){let c=null,a=0;const p=a;let l=!1;const i=a;if(a===i)if(t&&"object"==typeof t&&!Array.isArray(t)){const e=a;for(const e in t)if("contextRegExp"!==e&&"resourceRegExp"!==e){const t={params:{additionalProperty:e}};null===c?c=[t]:c.push(t),a++;break}if(e===a){if(void 0!==t.contextRegExp){const e=a;if(!(t.contextRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}var u=e===a}else u=!0;if(u)if(void 0!==t.resourceRegExp){const e=a;if(!(t.resourceRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}u=e===a}else u=!0}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}var f=i===a;if(l=l||f,!l){const e=a;if(a===e)if(t&&"object"==typeof t&&!Array.isArray(t)){const e=a;for(const e in t)if("checkResource"!==e){const t={params:{additionalProperty:e}};null===c?c=[t]:c.push(t),a++;break}if(e===a&&void 0!==t.checkResource&&!(t.checkResource instanceof Function)){const e={params:{}};null===c?c=[e]:c.push(e),a++}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}f=e===a,l=l||f}if(!l){const t={params:{}};return null===c?c=[t]:c.push(t),a++,e.errors=c,!1}return a=p,null!==c&&(p?c.length=p:c=null),e.errors=c,0===a}module.exports=e,module.exports.default=e;
6
+ "use strict";function e(s,{instancePath:o="",parentData:r,parentDataProperty:t,rootData:n=s}={}){let c=null,a=0;const p=a;let l=!1;const i=a;if(a===i)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.resourceRegExp&&(e="resourceRegExp")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("contextRegExp"!==e&&"resourceRegExp"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a){if(void 0!==s.contextRegExp){const e=a;if(!(s.contextRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}var u=e===a}else u=!0;if(u)if(void 0!==s.resourceRegExp){const e=a;if(!(s.resourceRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}u=e===a}else u=!0}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}var f=i===a;if(l=l||f,!l){const e=a;if(a===e)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.checkResource&&(e="checkResource")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("checkResource"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a&&void 0!==s.checkResource&&!(s.checkResource instanceof Function)){const e={params:{}};null===c?c=[e]:c.push(e),a++}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}f=e===a,l=l||f}if(!l){const s={params:{}};return null===c?c=[s]:c.push(s),a++,e.errors=c,!1}return a=p,null!==c&&(p?c.length=p:c=null),e.errors=c,0===a}module.exports=e,module.exports.default=e;
@@ -15,7 +15,8 @@
15
15
  "instanceof": "RegExp",
16
16
  "tsType": "RegExp"
17
17
  }
18
- }
18
+ },
19
+ "required": ["resourceRegExp"]
19
20
  },
20
21
  {
21
22
  "type": "object",
@@ -26,7 +27,8 @@
26
27
  "instanceof": "Function",
27
28
  "tsType": "((resource: string, context: string) => boolean)"
28
29
  }
29
- }
30
+ },
31
+ "required": ["checkResource"]
30
32
  }
31
33
  ]
32
34
  }
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;
@@ -1458,6 +1459,8 @@ declare class Compilation {
1458
1459
  chunkTemplate: ChunkTemplate;
1459
1460
  runtimeTemplate: RuntimeTemplate;
1460
1461
  moduleTemplates: { javascript: ModuleTemplate };
1462
+ memCache?: MemCache;
1463
+ moduleMemCaches?: WeakMap<Module, MemCache>;
1461
1464
  moduleGraph: ModuleGraph;
1462
1465
  chunkGraph: ChunkGraph;
1463
1466
  codeGenerationResults: CodeGenerationResults;
@@ -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
  /**
@@ -1894,6 +1897,7 @@ declare class Compiler {
1894
1897
  context: string;
1895
1898
  requestShortener: RequestShortener;
1896
1899
  cache: Cache;
1900
+ moduleMemCaches?: WeakMap<Module, { hash: string; memCache: MemCache }>;
1897
1901
  compilerPath: string;
1898
1902
  running: boolean;
1899
1903
  idle: boolean;
@@ -3283,9 +3287,14 @@ declare interface Experiments {
3283
3287
  buildHttp?: boolean | HttpUriOptions;
3284
3288
 
3285
3289
  /**
3286
- * Enable build-time execution of modules from the module graph for plugins and loaders.
3290
+ * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
3291
+ */
3292
+ cacheUnaffected?: boolean;
3293
+
3294
+ /**
3295
+ * Apply defaults of next major version.
3287
3296
  */
3288
- executeModule?: boolean;
3297
+ futureDefaults?: boolean;
3289
3298
 
3290
3299
  /**
3291
3300
  * Enable module and chunk layers.
@@ -3909,6 +3918,11 @@ declare interface FileCacheOptions {
3909
3918
  */
3910
3919
  maxMemoryGenerations?: number;
3911
3920
 
3921
+ /**
3922
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
3923
+ */
3924
+ memoryCacheUnaffected?: boolean;
3925
+
3912
3926
  /**
3913
3927
  * Name for the cache. Different names will lead to different coexisting caches.
3914
3928
  */
@@ -4306,7 +4320,7 @@ declare interface HashedModuleIdsPluginOptions {
4306
4320
  /**
4307
4321
  * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
4308
4322
  */
4309
- hashFunction?: string;
4323
+ hashFunction?: string | typeof Hash;
4310
4324
  }
4311
4325
  declare abstract class HelperRuntimeModule extends RuntimeModule {}
4312
4326
  declare class HotModuleReplacementPlugin {
@@ -4443,13 +4457,13 @@ type IgnorePluginOptions =
4443
4457
  /**
4444
4458
  * A RegExp to test the request against.
4445
4459
  */
4446
- resourceRegExp?: RegExp;
4460
+ resourceRegExp: RegExp;
4447
4461
  }
4448
4462
  | {
4449
4463
  /**
4450
4464
  * A filter function for resource and context.
4451
4465
  */
4452
- checkResource?: (resource: string, context: string) => boolean;
4466
+ checkResource: (resource: string, context: string) => boolean;
4453
4467
  };
4454
4468
  declare interface ImportModuleOptions {
4455
4469
  /**
@@ -4517,6 +4531,8 @@ declare abstract class InitFragment<Context> {
4517
4531
  endContent?: string | Source;
4518
4532
  getContent(context: Context): string | Source;
4519
4533
  getEndContent(context: Context): undefined | string | Source;
4534
+ serialize(context?: any): void;
4535
+ deserialize(context?: any): void;
4520
4536
  merge: any;
4521
4537
  }
4522
4538
  declare interface InputFileSystem {
@@ -6297,11 +6313,21 @@ declare interface MapOptions {
6297
6313
  columns?: boolean;
6298
6314
  module?: boolean;
6299
6315
  }
6316
+ declare abstract class MemCache {
6317
+ get<T extends any[], V>(...args: T): undefined | V;
6318
+ set<T extends [any, ...any[]]>(...args: T): void;
6319
+ provide<T extends [any, ...((...args: any[]) => V)[]], V>(...args: T): V;
6320
+ }
6300
6321
 
6301
6322
  /**
6302
6323
  * Options object for in-memory caching.
6303
6324
  */
6304
6325
  declare interface MemoryCacheOptions {
6326
+ /**
6327
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
6328
+ */
6329
+ cacheUnaffected?: boolean;
6330
+
6305
6331
  /**
6306
6332
  * 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).
6307
6333
  */
@@ -7159,17 +7185,17 @@ declare interface NodeOptions {
7159
7185
  /**
7160
7186
  * Include a polyfill for the '__dirname' variable.
7161
7187
  */
7162
- __dirname?: boolean | "mock" | "eval-only";
7188
+ __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
7163
7189
 
7164
7190
  /**
7165
7191
  * Include a polyfill for the '__filename' variable.
7166
7192
  */
7167
- __filename?: boolean | "mock" | "eval-only";
7193
+ __filename?: boolean | "warn-mock" | "mock" | "eval-only";
7168
7194
 
7169
7195
  /**
7170
7196
  * Include a polyfill for the 'global' variable.
7171
7197
  */
7172
- global?: boolean;
7198
+ global?: boolean | "warn";
7173
7199
  }
7174
7200
  declare class NodeSourcePlugin {
7175
7201
  constructor();
@@ -9781,6 +9807,7 @@ declare class RuntimeChunkPlugin {
9781
9807
  */
9782
9808
  apply(compiler: Compiler): void;
9783
9809
  }
9810
+ type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
9784
9811
  declare class RuntimeModule extends Module {
9785
9812
  constructor(name: string, stage?: number);
9786
9813
  name: string;
@@ -9827,7 +9854,8 @@ declare interface RuntimeRequirementsContext {
9827
9854
  codeGenerationResults: CodeGenerationResults;
9828
9855
  }
9829
9856
  type RuntimeSpec = undefined | string | SortableSet<string>;
9830
- declare abstract class RuntimeSpecMap<T> {
9857
+ declare class RuntimeSpecMap<T> {
9858
+ constructor(clone?: RuntimeSpecMap<T>);
9831
9859
  get(runtime: RuntimeSpec): T;
9832
9860
  has(runtime: RuntimeSpec): boolean;
9833
9861
  set(runtime?: any, value?: any): void;
@@ -9838,7 +9866,8 @@ declare abstract class RuntimeSpecMap<T> {
9838
9866
  values(): IterableIterator<T>;
9839
9867
  readonly size?: number;
9840
9868
  }
9841
- declare abstract class RuntimeSpecSet {
9869
+ declare class RuntimeSpecSet {
9870
+ constructor(iterable?: any);
9842
9871
  add(runtime?: any): void;
9843
9872
  has(runtime?: any): boolean;
9844
9873
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
@@ -11297,6 +11326,10 @@ declare interface TimestampAndHash {
11297
11326
  timestamp?: number;
11298
11327
  hash: string;
11299
11328
  }
11329
+ declare class TopLevelSymbol {
11330
+ constructor(name: string);
11331
+ name: string;
11332
+ }
11300
11333
 
11301
11334
  /**
11302
11335
  * Use a Trusted Types policy to create urls for chunks.
@@ -12020,10 +12053,23 @@ declare namespace exports {
12020
12053
  export let NAMESPACE: string;
12021
12054
  export let REGEXP_NAMESPACE: RegExp;
12022
12055
  export let createFilename: (
12023
- module: any,
12056
+ module: string | Module,
12024
12057
  options: any,
12025
- __2: { requestShortener: any; chunkGraph: any }
12026
- ) => any;
12058
+ __2: {
12059
+ /**
12060
+ * requestShortener
12061
+ */
12062
+ requestShortener: RequestShortener;
12063
+ /**
12064
+ * chunk graph
12065
+ */
12066
+ chunkGraph: ChunkGraph;
12067
+ /**
12068
+ * the hash function to use
12069
+ */
12070
+ hashFunction: string | typeof Hash;
12071
+ }
12072
+ ) => string;
12027
12073
  export let replaceDuplicates: (
12028
12074
  array?: any,
12029
12075
  fn?: any,
@@ -12140,6 +12186,52 @@ declare namespace exports {
12140
12186
  };
12141
12187
  }
12142
12188
  export namespace optimize {
12189
+ export namespace InnerGraph {
12190
+ export let bailout: (parserState: ParserState) => void;
12191
+ export let enable: (parserState: ParserState) => void;
12192
+ export let isEnabled: (parserState: ParserState) => boolean;
12193
+ export let addUsage: (
12194
+ state: ParserState,
12195
+ symbol: null | TopLevelSymbol,
12196
+ usage: string | true | TopLevelSymbol
12197
+ ) => void;
12198
+ export let addVariableUsage: (
12199
+ parser: JavascriptParser,
12200
+ name: string,
12201
+ usage: string | true | TopLevelSymbol
12202
+ ) => void;
12203
+ export let inferDependencyUsage: (state: ParserState) => void;
12204
+ export let onUsage: (
12205
+ state: ParserState,
12206
+ onUsageCallback: (arg0?: boolean | Set<string>) => void
12207
+ ) => void;
12208
+ export let setTopLevelSymbol: (
12209
+ state: ParserState,
12210
+ symbol: TopLevelSymbol
12211
+ ) => void;
12212
+ export let getTopLevelSymbol: (
12213
+ state: ParserState
12214
+ ) => void | TopLevelSymbol;
12215
+ export let tagTopLevelSymbol: (
12216
+ parser: JavascriptParser,
12217
+ name: string
12218
+ ) => TopLevelSymbol;
12219
+ export let isDependencyUsedByExports: (
12220
+ dependency: Dependency,
12221
+ usedByExports: boolean | Set<string>,
12222
+ moduleGraph: ModuleGraph,
12223
+ runtime: RuntimeSpec
12224
+ ) => boolean;
12225
+ export let getDependencyUsedByExportsCondition: (
12226
+ dependency: Dependency,
12227
+ usedByExports: boolean | Set<string>,
12228
+ moduleGraph: ModuleGraph
12229
+ ) =>
12230
+ | null
12231
+ | false
12232
+ | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
12233
+ export { TopLevelSymbol, topLevelSymbolTag };
12234
+ }
12143
12235
  export {
12144
12236
  AggressiveMergingPlugin,
12145
12237
  AggressiveSplittingPlugin,
@@ -12265,6 +12357,59 @@ declare namespace exports {
12265
12357
  b: DependencyLocation
12266
12358
  ) => 0 | 1 | -1;
12267
12359
  }
12360
+ export namespace runtime {
12361
+ export let getEntryRuntime: (
12362
+ compilation: Compilation,
12363
+ name: string,
12364
+ options?: EntryOptions
12365
+ ) => RuntimeSpec;
12366
+ export let forEachRuntime: (
12367
+ runtime: RuntimeSpec,
12368
+ fn: (arg0: string) => void,
12369
+ deterministicOrder?: boolean
12370
+ ) => void;
12371
+ export let getRuntimeKey: (runtime: RuntimeSpec) => string;
12372
+ export let keyToRuntime: (key: string) => RuntimeSpec;
12373
+ export let runtimeToString: (runtime: RuntimeSpec) => string;
12374
+ export let runtimeConditionToString: (
12375
+ runtimeCondition: RuntimeCondition
12376
+ ) => string;
12377
+ export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
12378
+ export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
12379
+ export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
12380
+ export let mergeRuntimeCondition: (
12381
+ a: RuntimeCondition,
12382
+ b: RuntimeCondition,
12383
+ runtime: RuntimeSpec
12384
+ ) => RuntimeCondition;
12385
+ export let mergeRuntimeConditionNonFalse: (
12386
+ a: undefined | string | true | SortableSet<string>,
12387
+ b: undefined | string | true | SortableSet<string>,
12388
+ runtime: RuntimeSpec
12389
+ ) => undefined | string | true | SortableSet<string>;
12390
+ export let mergeRuntimeOwned: (
12391
+ a: RuntimeSpec,
12392
+ b: RuntimeSpec
12393
+ ) => RuntimeSpec;
12394
+ export let intersectRuntime: (
12395
+ a: RuntimeSpec,
12396
+ b: RuntimeSpec
12397
+ ) => RuntimeSpec;
12398
+ export let subtractRuntime: (
12399
+ a: RuntimeSpec,
12400
+ b: RuntimeSpec
12401
+ ) => RuntimeSpec;
12402
+ export let subtractRuntimeCondition: (
12403
+ a: RuntimeCondition,
12404
+ b: RuntimeCondition,
12405
+ runtime: RuntimeSpec
12406
+ ) => RuntimeCondition;
12407
+ export let filterRuntime: (
12408
+ runtime: RuntimeSpec,
12409
+ filter: (arg0: RuntimeSpec) => boolean
12410
+ ) => undefined | string | boolean | SortableSet<string>;
12411
+ export { RuntimeSpecMap, RuntimeSpecSet };
12412
+ }
12268
12413
  export namespace serialization {
12269
12414
  export const register: (
12270
12415
  Constructor: Constructor,
@@ -12279,7 +12424,10 @@ declare namespace exports {
12279
12424
  export const registerNotSerializable: (Constructor: Constructor) => void;
12280
12425
  export const NOT_SERIALIZABLE: object;
12281
12426
  export const buffersSerializer: Serializer;
12282
- export let createFileSerializer: (fs?: any) => Serializer;
12427
+ export let createFileSerializer: (
12428
+ fs?: any,
12429
+ hashFunction?: any
12430
+ ) => Serializer;
12283
12431
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
12284
12432
  }
12285
12433
  export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
@@ -12407,5 +12555,6 @@ declare namespace exports {
12407
12555
  LoaderContext
12408
12556
  };
12409
12557
  }
12558
+ declare const topLevelSymbolTag: unique symbol;
12410
12559
 
12411
12560
  export = exports;