webpack 5.52.0 → 5.55.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.
- package/bin/webpack.js +0 -0
- package/lib/AsyncDependenciesBlock.js +9 -2
- package/lib/CacheFacade.js +10 -3
- package/lib/ChunkGraph.js +19 -8
- package/lib/CodeGenerationResults.js +7 -2
- package/lib/Compilation.js +549 -144
- package/lib/Compiler.js +12 -4
- package/lib/Dependency.js +11 -0
- package/lib/DependencyTemplates.js +8 -2
- package/lib/EvalDevToolModulePlugin.js +2 -1
- package/lib/EvalSourceMapDevToolPlugin.js +2 -1
- package/lib/ExternalModule.js +18 -9
- package/lib/FileSystemInfo.js +101 -170
- package/lib/FlagDependencyExportsPlugin.js +25 -16
- package/lib/JavascriptMetaInfoPlugin.js +6 -1
- package/lib/ModuleFactory.js +1 -0
- package/lib/ModuleFilenameHelpers.js +21 -7
- package/lib/ModuleGraph.js +90 -21
- package/lib/NodeStuffInWebError.js +34 -0
- package/lib/NodeStuffPlugin.js +59 -16
- package/lib/NormalModuleFactory.js +8 -43
- package/lib/SourceMapDevToolPlugin.js +7 -3
- package/lib/WebpackOptionsApply.js +19 -1
- package/lib/cache/PackFileCacheStrategy.js +183 -53
- package/lib/cache/getLazyHashedEtag.js +35 -8
- package/lib/config/defaults.js +32 -12
- package/lib/dependencies/CachedConstDependency.js +4 -3
- package/lib/dependencies/CommonJsExportRequireDependency.js +19 -9
- package/lib/dependencies/CommonJsFullRequireDependency.js +11 -9
- package/lib/dependencies/ConstDependency.js +12 -4
- package/lib/dependencies/ContextDependency.js +8 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +179 -163
- package/lib/dependencies/HarmonyImportDependency.js +4 -1
- package/lib/dependencies/JsonExportsDependency.js +7 -1
- package/lib/dependencies/ModuleDecoratorDependency.js +5 -2
- package/lib/dependencies/ModuleDependency.js +8 -0
- package/lib/dependencies/NullDependency.js +8 -4
- package/lib/dependencies/ProvidedDependency.js +6 -2
- package/lib/dependencies/PureExpressionDependency.js +5 -1
- package/lib/dependencies/RuntimeRequirementsDependency.js +5 -1
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +9 -0
- package/lib/ids/IdHelpers.js +21 -8
- package/lib/ids/NamedChunkIdsPlugin.js +3 -0
- package/lib/ids/NamedModuleIdsPlugin.js +3 -1
- package/lib/index.js +6 -0
- package/lib/javascript/BasicEvaluatedExpression.js +3 -0
- package/lib/javascript/JavascriptParser.js +22 -4
- package/lib/javascript/JavascriptParserHelpers.js +0 -2
- package/lib/node/NodeTargetPlugin.js +1 -0
- package/lib/optimize/ConcatenatedModule.js +25 -4
- package/lib/optimize/InnerGraph.js +22 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +2 -1
- package/lib/runtime/RelativeUrlRuntimeModule.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +1 -2
- package/lib/serialization/BinaryMiddleware.js +11 -2
- package/lib/serialization/FileMiddleware.js +24 -7
- package/lib/serialization/ObjectMiddleware.js +23 -12
- package/lib/util/WeakTupleMap.js +95 -92
- package/lib/util/createHash.js +10 -0
- package/lib/util/hash/BatchedHash.js +65 -0
- package/lib/util/hash/xxhash64.js +154 -0
- package/lib/util/internalSerializables.js +1 -0
- package/lib/util/serialization.js +10 -6
- package/package.json +11 -7
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +19 -3
- package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
- package/schemas/plugins/HashedModuleIdsPlugin.json +20 -2
- package/schemas/plugins/IgnorePlugin.check.js +1 -1
- package/schemas/plugins/IgnorePlugin.json +4 -2
- package/types.d.ts +211 -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
|
-
"
|
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
|
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
|
-
"
|
23
|
-
|
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(
|
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<
|
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
|
-
):
|
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,10 @@ declare class Compiler {
|
|
1894
1907
|
context: string;
|
1895
1908
|
requestShortener: RequestShortener;
|
1896
1909
|
cache: Cache;
|
1910
|
+
moduleMemCaches?: WeakMap<
|
1911
|
+
Module,
|
1912
|
+
{ hash: string; memCache: WeakTupleMap<any, any> }
|
1913
|
+
>;
|
1897
1914
|
compilerPath: string;
|
1898
1915
|
running: boolean;
|
1899
1916
|
idle: boolean;
|
@@ -1917,7 +1934,7 @@ declare class Compiler {
|
|
1917
1934
|
plugins?: WebpackPluginInstance[]
|
1918
1935
|
): Compiler;
|
1919
1936
|
isChild(): boolean;
|
1920
|
-
createCompilation(): Compilation;
|
1937
|
+
createCompilation(params?: any): Compilation;
|
1921
1938
|
newCompilation(params: CompilationParams): Compilation;
|
1922
1939
|
createNormalModuleFactory(): NormalModuleFactory;
|
1923
1940
|
createContextModuleFactory(): ContextModuleFactory;
|
@@ -2237,6 +2254,7 @@ declare class ConstDependency extends NullDependency {
|
|
2237
2254
|
static Template: typeof ConstDependencyTemplate;
|
2238
2255
|
static NO_EXPORTS_REFERENCED: string[][];
|
2239
2256
|
static EXPORTS_OBJECT_REFERENCED: string[][];
|
2257
|
+
static TRANSITIVE: typeof TRANSITIVE;
|
2240
2258
|
}
|
2241
2259
|
declare class ConstDependencyTemplate extends NullDependencyTemplate {
|
2242
2260
|
constructor();
|
@@ -2550,6 +2568,7 @@ declare class Dependency {
|
|
2550
2568
|
readonly category: string;
|
2551
2569
|
loc: DependencyLocation;
|
2552
2570
|
getResourceIdentifier(): null | string;
|
2571
|
+
couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
|
2553
2572
|
|
2554
2573
|
/**
|
2555
2574
|
* Returns the referenced module and export
|
@@ -2604,6 +2623,7 @@ declare class Dependency {
|
|
2604
2623
|
readonly disconnect: any;
|
2605
2624
|
static NO_EXPORTS_REFERENCED: string[][];
|
2606
2625
|
static EXPORTS_OBJECT_REFERENCED: string[][];
|
2626
|
+
static TRANSITIVE: typeof TRANSITIVE;
|
2607
2627
|
}
|
2608
2628
|
declare interface DependencyConstructor {
|
2609
2629
|
new (...args: any[]): Dependency;
|
@@ -3282,6 +3302,16 @@ declare interface Experiments {
|
|
3282
3302
|
*/
|
3283
3303
|
buildHttp?: boolean | HttpUriOptions;
|
3284
3304
|
|
3305
|
+
/**
|
3306
|
+
* Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
|
3307
|
+
*/
|
3308
|
+
cacheUnaffected?: boolean;
|
3309
|
+
|
3310
|
+
/**
|
3311
|
+
* Apply defaults of next major version.
|
3312
|
+
*/
|
3313
|
+
futureDefaults?: boolean;
|
3314
|
+
|
3285
3315
|
/**
|
3286
3316
|
* Enable module and chunk layers.
|
3287
3317
|
*/
|
@@ -3805,6 +3835,11 @@ declare interface FactorizeModuleOptions {
|
|
3805
3835
|
currentProfile: ModuleProfile;
|
3806
3836
|
factory: ModuleFactory;
|
3807
3837
|
dependencies: Dependency[];
|
3838
|
+
|
3839
|
+
/**
|
3840
|
+
* return full ModuleFactoryResult instead of only module
|
3841
|
+
*/
|
3842
|
+
factoryResult?: boolean;
|
3808
3843
|
originModule: null | Module;
|
3809
3844
|
contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
|
3810
3845
|
context?: string;
|
@@ -3904,6 +3939,11 @@ declare interface FileCacheOptions {
|
|
3904
3939
|
*/
|
3905
3940
|
maxMemoryGenerations?: number;
|
3906
3941
|
|
3942
|
+
/**
|
3943
|
+
* Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
|
3944
|
+
*/
|
3945
|
+
memoryCacheUnaffected?: boolean;
|
3946
|
+
|
3907
3947
|
/**
|
3908
3948
|
* Name for the cache. Different names will lead to different coexisting caches.
|
3909
3949
|
*/
|
@@ -4301,7 +4341,7 @@ declare interface HashedModuleIdsPluginOptions {
|
|
4301
4341
|
/**
|
4302
4342
|
* The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
|
4303
4343
|
*/
|
4304
|
-
hashFunction?: string;
|
4344
|
+
hashFunction?: string | typeof Hash;
|
4305
4345
|
}
|
4306
4346
|
declare abstract class HelperRuntimeModule extends RuntimeModule {}
|
4307
4347
|
declare class HotModuleReplacementPlugin {
|
@@ -4438,13 +4478,13 @@ type IgnorePluginOptions =
|
|
4438
4478
|
/**
|
4439
4479
|
* A RegExp to test the request against.
|
4440
4480
|
*/
|
4441
|
-
resourceRegExp
|
4481
|
+
resourceRegExp: RegExp;
|
4442
4482
|
}
|
4443
4483
|
| {
|
4444
4484
|
/**
|
4445
4485
|
* A filter function for resource and context.
|
4446
4486
|
*/
|
4447
|
-
checkResource
|
4487
|
+
checkResource: (resource: string, context: string) => boolean;
|
4448
4488
|
};
|
4449
4489
|
declare interface ImportModuleOptions {
|
4450
4490
|
/**
|
@@ -6299,6 +6339,11 @@ declare interface MapOptions {
|
|
6299
6339
|
* Options object for in-memory caching.
|
6300
6340
|
*/
|
6301
6341
|
declare interface MemoryCacheOptions {
|
6342
|
+
/**
|
6343
|
+
* Additionally cache computation of modules that are unchanged and reference only unchanged modules.
|
6344
|
+
*/
|
6345
|
+
cacheUnaffected?: boolean;
|
6346
|
+
|
6302
6347
|
/**
|
6303
6348
|
* 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
6349
|
*/
|
@@ -6495,6 +6540,7 @@ declare class ModuleDependency extends Dependency {
|
|
6495
6540
|
static Template: typeof DependencyTemplate;
|
6496
6541
|
static NO_EXPORTS_REFERENCED: string[][];
|
6497
6542
|
static EXPORTS_OBJECT_REFERENCED: string[][];
|
6543
|
+
static TRANSITIVE: typeof TRANSITIVE;
|
6498
6544
|
}
|
6499
6545
|
declare abstract class ModuleFactory {
|
6500
6546
|
create(
|
@@ -6521,6 +6567,11 @@ declare interface ModuleFactoryResult {
|
|
6521
6567
|
fileDependencies?: Set<string>;
|
6522
6568
|
contextDependencies?: Set<string>;
|
6523
6569
|
missingDependencies?: Set<string>;
|
6570
|
+
|
6571
|
+
/**
|
6572
|
+
* allow to use the unsafe cache
|
6573
|
+
*/
|
6574
|
+
cacheable?: boolean;
|
6524
6575
|
}
|
6525
6576
|
declare class ModuleFederationPlugin {
|
6526
6577
|
constructor(options: ModuleFederationPluginOptions);
|
@@ -6678,12 +6729,16 @@ declare class ModuleGraph {
|
|
6678
6729
|
setAsync(module: Module): void;
|
6679
6730
|
getMeta(thing?: any): Object;
|
6680
6731
|
getMetaIfExisting(thing?: any): Object;
|
6681
|
-
freeze(): void;
|
6732
|
+
freeze(cacheStage?: string): void;
|
6682
6733
|
unfreeze(): void;
|
6683
6734
|
cached<T extends any[], V>(
|
6684
6735
|
fn: (moduleGraph: ModuleGraph, ...args: T) => V,
|
6685
6736
|
...args: T
|
6686
6737
|
): V;
|
6738
|
+
setModuleMemCaches(
|
6739
|
+
moduleMemCaches: WeakMap<Module, WeakTupleMap<any, any>>
|
6740
|
+
): void;
|
6741
|
+
dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
|
6687
6742
|
static getModuleGraphForModule(
|
6688
6743
|
module: Module,
|
6689
6744
|
deprecateMessage: string,
|
@@ -7156,17 +7211,17 @@ declare interface NodeOptions {
|
|
7156
7211
|
/**
|
7157
7212
|
* Include a polyfill for the '__dirname' variable.
|
7158
7213
|
*/
|
7159
|
-
__dirname?: boolean | "mock" | "eval-only";
|
7214
|
+
__dirname?: boolean | "warn-mock" | "mock" | "eval-only";
|
7160
7215
|
|
7161
7216
|
/**
|
7162
7217
|
* Include a polyfill for the '__filename' variable.
|
7163
7218
|
*/
|
7164
|
-
__filename?: boolean | "mock" | "eval-only";
|
7219
|
+
__filename?: boolean | "warn-mock" | "mock" | "eval-only";
|
7165
7220
|
|
7166
7221
|
/**
|
7167
7222
|
* Include a polyfill for the 'global' variable.
|
7168
7223
|
*/
|
7169
|
-
global?: boolean;
|
7224
|
+
global?: boolean | "warn";
|
7170
7225
|
}
|
7171
7226
|
declare class NodeSourcePlugin {
|
7172
7227
|
constructor();
|
@@ -7337,8 +7392,6 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
|
7337
7392
|
}>;
|
7338
7393
|
resolverFactory: ResolverFactory;
|
7339
7394
|
ruleSet: RuleSet;
|
7340
|
-
unsafeCache: boolean;
|
7341
|
-
cachePredicate: Function;
|
7342
7395
|
context: string;
|
7343
7396
|
fs: InputFileSystem;
|
7344
7397
|
parserCache: Map<string, WeakMap<Object, any>>;
|
@@ -7482,6 +7535,7 @@ declare class NullDependency extends Dependency {
|
|
7482
7535
|
static Template: typeof NullDependencyTemplate;
|
7483
7536
|
static NO_EXPORTS_REFERENCED: string[][];
|
7484
7537
|
static EXPORTS_OBJECT_REFERENCED: string[][];
|
7538
|
+
static TRANSITIVE: typeof TRANSITIVE;
|
7485
7539
|
}
|
7486
7540
|
declare class NullDependencyTemplate extends DependencyTemplate {
|
7487
7541
|
constructor();
|
@@ -9778,6 +9832,7 @@ declare class RuntimeChunkPlugin {
|
|
9778
9832
|
*/
|
9779
9833
|
apply(compiler: Compiler): void;
|
9780
9834
|
}
|
9835
|
+
type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
|
9781
9836
|
declare class RuntimeModule extends Module {
|
9782
9837
|
constructor(name: string, stage?: number);
|
9783
9838
|
name: string;
|
@@ -9824,7 +9879,8 @@ declare interface RuntimeRequirementsContext {
|
|
9824
9879
|
codeGenerationResults: CodeGenerationResults;
|
9825
9880
|
}
|
9826
9881
|
type RuntimeSpec = undefined | string | SortableSet<string>;
|
9827
|
-
declare
|
9882
|
+
declare class RuntimeSpecMap<T> {
|
9883
|
+
constructor(clone?: RuntimeSpecMap<T>);
|
9828
9884
|
get(runtime: RuntimeSpec): T;
|
9829
9885
|
has(runtime: RuntimeSpec): boolean;
|
9830
9886
|
set(runtime?: any, value?: any): void;
|
@@ -9835,7 +9891,8 @@ declare abstract class RuntimeSpecMap<T> {
|
|
9835
9891
|
values(): IterableIterator<T>;
|
9836
9892
|
readonly size?: number;
|
9837
9893
|
}
|
9838
|
-
declare
|
9894
|
+
declare class RuntimeSpecSet {
|
9895
|
+
constructor(iterable?: any);
|
9839
9896
|
add(runtime?: any): void;
|
9840
9897
|
has(runtime?: any): boolean;
|
9841
9898
|
[Symbol.iterator](): IterableIterator<RuntimeSpec>;
|
@@ -11251,6 +11308,7 @@ declare interface SyntheticDependencyLocation {
|
|
11251
11308
|
index?: number;
|
11252
11309
|
}
|
11253
11310
|
declare const TOMBSTONE: unique symbol;
|
11311
|
+
declare const TRANSITIVE: unique symbol;
|
11254
11312
|
declare const TRANSITIVE_ONLY: unique symbol;
|
11255
11313
|
declare interface TagInfo {
|
11256
11314
|
tag: any;
|
@@ -11294,6 +11352,10 @@ declare interface TimestampAndHash {
|
|
11294
11352
|
timestamp?: number;
|
11295
11353
|
hash: string;
|
11296
11354
|
}
|
11355
|
+
declare class TopLevelSymbol {
|
11356
|
+
constructor(name: string);
|
11357
|
+
name: string;
|
11358
|
+
}
|
11297
11359
|
|
11298
11360
|
/**
|
11299
11361
|
* Use a Trusted Types policy to create urls for chunks.
|
@@ -11611,6 +11673,14 @@ declare abstract class Watching {
|
|
11611
11673
|
resume(): void;
|
11612
11674
|
close(callback: CallbackFunction<void>): void;
|
11613
11675
|
}
|
11676
|
+
declare abstract class WeakTupleMap<T extends any[], V> {
|
11677
|
+
set(...args: [T, ...V[]]): void;
|
11678
|
+
has(...args: T): boolean;
|
11679
|
+
get(...args: T): V;
|
11680
|
+
provide(...args: [T, ...(() => V)[]]): V;
|
11681
|
+
delete(...args: T): void;
|
11682
|
+
clear(): void;
|
11683
|
+
}
|
11614
11684
|
declare interface WebAssemblyRenderContext {
|
11615
11685
|
/**
|
11616
11686
|
* the chunk
|
@@ -12017,10 +12087,23 @@ declare namespace exports {
|
|
12017
12087
|
export let NAMESPACE: string;
|
12018
12088
|
export let REGEXP_NAMESPACE: RegExp;
|
12019
12089
|
export let createFilename: (
|
12020
|
-
module:
|
12090
|
+
module: string | Module,
|
12021
12091
|
options: any,
|
12022
|
-
__2: {
|
12023
|
-
|
12092
|
+
__2: {
|
12093
|
+
/**
|
12094
|
+
* requestShortener
|
12095
|
+
*/
|
12096
|
+
requestShortener: RequestShortener;
|
12097
|
+
/**
|
12098
|
+
* chunk graph
|
12099
|
+
*/
|
12100
|
+
chunkGraph: ChunkGraph;
|
12101
|
+
/**
|
12102
|
+
* the hash function to use
|
12103
|
+
*/
|
12104
|
+
hashFunction: string | typeof Hash;
|
12105
|
+
}
|
12106
|
+
) => string;
|
12024
12107
|
export let replaceDuplicates: (
|
12025
12108
|
array?: any,
|
12026
12109
|
fn?: any,
|
@@ -12137,6 +12220,52 @@ declare namespace exports {
|
|
12137
12220
|
};
|
12138
12221
|
}
|
12139
12222
|
export namespace optimize {
|
12223
|
+
export namespace InnerGraph {
|
12224
|
+
export let bailout: (parserState: ParserState) => void;
|
12225
|
+
export let enable: (parserState: ParserState) => void;
|
12226
|
+
export let isEnabled: (parserState: ParserState) => boolean;
|
12227
|
+
export let addUsage: (
|
12228
|
+
state: ParserState,
|
12229
|
+
symbol: null | TopLevelSymbol,
|
12230
|
+
usage: string | true | TopLevelSymbol
|
12231
|
+
) => void;
|
12232
|
+
export let addVariableUsage: (
|
12233
|
+
parser: JavascriptParser,
|
12234
|
+
name: string,
|
12235
|
+
usage: string | true | TopLevelSymbol
|
12236
|
+
) => void;
|
12237
|
+
export let inferDependencyUsage: (state: ParserState) => void;
|
12238
|
+
export let onUsage: (
|
12239
|
+
state: ParserState,
|
12240
|
+
onUsageCallback: (arg0?: boolean | Set<string>) => void
|
12241
|
+
) => void;
|
12242
|
+
export let setTopLevelSymbol: (
|
12243
|
+
state: ParserState,
|
12244
|
+
symbol: TopLevelSymbol
|
12245
|
+
) => void;
|
12246
|
+
export let getTopLevelSymbol: (
|
12247
|
+
state: ParserState
|
12248
|
+
) => void | TopLevelSymbol;
|
12249
|
+
export let tagTopLevelSymbol: (
|
12250
|
+
parser: JavascriptParser,
|
12251
|
+
name: string
|
12252
|
+
) => TopLevelSymbol;
|
12253
|
+
export let isDependencyUsedByExports: (
|
12254
|
+
dependency: Dependency,
|
12255
|
+
usedByExports: boolean | Set<string>,
|
12256
|
+
moduleGraph: ModuleGraph,
|
12257
|
+
runtime: RuntimeSpec
|
12258
|
+
) => boolean;
|
12259
|
+
export let getDependencyUsedByExportsCondition: (
|
12260
|
+
dependency: Dependency,
|
12261
|
+
usedByExports: boolean | Set<string>,
|
12262
|
+
moduleGraph: ModuleGraph
|
12263
|
+
) =>
|
12264
|
+
| null
|
12265
|
+
| false
|
12266
|
+
| ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
|
12267
|
+
export { TopLevelSymbol, topLevelSymbolTag };
|
12268
|
+
}
|
12140
12269
|
export {
|
12141
12270
|
AggressiveMergingPlugin,
|
12142
12271
|
AggressiveSplittingPlugin,
|
@@ -12262,6 +12391,59 @@ declare namespace exports {
|
|
12262
12391
|
b: DependencyLocation
|
12263
12392
|
) => 0 | 1 | -1;
|
12264
12393
|
}
|
12394
|
+
export namespace runtime {
|
12395
|
+
export let getEntryRuntime: (
|
12396
|
+
compilation: Compilation,
|
12397
|
+
name: string,
|
12398
|
+
options?: EntryOptions
|
12399
|
+
) => RuntimeSpec;
|
12400
|
+
export let forEachRuntime: (
|
12401
|
+
runtime: RuntimeSpec,
|
12402
|
+
fn: (arg0: string) => void,
|
12403
|
+
deterministicOrder?: boolean
|
12404
|
+
) => void;
|
12405
|
+
export let getRuntimeKey: (runtime: RuntimeSpec) => string;
|
12406
|
+
export let keyToRuntime: (key: string) => RuntimeSpec;
|
12407
|
+
export let runtimeToString: (runtime: RuntimeSpec) => string;
|
12408
|
+
export let runtimeConditionToString: (
|
12409
|
+
runtimeCondition: RuntimeCondition
|
12410
|
+
) => string;
|
12411
|
+
export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
|
12412
|
+
export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
|
12413
|
+
export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
|
12414
|
+
export let mergeRuntimeCondition: (
|
12415
|
+
a: RuntimeCondition,
|
12416
|
+
b: RuntimeCondition,
|
12417
|
+
runtime: RuntimeSpec
|
12418
|
+
) => RuntimeCondition;
|
12419
|
+
export let mergeRuntimeConditionNonFalse: (
|
12420
|
+
a: undefined | string | true | SortableSet<string>,
|
12421
|
+
b: undefined | string | true | SortableSet<string>,
|
12422
|
+
runtime: RuntimeSpec
|
12423
|
+
) => undefined | string | true | SortableSet<string>;
|
12424
|
+
export let mergeRuntimeOwned: (
|
12425
|
+
a: RuntimeSpec,
|
12426
|
+
b: RuntimeSpec
|
12427
|
+
) => RuntimeSpec;
|
12428
|
+
export let intersectRuntime: (
|
12429
|
+
a: RuntimeSpec,
|
12430
|
+
b: RuntimeSpec
|
12431
|
+
) => RuntimeSpec;
|
12432
|
+
export let subtractRuntime: (
|
12433
|
+
a: RuntimeSpec,
|
12434
|
+
b: RuntimeSpec
|
12435
|
+
) => RuntimeSpec;
|
12436
|
+
export let subtractRuntimeCondition: (
|
12437
|
+
a: RuntimeCondition,
|
12438
|
+
b: RuntimeCondition,
|
12439
|
+
runtime: RuntimeSpec
|
12440
|
+
) => RuntimeCondition;
|
12441
|
+
export let filterRuntime: (
|
12442
|
+
runtime: RuntimeSpec,
|
12443
|
+
filter: (arg0: RuntimeSpec) => boolean
|
12444
|
+
) => undefined | string | boolean | SortableSet<string>;
|
12445
|
+
export { RuntimeSpecMap, RuntimeSpecSet };
|
12446
|
+
}
|
12265
12447
|
export namespace serialization {
|
12266
12448
|
export const register: (
|
12267
12449
|
Constructor: Constructor,
|
@@ -12276,7 +12458,10 @@ declare namespace exports {
|
|
12276
12458
|
export const registerNotSerializable: (Constructor: Constructor) => void;
|
12277
12459
|
export const NOT_SERIALIZABLE: object;
|
12278
12460
|
export const buffersSerializer: Serializer;
|
12279
|
-
export let createFileSerializer: (
|
12461
|
+
export let createFileSerializer: (
|
12462
|
+
fs?: any,
|
12463
|
+
hashFunction?: any
|
12464
|
+
) => Serializer;
|
12280
12465
|
export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
|
12281
12466
|
}
|
12282
12467
|
export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
|
@@ -12404,5 +12589,6 @@ declare namespace exports {
|
|
12404
12589
|
LoaderContext
|
12405
12590
|
};
|
12406
12591
|
}
|
12592
|
+
declare const topLevelSymbolTag: unique symbol;
|
12407
12593
|
|
12408
12594
|
export = exports;
|