webpack 5.39.0 → 5.41.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.
- package/README.md +13 -13
- package/bin/webpack.js +0 -0
- package/lib/Compilation.js +43 -28
- package/lib/ConditionalInitFragment.js +15 -12
- package/lib/DependencyTemplate.js +3 -2
- package/lib/ExternalModule.js +210 -35
- 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/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 +10 -7
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -1
- package/lib/cache/IdleFileCachePlugin.js +60 -13
- package/lib/cache/PackFileCacheStrategy.js +4 -1
- package/lib/cli.js +1 -1
- package/lib/config/defaults.js +53 -12
- package/lib/config/normalization.js +1 -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 +24 -14
- package/lib/serialization/FileMiddleware.js +30 -6
- package/lib/serialization/PlainObjectSerializer.js +17 -8
- package/lib/serialization/Serializer.js +2 -2
- package/lib/serialization/SerializerMiddleware.js +26 -4
- package/lib/util/ArrayQueue.js +8 -0
- package/lib/util/AsyncQueue.js +9 -0
- 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 +17 -17
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +16 -7
- package/types.d.ts +107 -158
@@ -243,10 +243,10 @@
|
|
243
243
|
]
|
244
244
|
},
|
245
245
|
"ChunkFormat": {
|
246
|
-
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).",
|
246
|
+
"description": "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).",
|
247
247
|
"anyOf": [
|
248
248
|
{
|
249
|
-
"enum": ["array-push", "commonjs", false]
|
249
|
+
"enum": ["array-push", "commonjs", "module", false]
|
250
250
|
},
|
251
251
|
{
|
252
252
|
"type": "string"
|
@@ -258,7 +258,7 @@
|
|
258
258
|
"type": "number"
|
259
259
|
},
|
260
260
|
"ChunkLoading": {
|
261
|
-
"description": "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).",
|
261
|
+
"description": "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).",
|
262
262
|
"anyOf": [
|
263
263
|
{
|
264
264
|
"enum": [false]
|
@@ -273,10 +273,10 @@
|
|
273
273
|
"type": "string"
|
274
274
|
},
|
275
275
|
"ChunkLoadingType": {
|
276
|
-
"description": "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).",
|
276
|
+
"description": "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).",
|
277
277
|
"anyOf": [
|
278
278
|
{
|
279
|
-
"enum": ["jsonp", "import-scripts", "require", "async-node"]
|
279
|
+
"enum": ["jsonp", "import-scripts", "require", "async-node", "import"]
|
280
280
|
},
|
281
281
|
{
|
282
282
|
"type": "string"
|
@@ -807,6 +807,10 @@
|
|
807
807
|
"type": "object",
|
808
808
|
"tsType": "import('../lib/ModuleFactory').ModuleFactoryCreateDataContextInfo"
|
809
809
|
},
|
810
|
+
"dependencyType": {
|
811
|
+
"description": "The category of the referencing dependencies.",
|
812
|
+
"type": "string"
|
813
|
+
},
|
810
814
|
"getResolve": {
|
811
815
|
"description": "Get a resolve function with the current resolver options.",
|
812
816
|
"instanceof": "Function",
|
@@ -956,12 +960,17 @@
|
|
956
960
|
"type": "string"
|
957
961
|
},
|
958
962
|
"idleTimeout": {
|
959
|
-
"description": "Time in ms after which idle period the cache storing should happen
|
963
|
+
"description": "Time in ms after which idle period the cache storing should happen.",
|
964
|
+
"type": "number",
|
965
|
+
"minimum": 0
|
966
|
+
},
|
967
|
+
"idleTimeoutAfterLargeChanges": {
|
968
|
+
"description": "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).",
|
960
969
|
"type": "number",
|
961
970
|
"minimum": 0
|
962
971
|
},
|
963
972
|
"idleTimeoutForInitialStore": {
|
964
|
-
"description": "Time in ms after which idle period the initial cache storing should happen
|
973
|
+
"description": "Time in ms after which idle period the initial cache storing should happen.",
|
965
974
|
"type": "number",
|
966
975
|
"minimum": 0
|
967
976
|
},
|
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(
|
@@ -358,6 +359,7 @@ declare abstract class AsyncQueue<T, K, R> {
|
|
358
359
|
isProcessing(item: T): boolean;
|
359
360
|
isQueued(item: T): boolean;
|
360
361
|
isDone(item: T): boolean;
|
362
|
+
clear(): void;
|
361
363
|
}
|
362
364
|
declare class AsyncWebAssemblyModulesPlugin {
|
363
365
|
constructor(options?: any);
|
@@ -1061,6 +1063,42 @@ declare class ChunkPrefetchPreloadPlugin {
|
|
1061
1063
|
constructor();
|
1062
1064
|
apply(compiler: Compiler): void;
|
1063
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
|
+
}
|
1064
1102
|
declare interface ChunkSizeOptions {
|
1065
1103
|
/**
|
1066
1104
|
* constant overhead for a chunk
|
@@ -1748,27 +1786,28 @@ declare interface CompilationAssets {
|
|
1748
1786
|
[index: string]: Source;
|
1749
1787
|
}
|
1750
1788
|
declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
|
1751
|
-
renderModuleContent: SyncWaterfallHook<[Source, Module,
|
1789
|
+
renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContext]>;
|
1752
1790
|
}
|
1753
1791
|
declare interface CompilationHooksJavascriptModulesPlugin {
|
1754
|
-
renderModuleContent: SyncWaterfallHook<[Source, Module,
|
1792
|
+
renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
|
1755
1793
|
renderModuleContainer: SyncWaterfallHook<
|
1756
|
-
[Source, Module,
|
1794
|
+
[Source, Module, ChunkRenderContext]
|
1757
1795
|
>;
|
1758
|
-
renderModulePackage: SyncWaterfallHook<[Source, Module,
|
1759
|
-
renderChunk: SyncWaterfallHook<[Source,
|
1760
|
-
renderMain: SyncWaterfallHook<[Source,
|
1761
|
-
|
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]>;
|
1762
1801
|
renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
|
1763
1802
|
renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
|
1764
1803
|
inlineInRuntimeBailout: SyncBailHook<
|
1765
1804
|
[Module, RenderBootstrapContext],
|
1766
1805
|
string
|
1767
1806
|
>;
|
1768
|
-
embedInRuntimeBailout: SyncBailHook<[Module,
|
1769
|
-
strictRuntimeBailout: SyncBailHook<[
|
1807
|
+
embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
|
1808
|
+
strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
|
1770
1809
|
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
|
1771
|
-
useSourceMap: SyncBailHook<[Chunk,
|
1810
|
+
useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
|
1772
1811
|
}
|
1773
1812
|
declare interface CompilationHooksRealContentHashPlugin {
|
1774
1813
|
updateHash: SyncBailHook<[Buffer[], string], string>;
|
@@ -2575,7 +2614,7 @@ declare interface DependencyTemplateContext {
|
|
2575
2614
|
/**
|
2576
2615
|
* mutable array of init fragments for the current module
|
2577
2616
|
*/
|
2578
|
-
initFragments: InitFragment[];
|
2617
|
+
initFragments: InitFragment<GenerateContext>[];
|
2579
2618
|
|
2580
2619
|
/**
|
2581
2620
|
* when in a concatenated module, information about other concatenated modules
|
@@ -2909,7 +2948,7 @@ declare abstract class EntryDependency extends ModuleDependency {}
|
|
2909
2948
|
*/
|
2910
2949
|
declare interface EntryDescription {
|
2911
2950
|
/**
|
2912
|
-
* 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).
|
2951
|
+
* 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).
|
2913
2952
|
*/
|
2914
2953
|
chunkLoading?: string | false;
|
2915
2954
|
|
@@ -2959,7 +2998,7 @@ declare interface EntryDescription {
|
|
2959
2998
|
*/
|
2960
2999
|
declare interface EntryDescriptionNormalized {
|
2961
3000
|
/**
|
2962
|
-
* 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).
|
3001
|
+
* 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).
|
2963
3002
|
*/
|
2964
3003
|
chunkLoading?: string | false;
|
2965
3004
|
|
@@ -3578,6 +3617,11 @@ declare interface ExternalItemFunctionData {
|
|
3578
3617
|
*/
|
3579
3618
|
contextInfo?: ModuleFactoryCreateDataContextInfo;
|
3580
3619
|
|
3620
|
+
/**
|
3621
|
+
* The category of the referencing dependencies.
|
3622
|
+
*/
|
3623
|
+
dependencyType?: string;
|
3624
|
+
|
3581
3625
|
/**
|
3582
3626
|
* Get a resolve function with the current resolver options.
|
3583
3627
|
*/
|
@@ -3621,11 +3665,6 @@ declare class ExternalModule extends Module {
|
|
3621
3665
|
request: string | string[] | Record<string, string | string[]>;
|
3622
3666
|
externalType: string;
|
3623
3667
|
userRequest: string;
|
3624
|
-
getSourceData(
|
3625
|
-
runtimeTemplate?: any,
|
3626
|
-
moduleGraph?: any,
|
3627
|
-
chunkGraph?: any
|
3628
|
-
): SourceData;
|
3629
3668
|
}
|
3630
3669
|
declare interface ExternalModuleInfo {
|
3631
3670
|
index: number;
|
@@ -3783,12 +3822,17 @@ declare interface FileCacheOptions {
|
|
3783
3822
|
hashAlgorithm?: string;
|
3784
3823
|
|
3785
3824
|
/**
|
3786
|
-
* Time in ms after which idle period the cache storing should happen
|
3825
|
+
* Time in ms after which idle period the cache storing should happen.
|
3787
3826
|
*/
|
3788
3827
|
idleTimeout?: number;
|
3789
3828
|
|
3790
3829
|
/**
|
3791
|
-
* Time in ms after which idle period the
|
3830
|
+
* 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).
|
3831
|
+
*/
|
3832
|
+
idleTimeoutAfterLargeChanges?: number;
|
3833
|
+
|
3834
|
+
/**
|
3835
|
+
* Time in ms after which idle period the initial cache storing should happen.
|
3792
3836
|
*/
|
3793
3837
|
idleTimeoutForInitialStore?: number;
|
3794
3838
|
|
@@ -4362,14 +4406,14 @@ declare interface InfrastructureLogging {
|
|
4362
4406
|
*/
|
4363
4407
|
stream?: NodeJS.WritableStream;
|
4364
4408
|
}
|
4365
|
-
declare abstract class InitFragment {
|
4409
|
+
declare abstract class InitFragment<Context> {
|
4366
4410
|
content: string | Source;
|
4367
4411
|
stage: number;
|
4368
4412
|
position: number;
|
4369
4413
|
key?: string;
|
4370
4414
|
endContent?: string | Source;
|
4371
|
-
getContent(
|
4372
|
-
getEndContent(
|
4415
|
+
getContent(context: Context): string | Source;
|
4416
|
+
getEndContent(context: Context): undefined | string | Source;
|
4373
4417
|
merge: any;
|
4374
4418
|
}
|
4375
4419
|
declare interface InputFileSystem {
|
@@ -4456,12 +4500,12 @@ declare class JavascriptModulesPlugin {
|
|
4456
4500
|
apply(compiler: Compiler): void;
|
4457
4501
|
renderModule(
|
4458
4502
|
module: Module,
|
4459
|
-
renderContext:
|
4503
|
+
renderContext: ChunkRenderContext,
|
4460
4504
|
hooks: CompilationHooksJavascriptModulesPlugin,
|
4461
4505
|
factory: boolean | "strict"
|
4462
4506
|
): Source;
|
4463
4507
|
renderChunk(
|
4464
|
-
renderContext:
|
4508
|
+
renderContext: RenderContext,
|
4465
4509
|
hooks: CompilationHooksJavascriptModulesPlugin
|
4466
4510
|
): Source;
|
4467
4511
|
renderMain(
|
@@ -4558,7 +4602,7 @@ declare class JavascriptParser extends Parser {
|
|
4558
4602
|
| FunctionDeclaration
|
4559
4603
|
| VariableDeclaration
|
4560
4604
|
| ClassDeclaration
|
4561
|
-
|
|
4605
|
+
| PrivateIdentifier
|
4562
4606
|
),
|
4563
4607
|
number
|
4564
4608
|
],
|
@@ -4662,7 +4706,7 @@ declare class JavascriptParser extends Parser {
|
|
4662
4706
|
>;
|
4663
4707
|
classBodyElement: SyncBailHook<
|
4664
4708
|
[
|
4665
|
-
MethodDefinition |
|
4709
|
+
MethodDefinition | PropertyDefinition,
|
4666
4710
|
ClassExpression | ClassDeclaration
|
4667
4711
|
],
|
4668
4712
|
boolean | void
|
@@ -4670,7 +4714,7 @@ declare class JavascriptParser extends Parser {
|
|
4670
4714
|
classBodyValue: SyncBailHook<
|
4671
4715
|
[
|
4672
4716
|
Expression,
|
4673
|
-
MethodDefinition |
|
4717
|
+
MethodDefinition | PropertyDefinition,
|
4674
4718
|
ClassExpression | ClassDeclaration
|
4675
4719
|
],
|
4676
4720
|
boolean | void
|
@@ -4986,7 +5030,7 @@ declare class JavascriptParser extends Parser {
|
|
4986
5030
|
| FunctionDeclaration
|
4987
5031
|
| VariableDeclaration
|
4988
5032
|
| ClassDeclaration
|
4989
|
-
|
|
5033
|
+
| PrivateIdentifier,
|
4990
5034
|
commentsStartPos: number
|
4991
5035
|
): boolean;
|
4992
5036
|
getComments(range?: any): any[];
|
@@ -5794,11 +5838,13 @@ type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
|
|
5794
5838
|
LoaderRunnerLoaderContext<OptionsType> &
|
5795
5839
|
LoaderPluginLoaderContext &
|
5796
5840
|
HotModuleReplacementPluginLoaderContext;
|
5797
|
-
type LoaderDefinition<
|
5798
|
-
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5841
|
+
type LoaderDefinition<
|
5842
|
+
OptionsType = {},
|
5843
|
+
ContextAdditions = {}
|
5844
|
+
> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
5845
|
+
raw?: false;
|
5846
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
5847
|
+
};
|
5802
5848
|
declare interface LoaderDefinitionFunction<
|
5803
5849
|
OptionsType = {},
|
5804
5850
|
ContextAdditions = {}
|
@@ -6919,6 +6965,7 @@ type NodeEstreeIndex =
|
|
6919
6965
|
| FunctionDeclaration
|
6920
6966
|
| VariableDeclaration
|
6921
6967
|
| ClassDeclaration
|
6968
|
+
| PrivateIdentifier
|
6922
6969
|
| ExpressionStatement
|
6923
6970
|
| BlockStatement
|
6924
6971
|
| EmptyStatement
|
@@ -6942,6 +6989,7 @@ type NodeEstreeIndex =
|
|
6942
6989
|
| ExportDefaultDeclaration
|
6943
6990
|
| ExportAllDeclaration
|
6944
6991
|
| MethodDefinition
|
6992
|
+
| PropertyDefinition
|
6945
6993
|
| VariableDeclarator
|
6946
6994
|
| Program
|
6947
6995
|
| Super
|
@@ -7203,7 +7251,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
|
|
7203
7251
|
};
|
7204
7252
|
emitFile(
|
7205
7253
|
name: string,
|
7206
|
-
content: string,
|
7254
|
+
content: string | Buffer,
|
7207
7255
|
sourceMap?: string,
|
7208
7256
|
assetInfo?: AssetInfo
|
7209
7257
|
): void;
|
@@ -7743,7 +7791,7 @@ declare interface Output {
|
|
7743
7791
|
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
7744
7792
|
|
7745
7793
|
/**
|
7746
|
-
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
|
7794
|
+
* 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).
|
7747
7795
|
*/
|
7748
7796
|
chunkFormat?: string | false;
|
7749
7797
|
|
@@ -7753,7 +7801,7 @@ declare interface Output {
|
|
7753
7801
|
chunkLoadTimeout?: number;
|
7754
7802
|
|
7755
7803
|
/**
|
7756
|
-
* 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).
|
7804
|
+
* 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).
|
7757
7805
|
*/
|
7758
7806
|
chunkLoading?: string | false;
|
7759
7807
|
|
@@ -7958,7 +8006,7 @@ declare interface Output {
|
|
7958
8006
|
webassemblyModuleFilename?: string;
|
7959
8007
|
|
7960
8008
|
/**
|
7961
|
-
* 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).
|
8009
|
+
* 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).
|
7962
8010
|
*/
|
7963
8011
|
workerChunkLoading?: string | false;
|
7964
8012
|
|
@@ -8029,7 +8077,7 @@ declare interface OutputNormalized {
|
|
8029
8077
|
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
8030
8078
|
|
8031
8079
|
/**
|
8032
|
-
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
|
8080
|
+
* 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).
|
8033
8081
|
*/
|
8034
8082
|
chunkFormat?: string | false;
|
8035
8083
|
|
@@ -8039,7 +8087,7 @@ declare interface OutputNormalized {
|
|
8039
8087
|
chunkLoadTimeout?: number;
|
8040
8088
|
|
8041
8089
|
/**
|
8042
|
-
* 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).
|
8090
|
+
* 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).
|
8043
8091
|
*/
|
8044
8092
|
chunkLoading?: string | false;
|
8045
8093
|
|
@@ -8229,7 +8277,7 @@ declare interface OutputNormalized {
|
|
8229
8277
|
webassemblyModuleFilename?: string;
|
8230
8278
|
|
8231
8279
|
/**
|
8232
|
-
* 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).
|
8280
|
+
* 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).
|
8233
8281
|
*/
|
8234
8282
|
workerChunkLoading?: string | false;
|
8235
8283
|
|
@@ -8408,12 +8456,6 @@ declare interface PrintedElement {
|
|
8408
8456
|
element: string;
|
8409
8457
|
content: string;
|
8410
8458
|
}
|
8411
|
-
declare interface PrivateIdentifierNode {
|
8412
|
-
type: "PrivateIdentifier";
|
8413
|
-
name: string;
|
8414
|
-
loc?: null | SourceLocation;
|
8415
|
-
range?: [number, number];
|
8416
|
-
}
|
8417
8459
|
declare interface Problem {
|
8418
8460
|
type: ProblemType;
|
8419
8461
|
path: string;
|
@@ -8531,71 +8573,6 @@ declare interface ProgressPluginOptions {
|
|
8531
8573
|
*/
|
8532
8574
|
profile?: null | boolean;
|
8533
8575
|
}
|
8534
|
-
declare interface PropertyDefinitionNode {
|
8535
|
-
type: "PropertyDefinition";
|
8536
|
-
key:
|
8537
|
-
| UnaryExpression
|
8538
|
-
| ThisExpression
|
8539
|
-
| ArrayExpression
|
8540
|
-
| ObjectExpression
|
8541
|
-
| FunctionExpression
|
8542
|
-
| ArrowFunctionExpression
|
8543
|
-
| YieldExpression
|
8544
|
-
| SimpleLiteral
|
8545
|
-
| RegExpLiteral
|
8546
|
-
| BigIntLiteral
|
8547
|
-
| UpdateExpression
|
8548
|
-
| BinaryExpression
|
8549
|
-
| AssignmentExpression
|
8550
|
-
| LogicalExpression
|
8551
|
-
| MemberExpression
|
8552
|
-
| ConditionalExpression
|
8553
|
-
| SimpleCallExpression
|
8554
|
-
| NewExpression
|
8555
|
-
| SequenceExpression
|
8556
|
-
| TemplateLiteral
|
8557
|
-
| TaggedTemplateExpression
|
8558
|
-
| ClassExpression
|
8559
|
-
| MetaProperty
|
8560
|
-
| Identifier
|
8561
|
-
| AwaitExpression
|
8562
|
-
| ImportExpression
|
8563
|
-
| ChainExpression
|
8564
|
-
| PrivateIdentifierNode;
|
8565
|
-
value:
|
8566
|
-
| null
|
8567
|
-
| UnaryExpression
|
8568
|
-
| ThisExpression
|
8569
|
-
| ArrayExpression
|
8570
|
-
| ObjectExpression
|
8571
|
-
| FunctionExpression
|
8572
|
-
| ArrowFunctionExpression
|
8573
|
-
| YieldExpression
|
8574
|
-
| SimpleLiteral
|
8575
|
-
| RegExpLiteral
|
8576
|
-
| BigIntLiteral
|
8577
|
-
| UpdateExpression
|
8578
|
-
| BinaryExpression
|
8579
|
-
| AssignmentExpression
|
8580
|
-
| LogicalExpression
|
8581
|
-
| MemberExpression
|
8582
|
-
| ConditionalExpression
|
8583
|
-
| SimpleCallExpression
|
8584
|
-
| NewExpression
|
8585
|
-
| SequenceExpression
|
8586
|
-
| TemplateLiteral
|
8587
|
-
| TaggedTemplateExpression
|
8588
|
-
| ClassExpression
|
8589
|
-
| MetaProperty
|
8590
|
-
| Identifier
|
8591
|
-
| AwaitExpression
|
8592
|
-
| ImportExpression
|
8593
|
-
| ChainExpression;
|
8594
|
-
computed: boolean;
|
8595
|
-
static: boolean;
|
8596
|
-
loc?: null | SourceLocation;
|
8597
|
-
range?: [number, number];
|
8598
|
-
}
|
8599
8576
|
declare class ProvidePlugin {
|
8600
8577
|
constructor(definitions: Record<string, string | string[]>);
|
8601
8578
|
definitions: Record<string, string | string[]>;
|
@@ -8661,11 +8638,13 @@ declare interface RawChunkGroupOptions {
|
|
8661
8638
|
preloadOrder?: number;
|
8662
8639
|
prefetchOrder?: number;
|
8663
8640
|
}
|
8664
|
-
type RawLoaderDefinition<
|
8665
|
-
|
8666
|
-
|
8667
|
-
|
8668
|
-
|
8641
|
+
type RawLoaderDefinition<
|
8642
|
+
OptionsType = {},
|
8643
|
+
ContextAdditions = {}
|
8644
|
+
> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
8645
|
+
raw: true;
|
8646
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
8647
|
+
};
|
8669
8648
|
declare interface RawLoaderDefinitionFunction<
|
8670
8649
|
OptionsType = {},
|
8671
8650
|
ContextAdditions = {}
|
@@ -8774,33 +8753,7 @@ declare interface RenderBootstrapContext {
|
|
8774
8753
|
*/
|
8775
8754
|
hash: string;
|
8776
8755
|
}
|
8777
|
-
declare interface
|
8778
|
-
/**
|
8779
|
-
* the chunk
|
8780
|
-
*/
|
8781
|
-
chunk: Chunk;
|
8782
|
-
|
8783
|
-
/**
|
8784
|
-
* the dependency templates
|
8785
|
-
*/
|
8786
|
-
dependencyTemplates: DependencyTemplates;
|
8787
|
-
|
8788
|
-
/**
|
8789
|
-
* the runtime template
|
8790
|
-
*/
|
8791
|
-
runtimeTemplate: RuntimeTemplate;
|
8792
|
-
|
8793
|
-
/**
|
8794
|
-
* the module graph
|
8795
|
-
*/
|
8796
|
-
moduleGraph: ModuleGraph;
|
8797
|
-
|
8798
|
-
/**
|
8799
|
-
* the chunk graph
|
8800
|
-
*/
|
8801
|
-
chunkGraph: ChunkGraph;
|
8802
|
-
}
|
8803
|
-
declare interface RenderContextObject {
|
8756
|
+
declare interface RenderContext {
|
8804
8757
|
/**
|
8805
8758
|
* the chunk
|
8806
8759
|
*/
|
@@ -9734,6 +9687,7 @@ declare abstract class RuntimeTemplate {
|
|
9734
9687
|
expressionFunction(expression?: any, args?: string): string;
|
9735
9688
|
emptyFunction(): "x => {}" | "function() {}";
|
9736
9689
|
destructureArray(items?: any, value?: any): string;
|
9690
|
+
destructureObject(items?: any, value?: any): string;
|
9737
9691
|
iife(args?: any, body?: any): string;
|
9738
9692
|
forEach(variable?: any, array?: any, body?: any): string;
|
9739
9693
|
|
@@ -10032,7 +9986,7 @@ declare abstract class RuntimeTemplate {
|
|
10032
9986
|
/**
|
10033
9987
|
* init fragments will be added here
|
10034
9988
|
*/
|
10035
|
-
initFragments: InitFragment[];
|
9989
|
+
initFragments: InitFragment<any>[];
|
10036
9990
|
/**
|
10037
9991
|
* runtime for which this code will be generated
|
10038
9992
|
*/
|
@@ -10396,11 +10350,6 @@ declare class Source {
|
|
10396
10350
|
source(): string | Buffer;
|
10397
10351
|
buffer(): Buffer;
|
10398
10352
|
}
|
10399
|
-
declare interface SourceData {
|
10400
|
-
iife?: boolean;
|
10401
|
-
init?: string;
|
10402
|
-
expression: string;
|
10403
|
-
}
|
10404
10353
|
declare interface SourceLike {
|
10405
10354
|
source(): string | Buffer;
|
10406
10355
|
}
|
@@ -10572,7 +10521,7 @@ declare abstract class StackedMap<K, V> {
|
|
10572
10521
|
readonly size: number;
|
10573
10522
|
createChild(): StackedMap<K, V>;
|
10574
10523
|
}
|
10575
|
-
type StartupRenderContext =
|
10524
|
+
type StartupRenderContext = RenderContext & { inlined: boolean };
|
10576
10525
|
type Statement =
|
10577
10526
|
| FunctionDeclaration
|
10578
10527
|
| VariableDeclaration
|
@@ -11139,21 +11088,21 @@ declare class Template {
|
|
11139
11088
|
static asString(str: string | string[]): string;
|
11140
11089
|
static getModulesArrayBounds(modules: WithId[]): false | [number, number];
|
11141
11090
|
static renderChunkModules(
|
11142
|
-
renderContext:
|
11091
|
+
renderContext: ChunkRenderContext,
|
11143
11092
|
modules: Module[],
|
11144
11093
|
renderModule: (arg0: Module) => Source,
|
11145
11094
|
prefix?: string
|
11146
11095
|
): Source;
|
11147
11096
|
static renderRuntimeModules(
|
11148
11097
|
runtimeModules: RuntimeModule[],
|
11149
|
-
renderContext:
|
11098
|
+
renderContext: RenderContext & {
|
11150
11099
|
codeGenerationResults?: CodeGenerationResults;
|
11151
11100
|
useStrict?: boolean;
|
11152
11101
|
}
|
11153
11102
|
): Source;
|
11154
11103
|
static renderChunkRuntimeModules(
|
11155
11104
|
runtimeModules: RuntimeModule[],
|
11156
|
-
renderContext:
|
11105
|
+
renderContext: RenderContext
|
11157
11106
|
): Source;
|
11158
11107
|
static NUMBER_OF_IDENTIFIER_START_CHARS: number;
|
11159
11108
|
static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
|