webpack 5.52.1 → 5.55.1

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 (69) 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/Dependency.js +11 -0
  8. package/lib/DependencyTemplates.js +8 -2
  9. package/lib/EvalDevToolModulePlugin.js +2 -1
  10. package/lib/EvalSourceMapDevToolPlugin.js +2 -1
  11. package/lib/ExternalModule.js +18 -9
  12. package/lib/FileSystemInfo.js +101 -170
  13. package/lib/FlagDependencyExportsPlugin.js +25 -16
  14. package/lib/JavascriptMetaInfoPlugin.js +6 -1
  15. package/lib/ModuleFactory.js +1 -0
  16. package/lib/ModuleFilenameHelpers.js +21 -7
  17. package/lib/ModuleGraph.js +90 -21
  18. package/lib/NodeStuffInWebError.js +34 -0
  19. package/lib/NodeStuffPlugin.js +59 -16
  20. package/lib/NormalModuleFactory.js +8 -43
  21. package/lib/SourceMapDevToolPlugin.js +7 -3
  22. package/lib/WebpackOptionsApply.js +19 -1
  23. package/lib/cache/PackFileCacheStrategy.js +11 -1
  24. package/lib/cache/getLazyHashedEtag.js +35 -8
  25. package/lib/config/defaults.js +32 -12
  26. package/lib/dependencies/CachedConstDependency.js +4 -3
  27. package/lib/dependencies/CommonJsExportRequireDependency.js +19 -9
  28. package/lib/dependencies/CommonJsFullRequireDependency.js +11 -9
  29. package/lib/dependencies/ConstDependency.js +12 -4
  30. package/lib/dependencies/ContextDependency.js +8 -0
  31. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +179 -163
  32. package/lib/dependencies/HarmonyImportDependency.js +4 -1
  33. package/lib/dependencies/JsonExportsDependency.js +7 -1
  34. package/lib/dependencies/ModuleDecoratorDependency.js +5 -2
  35. package/lib/dependencies/ModuleDependency.js +8 -0
  36. package/lib/dependencies/NullDependency.js +8 -4
  37. package/lib/dependencies/ProvidedDependency.js +6 -2
  38. package/lib/dependencies/PureExpressionDependency.js +5 -1
  39. package/lib/dependencies/RuntimeRequirementsDependency.js +5 -1
  40. package/lib/dependencies/WebAssemblyExportImportedDependency.js +9 -0
  41. package/lib/ids/IdHelpers.js +21 -8
  42. package/lib/ids/NamedChunkIdsPlugin.js +3 -0
  43. package/lib/ids/NamedModuleIdsPlugin.js +3 -1
  44. package/lib/index.js +6 -0
  45. package/lib/javascript/BasicEvaluatedExpression.js +3 -0
  46. package/lib/javascript/JavascriptParser.js +22 -4
  47. package/lib/javascript/JavascriptParserHelpers.js +0 -2
  48. package/lib/node/NodeTargetPlugin.js +1 -0
  49. package/lib/optimize/ConcatenatedModule.js +25 -4
  50. package/lib/optimize/InnerGraph.js +22 -2
  51. package/lib/optimize/ModuleConcatenationPlugin.js +2 -1
  52. package/lib/schemes/HttpUriPlugin.js +1 -2
  53. package/lib/serialization/BinaryMiddleware.js +11 -2
  54. package/lib/serialization/FileMiddleware.js +24 -7
  55. package/lib/serialization/ObjectMiddleware.js +19 -8
  56. package/lib/util/WeakTupleMap.js +95 -92
  57. package/lib/util/createHash.js +10 -0
  58. package/lib/util/hash/BatchedHash.js +65 -0
  59. package/lib/util/hash/xxhash64.js +154 -0
  60. package/lib/util/internalSerializables.js +1 -0
  61. package/lib/util/serialization.js +4 -4
  62. package/package.json +11 -7
  63. package/schemas/WebpackOptions.check.js +1 -1
  64. package/schemas/WebpackOptions.json +19 -3
  65. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  66. package/schemas/plugins/HashedModuleIdsPlugin.json +20 -2
  67. package/schemas/plugins/IgnorePlugin.check.js +1 -1
  68. package/schemas/plugins/IgnorePlugin.json +4 -2
  69. package/types.d.ts +215 -25
