webpack 5.39.1 → 5.42.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/README.md +13 -13
- package/bin/webpack.js +0 -0
- package/lib/Compiler.js +14 -1
- package/lib/ConditionalInitFragment.js +15 -12
- package/lib/DependencyTemplate.js +3 -2
- package/lib/ExternalModule.js +213 -33
- package/lib/ExternalModuleFactoryPlugin.js +2 -1
- package/lib/InitFragment.js +10 -7
- package/lib/MainTemplate.js +1 -1
- package/lib/ModuleTemplate.js +0 -9
- package/lib/NormalModuleFactory.js +12 -2
- package/lib/RuntimeTemplate.js +8 -0
- package/lib/Template.js +3 -2
- package/lib/TemplatedPathPlugin.js +24 -26
- package/lib/Watching.js +2 -1
- package/lib/WebpackOptionsApply.js +12 -8
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -1
- package/lib/cache/IdleFileCachePlugin.js +60 -13
- package/lib/cache/PackFileCacheStrategy.js +27 -16
- package/lib/cli.js +1 -1
- package/lib/config/defaults.js +54 -12
- package/lib/config/normalization.js +2 -0
- package/lib/dependencies/HarmonyExportInitFragment.js +4 -1
- package/lib/dependencies/WorkerPlugin.js +25 -10
- package/lib/electron/ElectronTargetPlugin.js +3 -3
- package/lib/esm/ModuleChunkFormatPlugin.js +97 -0
- package/lib/esm/ModuleChunkLoadingPlugin.js +63 -0
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +208 -0
- package/lib/hmr/lazyCompilationBackend.js +17 -1
- package/lib/javascript/EnableChunkLoadingPlugin.js +5 -3
- package/lib/javascript/JavascriptModulesPlugin.js +80 -17
- package/lib/javascript/JavascriptParser.js +12 -4
- package/lib/node/NodeTargetPlugin.js +2 -1
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +44 -22
- package/lib/optimize/InnerGraphPlugin.js +33 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +1 -1
- package/lib/runtime/AsyncModuleRuntimeModule.js +8 -4
- package/lib/serialization/BinaryMiddleware.js +50 -35
- package/lib/serialization/FileMiddleware.js +112 -12
- package/lib/serialization/PlainObjectSerializer.js +17 -8
- package/lib/serialization/Serializer.js +2 -2
- package/lib/serialization/SerializerMiddleware.js +7 -4
- package/lib/util/LazySet.js +26 -17
- package/lib/wasm/EnableWasmLoadingPlugin.js +10 -1
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
- package/package.json +18 -18
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +22 -8
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +2 -1
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +2 -1
- package/types.d.ts +120 -162
package/types.d.ts
CHANGED
@@ -52,15 +52,16 @@ import {
|
|
52
52
|
NewExpression,
|
53
53
|
ObjectExpression,
|
54
54
|
ObjectPattern,
|
55
|
+
PrivateIdentifier,
|
55
56
|
Program,
|
56
57
|
Property,
|
58
|
+
PropertyDefinition,
|
57
59
|
RegExpLiteral,
|
58
60
|
RestElement,
|
59
61
|
ReturnStatement,
|
60
62
|
SequenceExpression,
|
61
63
|
SimpleCallExpression,
|
62
64
|
SimpleLiteral,
|
63
|
-
SourceLocation,
|
64
65
|
SpreadElement,
|
65
66
|
Super,
|
66
67
|
SwitchCase,
|
@@ -118,11 +119,11 @@ declare class AbstractLibraryPlugin<T> {
|
|
118
119
|
): void;
|
119
120
|
embedInRuntimeBailout(
|
120
121
|
module: Module,
|
121
|
-
renderContext:
|
122
|
+
renderContext: RenderContext,
|
122
123
|
libraryContext: LibraryContext<T>
|
123
124
|
): undefined | string;
|
124
125
|
strictRuntimeBailout(
|
125
|
-
renderContext:
|
126
|
+
renderContext: RenderContext,
|
126
127
|
libraryContext: LibraryContext<T>
|
127
128
|
): undefined | string;
|
128
129
|
runtimeRequirements(
|
@@ -132,7 +133,7 @@ declare class AbstractLibraryPlugin<T> {
|
|
132
133
|
): void;
|
133
134
|
render(
|
134
135
|
source: Source,
|
135
|
-
renderContext:
|
136
|
+
renderContext: RenderContext,
|
136
137
|
libraryContext: LibraryContext<T>
|
137
138
|
): Source;
|
138
139
|
renderStartup(
|
@@ -1062,6 +1063,42 @@ declare class ChunkPrefetchPreloadPlugin {
|
|
1062
1063
|
constructor();
|
1063
1064
|
apply(compiler: Compiler): void;
|
1064
1065
|
}
|
1066
|
+
declare interface ChunkRenderContext {
|
1067
|
+
/**
|
1068
|
+
* the chunk
|
1069
|
+
*/
|
1070
|
+
chunk: Chunk;
|
1071
|
+
|
1072
|
+
/**
|
1073
|
+
* the dependency templates
|
1074
|
+
*/
|
1075
|
+
dependencyTemplates: DependencyTemplates;
|
1076
|
+
|
1077
|
+
/**
|
1078
|
+
* the runtime template
|
1079
|
+
*/
|
1080
|
+
runtimeTemplate: RuntimeTemplate;
|
1081
|
+
|
1082
|
+
/**
|
1083
|
+
* the module graph
|
1084
|
+
*/
|
1085
|
+
moduleGraph: ModuleGraph;
|
1086
|
+
|
1087
|
+
/**
|
1088
|
+
* the chunk graph
|
1089
|
+
*/
|
1090
|
+
chunkGraph: ChunkGraph;
|
1091
|
+
|
1092
|
+
/**
|
1093
|
+
* results of code generation
|
1094
|
+
*/
|
1095
|
+
codeGenerationResults: CodeGenerationResults;
|
1096
|
+
|
1097
|
+
/**
|
1098
|
+
* init fragments for the chunk
|
1099
|
+
*/
|
1100
|
+
chunkInitFragments: InitFragment<ChunkRenderContext>[];
|
1101
|
+
}
|
1065
1102
|
declare interface ChunkSizeOptions {
|
1066
1103
|
/**
|
1067
1104
|
* constant overhead for a chunk
|
@@ -1749,27 +1786,28 @@ declare interface CompilationAssets {
|
|
1749
1786
|
[index: string]: Source;
|
1750
1787
|
}
|
1751
1788
|
declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
|
1752
|
-
renderModuleContent: SyncWaterfallHook<[Source, Module,
|
1789
|
+
renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContext]>;
|
1753
1790
|
}
|
1754
1791
|
declare interface CompilationHooksJavascriptModulesPlugin {
|
1755
|
-
renderModuleContent: SyncWaterfallHook<[Source, Module,
|
1792
|
+
renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
|
1756
1793
|
renderModuleContainer: SyncWaterfallHook<
|
1757
|
-
[Source, Module,
|
1794
|
+
[Source, Module, ChunkRenderContext]
|
1758
1795
|
>;
|
1759
|
-
renderModulePackage: SyncWaterfallHook<[Source, Module,
|
1760
|
-
renderChunk: SyncWaterfallHook<[Source,
|
1761
|
-
renderMain: SyncWaterfallHook<[Source,
|
1762
|
-
|
1796
|
+
renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
|
1797
|
+
renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
|
1798
|
+
renderMain: SyncWaterfallHook<[Source, RenderContext]>;
|
1799
|
+
renderContent: SyncWaterfallHook<[Source, RenderContext]>;
|
1800
|
+
render: SyncWaterfallHook<[Source, RenderContext]>;
|
1763
1801
|
renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
|
1764
1802
|
renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
|
1765
1803
|
inlineInRuntimeBailout: SyncBailHook<
|
1766
1804
|
[Module, RenderBootstrapContext],
|
1767
1805
|
string
|
1768
1806
|
>;
|
1769
|
-
embedInRuntimeBailout: SyncBailHook<[Module,
|
1770
|
-
strictRuntimeBailout: SyncBailHook<[
|
1807
|
+
embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
|
1808
|
+
strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
|
1771
1809
|
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
|
1772
|
-
useSourceMap: SyncBailHook<[Chunk,
|
1810
|
+
useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
|
1773
1811
|
}
|
1774
1812
|
declare interface CompilationHooksRealContentHashPlugin {
|
1775
1813
|
updateHash: SyncBailHook<[Buffer[], string], string>;
|
@@ -2017,7 +2055,8 @@ declare interface Configuration {
|
|
2017
2055
|
| "system"
|
2018
2056
|
| "promise"
|
2019
2057
|
| "import"
|
2020
|
-
| "script"
|
2058
|
+
| "script"
|
2059
|
+
| "node-commonjs";
|
2021
2060
|
|
2022
2061
|
/**
|
2023
2062
|
* Ignore specific warnings.
|
@@ -2576,7 +2615,7 @@ declare interface DependencyTemplateContext {
|
|
2576
2615
|
/**
|
2577
2616
|
* mutable array of init fragments for the current module
|
2578
2617
|
*/
|
2579
|
-
initFragments: InitFragment[];
|
2618
|
+
initFragments: InitFragment<GenerateContext>[];
|
2580
2619
|
|
2581
2620
|
/**
|
2582
2621
|
* when in a concatenated module, information about other concatenated modules
|
@@ -2910,7 +2949,7 @@ declare abstract class EntryDependency extends ModuleDependency {}
|
|
2910
2949
|
*/
|
2911
2950
|
declare interface EntryDescription {
|
2912
2951
|
/**
|
2913
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
2952
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
2914
2953
|
*/
|
2915
2954
|
chunkLoading?: string | false;
|
2916
2955
|
|
@@ -2960,7 +2999,7 @@ declare interface EntryDescription {
|
|
2960
2999
|
*/
|
2961
3000
|
declare interface EntryDescriptionNormalized {
|
2962
3001
|
/**
|
2963
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
3002
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
2964
3003
|
*/
|
2965
3004
|
chunkLoading?: string | false;
|
2966
3005
|
|
@@ -3579,6 +3618,11 @@ declare interface ExternalItemFunctionData {
|
|
3579
3618
|
*/
|
3580
3619
|
contextInfo?: ModuleFactoryCreateDataContextInfo;
|
3581
3620
|
|
3621
|
+
/**
|
3622
|
+
* The category of the referencing dependencies.
|
3623
|
+
*/
|
3624
|
+
dependencyType?: string;
|
3625
|
+
|
3582
3626
|
/**
|
3583
3627
|
* Get a resolve function with the current resolver options.
|
3584
3628
|
*/
|
@@ -3622,11 +3666,6 @@ declare class ExternalModule extends Module {
|
|
3622
3666
|
request: string | string[] | Record<string, string | string[]>;
|
3623
3667
|
externalType: string;
|
3624
3668
|
userRequest: string;
|
3625
|
-
getSourceData(
|
3626
|
-
runtimeTemplate?: any,
|
3627
|
-
moduleGraph?: any,
|
3628
|
-
chunkGraph?: any
|
3629
|
-
): SourceData;
|
3630
3669
|
}
|
3631
3670
|
declare interface ExternalModuleInfo {
|
3632
3671
|
index: number;
|
@@ -3719,7 +3758,8 @@ type ExternalsType =
|
|
3719
3758
|
| "system"
|
3720
3759
|
| "promise"
|
3721
3760
|
| "import"
|
3722
|
-
| "script"
|
3761
|
+
| "script"
|
3762
|
+
| "node-commonjs";
|
3723
3763
|
declare interface FactorizeModuleOptions {
|
3724
3764
|
currentProfile: ModuleProfile;
|
3725
3765
|
factory: ModuleFactory;
|
@@ -3778,18 +3818,28 @@ declare interface FileCacheOptions {
|
|
3778
3818
|
*/
|
3779
3819
|
cacheLocation?: string;
|
3780
3820
|
|
3821
|
+
/**
|
3822
|
+
* Compression type used for the cache files.
|
3823
|
+
*/
|
3824
|
+
compression?: false | "gzip" | "brotli";
|
3825
|
+
|
3781
3826
|
/**
|
3782
3827
|
* Algorithm used for generation the hash (see node.js crypto package).
|
3783
3828
|
*/
|
3784
3829
|
hashAlgorithm?: string;
|
3785
3830
|
|
3786
3831
|
/**
|
3787
|
-
* Time in ms after which idle period the cache storing should happen
|
3832
|
+
* Time in ms after which idle period the cache storing should happen.
|
3788
3833
|
*/
|
3789
3834
|
idleTimeout?: number;
|
3790
3835
|
|
3791
3836
|
/**
|
3792
|
-
* Time in ms after which idle period the
|
3837
|
+
* Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
|
3838
|
+
*/
|
3839
|
+
idleTimeoutAfterLargeChanges?: number;
|
3840
|
+
|
3841
|
+
/**
|
3842
|
+
* Time in ms after which idle period the initial cache storing should happen.
|
3793
3843
|
*/
|
3794
3844
|
idleTimeoutForInitialStore?: number;
|
3795
3845
|
|
@@ -4363,14 +4413,14 @@ declare interface InfrastructureLogging {
|
|
4363
4413
|
*/
|
4364
4414
|
stream?: NodeJS.WritableStream;
|
4365
4415
|
}
|
4366
|
-
declare abstract class InitFragment {
|
4416
|
+
declare abstract class InitFragment<Context> {
|
4367
4417
|
content: string | Source;
|
4368
4418
|
stage: number;
|
4369
4419
|
position: number;
|
4370
4420
|
key?: string;
|
4371
4421
|
endContent?: string | Source;
|
4372
|
-
getContent(
|
4373
|
-
getEndContent(
|
4422
|
+
getContent(context: Context): string | Source;
|
4423
|
+
getEndContent(context: Context): undefined | string | Source;
|
4374
4424
|
merge: any;
|
4375
4425
|
}
|
4376
4426
|
declare interface InputFileSystem {
|
@@ -4457,12 +4507,12 @@ declare class JavascriptModulesPlugin {
|
|
4457
4507
|
apply(compiler: Compiler): void;
|
4458
4508
|
renderModule(
|
4459
4509
|
module: Module,
|
4460
|
-
renderContext:
|
4510
|
+
renderContext: ChunkRenderContext,
|
4461
4511
|
hooks: CompilationHooksJavascriptModulesPlugin,
|
4462
4512
|
factory: boolean | "strict"
|
4463
4513
|
): Source;
|
4464
4514
|
renderChunk(
|
4465
|
-
renderContext:
|
4515
|
+
renderContext: RenderContext,
|
4466
4516
|
hooks: CompilationHooksJavascriptModulesPlugin
|
4467
4517
|
): Source;
|
4468
4518
|
renderMain(
|
@@ -4559,7 +4609,7 @@ declare class JavascriptParser extends Parser {
|
|
4559
4609
|
| FunctionDeclaration
|
4560
4610
|
| VariableDeclaration
|
4561
4611
|
| ClassDeclaration
|
4562
|
-
|
|
4612
|
+
| PrivateIdentifier
|
4563
4613
|
),
|
4564
4614
|
number
|
4565
4615
|
],
|
@@ -4663,7 +4713,7 @@ declare class JavascriptParser extends Parser {
|
|
4663
4713
|
>;
|
4664
4714
|
classBodyElement: SyncBailHook<
|
4665
4715
|
[
|
4666
|
-
MethodDefinition |
|
4716
|
+
MethodDefinition | PropertyDefinition,
|
4667
4717
|
ClassExpression | ClassDeclaration
|
4668
4718
|
],
|
4669
4719
|
boolean | void
|
@@ -4671,7 +4721,7 @@ declare class JavascriptParser extends Parser {
|
|
4671
4721
|
classBodyValue: SyncBailHook<
|
4672
4722
|
[
|
4673
4723
|
Expression,
|
4674
|
-
MethodDefinition |
|
4724
|
+
MethodDefinition | PropertyDefinition,
|
4675
4725
|
ClassExpression | ClassDeclaration
|
4676
4726
|
],
|
4677
4727
|
boolean | void
|
@@ -4987,7 +5037,7 @@ declare class JavascriptParser extends Parser {
|
|
4987
5037
|
| FunctionDeclaration
|
4988
5038
|
| VariableDeclaration
|
4989
5039
|
| ClassDeclaration
|
4990
|
-
|
|
5040
|
+
| PrivateIdentifier,
|
4991
5041
|
commentsStartPos: number
|
4992
5042
|
): boolean;
|
4993
5043
|
getComments(range?: any): any[];
|
@@ -5795,11 +5845,13 @@ type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
|
|
5795
5845
|
LoaderRunnerLoaderContext<OptionsType> &
|
5796
5846
|
LoaderPluginLoaderContext &
|
5797
5847
|
HotModuleReplacementPluginLoaderContext;
|
5798
|
-
type LoaderDefinition<
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5848
|
+
type LoaderDefinition<
|
5849
|
+
OptionsType = {},
|
5850
|
+
ContextAdditions = {}
|
5851
|
+
> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
5852
|
+
raw?: false;
|
5853
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
5854
|
+
};
|
5803
5855
|
declare interface LoaderDefinitionFunction<
|
5804
5856
|
OptionsType = {},
|
5805
5857
|
ContextAdditions = {}
|
@@ -6395,7 +6447,8 @@ declare interface ModuleFederationPluginOptions {
|
|
6395
6447
|
| "system"
|
6396
6448
|
| "promise"
|
6397
6449
|
| "import"
|
6398
|
-
| "script"
|
6450
|
+
| "script"
|
6451
|
+
| "node-commonjs";
|
6399
6452
|
|
6400
6453
|
/**
|
6401
6454
|
* Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
|
@@ -6920,6 +6973,7 @@ type NodeEstreeIndex =
|
|
6920
6973
|
| FunctionDeclaration
|
6921
6974
|
| VariableDeclaration
|
6922
6975
|
| ClassDeclaration
|
6976
|
+
| PrivateIdentifier
|
6923
6977
|
| ExpressionStatement
|
6924
6978
|
| BlockStatement
|
6925
6979
|
| EmptyStatement
|
@@ -6943,6 +6997,7 @@ type NodeEstreeIndex =
|
|
6943
6997
|
| ExportDefaultDeclaration
|
6944
6998
|
| ExportAllDeclaration
|
6945
6999
|
| MethodDefinition
|
7000
|
+
| PropertyDefinition
|
6946
7001
|
| VariableDeclarator
|
6947
7002
|
| Program
|
6948
7003
|
| Super
|
@@ -7148,6 +7203,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
|
7148
7203
|
fs: InputFileSystem;
|
7149
7204
|
parserCache: Map<string, WeakMap<Object, any>>;
|
7150
7205
|
generatorCache: Map<string, WeakMap<Object, Generator>>;
|
7206
|
+
cleanupForCache(): void;
|
7151
7207
|
resolveResource(
|
7152
7208
|
contextInfo?: any,
|
7153
7209
|
context?: any,
|
@@ -7204,7 +7260,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
|
|
7204
7260
|
};
|
7205
7261
|
emitFile(
|
7206
7262
|
name: string,
|
7207
|
-
content: string,
|
7263
|
+
content: string | Buffer,
|
7208
7264
|
sourceMap?: string,
|
7209
7265
|
assetInfo?: AssetInfo
|
7210
7266
|
): void;
|
@@ -7744,7 +7800,7 @@ declare interface Output {
|
|
7744
7800
|
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
7745
7801
|
|
7746
7802
|
/**
|
7747
|
-
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
|
7803
|
+
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
|
7748
7804
|
*/
|
7749
7805
|
chunkFormat?: string | false;
|
7750
7806
|
|
@@ -7754,7 +7810,7 @@ declare interface Output {
|
|
7754
7810
|
chunkLoadTimeout?: number;
|
7755
7811
|
|
7756
7812
|
/**
|
7757
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
7813
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
7758
7814
|
*/
|
7759
7815
|
chunkLoading?: string | false;
|
7760
7816
|
|
@@ -7959,7 +8015,7 @@ declare interface Output {
|
|
7959
8015
|
webassemblyModuleFilename?: string;
|
7960
8016
|
|
7961
8017
|
/**
|
7962
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
8018
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
7963
8019
|
*/
|
7964
8020
|
workerChunkLoading?: string | false;
|
7965
8021
|
|
@@ -8030,7 +8086,7 @@ declare interface OutputNormalized {
|
|
8030
8086
|
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
8031
8087
|
|
8032
8088
|
/**
|
8033
|
-
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
|
8089
|
+
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
|
8034
8090
|
*/
|
8035
8091
|
chunkFormat?: string | false;
|
8036
8092
|
|
@@ -8040,7 +8096,7 @@ declare interface OutputNormalized {
|
|
8040
8096
|
chunkLoadTimeout?: number;
|
8041
8097
|
|
8042
8098
|
/**
|
8043
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
8099
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
8044
8100
|
*/
|
8045
8101
|
chunkLoading?: string | false;
|
8046
8102
|
|
@@ -8230,7 +8286,7 @@ declare interface OutputNormalized {
|
|
8230
8286
|
webassemblyModuleFilename?: string;
|
8231
8287
|
|
8232
8288
|
/**
|
8233
|
-
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
8289
|
+
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
|
8234
8290
|
*/
|
8235
8291
|
workerChunkLoading?: string | false;
|
8236
8292
|
|
@@ -8409,12 +8465,6 @@ declare interface PrintedElement {
|
|
8409
8465
|
element: string;
|
8410
8466
|
content: string;
|
8411
8467
|
}
|
8412
|
-
declare interface PrivateIdentifierNode {
|
8413
|
-
type: "PrivateIdentifier";
|
8414
|
-
name: string;
|
8415
|
-
loc?: null | SourceLocation;
|
8416
|
-
range?: [number, number];
|
8417
|
-
}
|
8418
8468
|
declare interface Problem {
|
8419
8469
|
type: ProblemType;
|
8420
8470
|
path: string;
|
@@ -8532,71 +8582,6 @@ declare interface ProgressPluginOptions {
|
|
8532
8582
|
*/
|
8533
8583
|
profile?: null | boolean;
|
8534
8584
|
}
|
8535
|
-
declare interface PropertyDefinitionNode {
|
8536
|
-
type: "PropertyDefinition";
|
8537
|
-
key:
|
8538
|
-
| UnaryExpression
|
8539
|
-
| ThisExpression
|
8540
|
-
| ArrayExpression
|
8541
|
-
| ObjectExpression
|
8542
|
-
| FunctionExpression
|
8543
|
-
| ArrowFunctionExpression
|
8544
|
-
| YieldExpression
|
8545
|
-
| SimpleLiteral
|
8546
|
-
| RegExpLiteral
|
8547
|
-
| BigIntLiteral
|
8548
|
-
| UpdateExpression
|
8549
|
-
| BinaryExpression
|
8550
|
-
| AssignmentExpression
|
8551
|
-
| LogicalExpression
|
8552
|
-
| MemberExpression
|
8553
|
-
| ConditionalExpression
|
8554
|
-
| SimpleCallExpression
|
8555
|
-
| NewExpression
|
8556
|
-
| SequenceExpression
|
8557
|
-
| TemplateLiteral
|
8558
|
-
| TaggedTemplateExpression
|
8559
|
-
| ClassExpression
|
8560
|
-
| MetaProperty
|
8561
|
-
| Identifier
|
8562
|
-
| AwaitExpression
|
8563
|
-
| ImportExpression
|
8564
|
-
| ChainExpression
|
8565
|
-
| PrivateIdentifierNode;
|
8566
|
-
value:
|
8567
|
-
| null
|
8568
|
-
| UnaryExpression
|
8569
|
-
| ThisExpression
|
8570
|
-
| ArrayExpression
|
8571
|
-
| ObjectExpression
|
8572
|
-
| FunctionExpression
|
8573
|
-
| ArrowFunctionExpression
|
8574
|
-
| YieldExpression
|
8575
|
-
| SimpleLiteral
|
8576
|
-
| RegExpLiteral
|
8577
|
-
| BigIntLiteral
|
8578
|
-
| UpdateExpression
|
8579
|
-
| BinaryExpression
|
8580
|
-
| AssignmentExpression
|
8581
|
-
| LogicalExpression
|
8582
|
-
| MemberExpression
|
8583
|
-
| ConditionalExpression
|
8584
|
-
| SimpleCallExpression
|
8585
|
-
| NewExpression
|
8586
|
-
| SequenceExpression
|
8587
|
-
| TemplateLiteral
|
8588
|
-
| TaggedTemplateExpression
|
8589
|
-
| ClassExpression
|
8590
|
-
| MetaProperty
|
8591
|
-
| Identifier
|
8592
|
-
| AwaitExpression
|
8593
|
-
| ImportExpression
|
8594
|
-
| ChainExpression;
|
8595
|
-
computed: boolean;
|
8596
|
-
static: boolean;
|
8597
|
-
loc?: null | SourceLocation;
|
8598
|
-
range?: [number, number];
|
8599
|
-
}
|
8600
8585
|
declare class ProvidePlugin {
|
8601
8586
|
constructor(definitions: Record<string, string | string[]>);
|
8602
8587
|
definitions: Record<string, string | string[]>;
|
@@ -8662,11 +8647,13 @@ declare interface RawChunkGroupOptions {
|
|
8662
8647
|
preloadOrder?: number;
|
8663
8648
|
prefetchOrder?: number;
|
8664
8649
|
}
|
8665
|
-
type RawLoaderDefinition<
|
8666
|
-
|
8667
|
-
|
8668
|
-
|
8669
|
-
|
8650
|
+
type RawLoaderDefinition<
|
8651
|
+
OptionsType = {},
|
8652
|
+
ContextAdditions = {}
|
8653
|
+
> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
8654
|
+
raw: true;
|
8655
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
8656
|
+
};
|
8670
8657
|
declare interface RawLoaderDefinitionFunction<
|
8671
8658
|
OptionsType = {},
|
8672
8659
|
ContextAdditions = {}
|
@@ -8775,33 +8762,7 @@ declare interface RenderBootstrapContext {
|
|
8775
8762
|
*/
|
8776
8763
|
hash: string;
|
8777
8764
|
}
|
8778
|
-
declare interface
|
8779
|
-
/**
|
8780
|
-
* the chunk
|
8781
|
-
*/
|
8782
|
-
chunk: Chunk;
|
8783
|
-
|
8784
|
-
/**
|
8785
|
-
* the dependency templates
|
8786
|
-
*/
|
8787
|
-
dependencyTemplates: DependencyTemplates;
|
8788
|
-
|
8789
|
-
/**
|
8790
|
-
* the runtime template
|
8791
|
-
*/
|
8792
|
-
runtimeTemplate: RuntimeTemplate;
|
8793
|
-
|
8794
|
-
/**
|
8795
|
-
* the module graph
|
8796
|
-
*/
|
8797
|
-
moduleGraph: ModuleGraph;
|
8798
|
-
|
8799
|
-
/**
|
8800
|
-
* the chunk graph
|
8801
|
-
*/
|
8802
|
-
chunkGraph: ChunkGraph;
|
8803
|
-
}
|
8804
|
-
declare interface RenderContextObject {
|
8765
|
+
declare interface RenderContext {
|
8805
8766
|
/**
|
8806
8767
|
* the chunk
|
8807
8768
|
*/
|
@@ -9735,6 +9696,7 @@ declare abstract class RuntimeTemplate {
|
|
9735
9696
|
expressionFunction(expression?: any, args?: string): string;
|
9736
9697
|
emptyFunction(): "x => {}" | "function() {}";
|
9737
9698
|
destructureArray(items?: any, value?: any): string;
|
9699
|
+
destructureObject(items?: any, value?: any): string;
|
9738
9700
|
iife(args?: any, body?: any): string;
|
9739
9701
|
forEach(variable?: any, array?: any, body?: any): string;
|
9740
9702
|
|
@@ -10033,7 +9995,7 @@ declare abstract class RuntimeTemplate {
|
|
10033
9995
|
/**
|
10034
9996
|
* init fragments will be added here
|
10035
9997
|
*/
|
10036
|
-
initFragments: InitFragment[];
|
9998
|
+
initFragments: InitFragment<any>[];
|
10037
9999
|
/**
|
10038
10000
|
* runtime for which this code will be generated
|
10039
10001
|
*/
|
@@ -10397,11 +10359,6 @@ declare class Source {
|
|
10397
10359
|
source(): string | Buffer;
|
10398
10360
|
buffer(): Buffer;
|
10399
10361
|
}
|
10400
|
-
declare interface SourceData {
|
10401
|
-
iife?: boolean;
|
10402
|
-
init?: string;
|
10403
|
-
expression: string;
|
10404
|
-
}
|
10405
10362
|
declare interface SourceLike {
|
10406
10363
|
source(): string | Buffer;
|
10407
10364
|
}
|
@@ -10573,7 +10530,7 @@ declare abstract class StackedMap<K, V> {
|
|
10573
10530
|
readonly size: number;
|
10574
10531
|
createChild(): StackedMap<K, V>;
|
10575
10532
|
}
|
10576
|
-
type StartupRenderContext =
|
10533
|
+
type StartupRenderContext = RenderContext & { inlined: boolean };
|
10577
10534
|
type Statement =
|
10578
10535
|
| FunctionDeclaration
|
10579
10536
|
| VariableDeclaration
|
@@ -11140,21 +11097,21 @@ declare class Template {
|
|
11140
11097
|
static asString(str: string | string[]): string;
|
11141
11098
|
static getModulesArrayBounds(modules: WithId[]): false | [number, number];
|
11142
11099
|
static renderChunkModules(
|
11143
|
-
renderContext:
|
11100
|
+
renderContext: ChunkRenderContext,
|
11144
11101
|
modules: Module[],
|
11145
11102
|
renderModule: (arg0: Module) => Source,
|
11146
11103
|
prefix?: string
|
11147
11104
|
): Source;
|
11148
11105
|
static renderRuntimeModules(
|
11149
11106
|
runtimeModules: RuntimeModule[],
|
11150
|
-
renderContext:
|
11107
|
+
renderContext: RenderContext & {
|
11151
11108
|
codeGenerationResults?: CodeGenerationResults;
|
11152
11109
|
useStrict?: boolean;
|
11153
11110
|
}
|
11154
11111
|
): Source;
|
11155
11112
|
static renderChunkRuntimeModules(
|
11156
11113
|
runtimeModules: RuntimeModule[],
|
11157
|
-
renderContext:
|
11114
|
+
renderContext: RenderContext
|
11158
11115
|
): Source;
|
11159
11116
|
static NUMBER_OF_IDENTIFIER_START_CHARS: number;
|
11160
11117
|
static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
|
@@ -11632,7 +11589,8 @@ declare interface WebpackOptionsNormalized {
|
|
11632
11589
|
| "system"
|
11633
11590
|
| "promise"
|
11634
11591
|
| "import"
|
11635
|
-
| "script"
|
11592
|
+
| "script"
|
11593
|
+
| "node-commonjs";
|
11636
11594
|
|
11637
11595
|
/**
|
11638
11596
|
* Ignore specific warnings.
|