@@ -699,6 +699,14 @@
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
+ },
706
+ "futureDefaults": {
707
+ "description": "Apply defaults of next major version.",
708
+ "type": "boolean"
709
+ },
702
710
  "layers": {
703
711
  "description": "Enable module and chunk layers.",
704
712
  "type": "boolean"
@@ -1023,6 +1031,10 @@
1023
1031
  "type": "number",
1024
1032
  "minimum": 0
1025
1033
  },
1034
+ "memoryCacheUnaffected": {
1035
+ "description": "Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.",
1036
+ "type": "boolean"
1037
+ },
1026
1038
  "name": {
1027
1039
  "description": "Name for the cache. Different names will lead to different coexisting caches.",
1028
1040
  "type": "string"
@@ -1651,6 +1663,10 @@
1651
1663
  "type": "object",
1652
1664
  "additionalProperties": false,
1653
1665
  "properties": {
1666
+ "cacheUnaffected": {
1667
+ "description": "Additionally cache computation of modules that are unchanged and reference only unchanged modules.",
1668
+ "type": "boolean"
1669
+ },
1654
1670
  "maxGenerations": {
1655
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).",
1656
1672
  "type": "number",
@@ -1940,15 +1956,15 @@
1940
1956
  "properties": {
1941
1957
  "__dirname": {
1942
1958
  "description": "Include a polyfill for the '__dirname' variable.",
1943
- "enum": [false, true, "mock", "eval-only"]
1959
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1944
1960
  },
1945
1961
  "__filename": {
1946
1962
  "description": "Include a polyfill for the '__filename' variable.",
1947
- "enum": [false, true, "mock", "eval-only"]
1963
+ "enum": [false, true, "warn-mock", "mock", "eval-only"]
1948
1964
  },
1949
1965
  "global": {
1950
1966
  "description": "Include a polyfill for the 'global' variable.",
1951
- "type": "boolean"
1967
+ "enum": [false, true, "warn"]
1952
1968
  }
1953
1969
  }
1954
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;
@@ -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,16 @@ 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
+
3314
+ /**
3315
+ * Apply defaults of next major version.
3316
+ */
3317
+ futureDefaults?: boolean;
3318
+
3285
3319
  /**
3286
3320
  * Enable module and chunk layers.
3287
3321
  */
@@ -3805,6 +3839,11 @@ declare interface FactorizeModuleOptions {
3805
3839
  currentProfile: ModuleProfile;
3806
3840
  factory: ModuleFactory;
3807
3841
  dependencies: Dependency[];
3842
+
3843
+ /**
3844
+ * return full ModuleFactoryResult instead of only module
3845
+ */
3846
+ factoryResult?: boolean;
3808
3847
  originModule: null | Module;
3809
3848
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
3810
3849
  context?: string;
@@ -3904,6 +3943,11 @@ declare interface FileCacheOptions {
3904
3943
  */
3905
3944
  maxMemoryGenerations?: number;
3906
3945
 
3946
+ /**
3947
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
3948
+ */
3949
+ memoryCacheUnaffected?: boolean;
3950
+
3907
3951
  /**
3908
3952
  * Name for the cache. Different names will lead to different coexisting caches.
3909
3953
  */
@@ -4301,7 +4345,7 @@ declare interface HashedModuleIdsPluginOptions {
4301
4345
  /**
4302
4346
  * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
4303
4347
  */
4304
- hashFunction?: string;
4348
+ hashFunction?: string | typeof Hash;
4305
4349
  }
4306
4350
  declare abstract class HelperRuntimeModule extends RuntimeModule {}
4307
4351
  declare class HotModuleReplacementPlugin {
@@ -4438,13 +4482,13 @@ type IgnorePluginOptions =
4438
4482
  /**
4439
4483
  * A RegExp to test the request against.
4440
4484
  */
4441
- resourceRegExp?: RegExp;
4485
+ resourceRegExp: RegExp;
4442
4486
  }
4443
4487
  | {
4444
4488
  /**
4445
4489
  * A filter function for resource and context.
4446
4490
  */
4447
- checkResource?: (resource: string, context: string) => boolean;
4491
+ checkResource: (resource: string, context: string) => boolean;
4448
4492
  };
4449
4493
  declare interface ImportModuleOptions {
4450
4494
  /**
@@ -6299,6 +6343,11 @@ declare interface MapOptions {
6299
6343
  * Options object for in-memory caching.
6300
6344
  */
6301
6345
  declare interface MemoryCacheOptions {
6346
+ /**
6347
+ * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
6348
+ */
6349
+ cacheUnaffected?: boolean;
6350
+
6302
6351
  /**
6303
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).
6304
6353
  */
@@ -6495,6 +6544,7 @@ declare class ModuleDependency extends Dependency {
6495
6544
  static Template: typeof DependencyTemplate;
6496
6545
  static NO_EXPORTS_REFERENCED: string[][];
6497
6546
  static EXPORTS_OBJECT_REFERENCED: string[][];
6547
+ static TRANSITIVE: typeof TRANSITIVE;
6498
6548
  }
6499
6549
  declare abstract class ModuleFactory {
6500
6550
  create(
@@ -6521,6 +6571,11 @@ declare interface ModuleFactoryResult {
6521
6571
  fileDependencies?: Set<string>;
6522
6572
  contextDependencies?: Set<string>;
6523
6573
  missingDependencies?: Set<string>;
6574
+
6575
+ /**
6576
+ * allow to use the unsafe cache
6577
+ */
6578
+ cacheable?: boolean;
6524
6579
  }
6525
6580
  declare class ModuleFederationPlugin {
6526
6581
  constructor(options: ModuleFederationPluginOptions);
@@ -6678,12 +6733,16 @@ declare class ModuleGraph {
6678
6733
  setAsync(module: Module): void;
6679
6734
  getMeta(thing?: any): Object;
6680
6735
  getMetaIfExisting(thing?: any): Object;
6681
- freeze(): void;
6736
+ freeze(cacheStage?: string): void;
6682
6737
  unfreeze(): void;
6683
6738
  cached<T extends any[], V>(
6684
6739
  fn: (moduleGraph: ModuleGraph, ...args: T) => V,
6685
6740
  ...args: T
6686
6741
  ): V;
6742
+ setModuleMemCaches(
6743
+ moduleMemCaches: WeakMap<Module, WeakTupleMap<any, any>>
6744
+ ): void;
6745
+ dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
6687
6746
  static getModuleGraphForModule(
6688
6747
  module: Module,
6689
6748
  deprecateMessage: string,
@@ -7156,17 +7215,17 @@ declare interface NodeOptions {
7156
7215
  /**
7157
7216
  * Include a polyfill for the '__dirname' variable.
7158
7217
  */
7159
- __dirname?: boolean | "mock" | "eval-only";
7218
+ __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
7160
7219
 
7161
7220
  /**
7162
7221
  * Include a polyfill for the '__filename' variable.
7163
7222
  */
7164
- __filename?: boolean | "mock" | "eval-only";
7223
+ __filename?: boolean | "warn-mock" | "mock" | "eval-only";
7165
7224
 
7166
7225
  /**
7167
7226
  * Include a polyfill for the 'global' variable.
7168
7227
  */
7169
- global?: boolean;
7228
+ global?: boolean | "warn";
7170
7229
  }
7171
7230
  declare class NodeSourcePlugin {
7172
7231
  constructor();
@@ -7337,8 +7396,6 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
7337
7396
  }>;
7338
7397
  resolverFactory: ResolverFactory;
7339
7398
  ruleSet: RuleSet;
7340
- unsafeCache: boolean;
7341
- cachePredicate: Function;
7342
7399
  context: string;
7343
7400
  fs: InputFileSystem;
7344
7401
  parserCache: Map<string, WeakMap<Object, any>>;
@@ -7482,6 +7539,7 @@ declare class NullDependency extends Dependency {
7482
7539
  static Template: typeof NullDependencyTemplate;
7483
7540
  static NO_EXPORTS_REFERENCED: string[][];
7484
7541
  static EXPORTS_OBJECT_REFERENCED: string[][];
7542
+ static TRANSITIVE: typeof TRANSITIVE;
7485
7543
  }
7486
7544
  declare class NullDependencyTemplate extends DependencyTemplate {
7487
7545
  constructor();
@@ -9778,6 +9836,7 @@ declare class RuntimeChunkPlugin {
9778
9836
  */
9779
9837
  apply(compiler: Compiler): void;
9780
9838
  }
9839
+ type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
9781
9840
  declare class RuntimeModule extends Module {
9782
9841
  constructor(name: string, stage?: number);
9783
9842
  name: string;
@@ -9824,7 +9883,8 @@ declare interface RuntimeRequirementsContext {
9824
9883
  codeGenerationResults: CodeGenerationResults;
9825
9884
  }
9826
9885
  type RuntimeSpec = undefined | string | SortableSet<string>;
9827
- declare abstract class RuntimeSpecMap<T> {
9886
+ declare class RuntimeSpecMap<T> {
9887
+ constructor(clone?: RuntimeSpecMap<T>);
9828
9888
  get(runtime: RuntimeSpec): T;
9829
9889
  has(runtime: RuntimeSpec): boolean;
9830
9890
  set(runtime?: any, value?: any): void;
@@ -9835,7 +9895,8 @@ declare abstract class RuntimeSpecMap<T> {
9835
9895
  values(): IterableIterator<T>;
9836
9896
  readonly size?: number;
9837
9897
  }
9838
- declare abstract class RuntimeSpecSet {
9898
+ declare class RuntimeSpecSet {
9899
+ constructor(iterable?: any);
9839
9900
  add(runtime?: any): void;
9840
9901
  has(runtime?: any): boolean;
9841
9902
  [Symbol.iterator](): IterableIterator<RuntimeSpec>;
@@ -11251,6 +11312,7 @@ declare interface SyntheticDependencyLocation {
11251
11312
  index?: number;
11252
11313
  }
11253
11314
  declare const TOMBSTONE: unique symbol;
11315
+ declare const TRANSITIVE: unique symbol;
11254
11316
  declare const TRANSITIVE_ONLY: unique symbol;
11255
11317
  declare interface TagInfo {
11256
11318
  tag: any;
@@ -11294,6 +11356,10 @@ declare interface TimestampAndHash {
11294
11356
  timestamp?: number;
11295
11357
  hash: string;
11296
11358
  }
11359
+ declare class TopLevelSymbol {
11360
+ constructor(name: string);
11361
+ name: string;
11362
+ }
11297
11363
 
11298
11364
  /**
11299
11365
  * Use a Trusted Types policy to create urls for chunks.
@@ -11611,6 +11677,14 @@ declare abstract class Watching {
11611
11677
  resume(): void;
11612
11678
  close(callback: CallbackFunction<void>): void;
11613
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
+ }
11614
11688
  declare interface WebAssemblyRenderContext {
11615
11689
  /**
11616
11690
  * the chunk
@@ -12017,10 +12091,23 @@ declare namespace exports {
12017
12091
  export let NAMESPACE: string;
12018
12092
  export let REGEXP_NAMESPACE: RegExp;
12019
12093
  export let createFilename: (
12020
- module: any,
12094
+ module: string | Module,
12021
12095
  options: any,
12022
- __2: { requestShortener: any; chunkGraph: any }
12023
- ) => 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;
12024
12111
  export let replaceDuplicates: (
12025
12112
  array?: any,
12026
12113
  fn?: any,
@@ -12137,6 +12224,52 @@ declare namespace exports {
12137
12224
  };
12138
12225
  }
12139
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
+ }
12140
12273
  export {
12141
12274
  AggressiveMergingPlugin,
12142
12275
  AggressiveSplittingPlugin,
@@ -12262,6 +12395,59 @@ declare namespace exports {
12262
12395
  b: DependencyLocation
12263
12396
  ) => 0 | 1 | -1;
12264
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
+ }
12265
12451
  export namespace serialization {
12266
12452
  export const register: (
12267
12453
  Constructor: Constructor,
@@ -12276,7 +12462,10 @@ declare namespace exports {
12276
12462
  export const registerNotSerializable: (Constructor: Constructor) => void;
12277
12463
  export const NOT_SERIALIZABLE: object;
12278
12464
  export const buffersSerializer: Serializer;
12279
- export let createFileSerializer: (fs?: any) => Serializer;
12465
+ export let createFileSerializer: (
12466
+ fs?: any,
12467
+ hashFunction?: any
12468
+ ) => Serializer;
12280
12469
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
12281
12470
  }
12282
12471
  export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
@@ -12404,5 +12593,6 @@ declare namespace exports {
12404
12593
  LoaderContext
12405
12594
  };
12406
12595
  }
12596
+ declare const topLevelSymbolTag: unique symbol;
12407
12597
 
12408
12598
  export = exports;