webpack 5.2.1 → 5.4.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 +15 -7
- package/lib/ChunkGraph.js +19 -0
- package/lib/Compilation.js +25 -4
- package/lib/ConcatenationScope.js +9 -6
- package/lib/ConditionalInitFragment.js +109 -0
- package/lib/Dependency.js +1 -0
- package/lib/Module.js +4 -3
- package/lib/ProgressPlugin.js +10 -8
- package/lib/RuntimeGlobals.js +5 -0
- package/lib/RuntimePlugin.js +8 -0
- package/lib/RuntimeTemplate.js +37 -0
- package/lib/WebpackOptionsApply.js +4 -2
- package/lib/config/browserslistTargetHandler.js +175 -51
- package/lib/config/defaults.js +1 -1
- package/lib/dependencies/HarmonyAcceptDependency.js +33 -5
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +0 -5
- package/lib/dependencies/HarmonyImportDependency.js +70 -28
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +5 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +2 -2
- package/lib/dependencies/PureExpressionDependency.js +30 -6
- package/lib/dependencies/WorkerPlugin.js +8 -3
- package/lib/javascript/JavascriptParser.js +51 -5
- package/lib/optimize/ConcatenatedModule.js +262 -117
- package/lib/optimize/ModuleConcatenationPlugin.js +78 -9
- package/lib/optimize/SideEffectsFlagPlugin.js +112 -100
- package/lib/runtime/RuntimeIdRuntimeModule.js +29 -0
- package/lib/util/compileBooleanMatcher.js +13 -1
- package/lib/util/runtime.js +135 -1
- package/package.json +4 -5
- package/schemas/WebpackOptions.json +9 -2
- package/types.d.ts +97 -71
package/types.d.ts
CHANGED
@@ -217,22 +217,22 @@ declare interface AssetInfo {
|
|
217
217
|
/**
|
218
218
|
* the value(s) of the full hash used for this asset
|
219
219
|
*/
|
220
|
-
fullhash?:
|
220
|
+
fullhash?: EntryItem;
|
221
221
|
|
222
222
|
/**
|
223
223
|
* the value(s) of the chunk hash used for this asset
|
224
224
|
*/
|
225
|
-
chunkhash?:
|
225
|
+
chunkhash?: EntryItem;
|
226
226
|
|
227
227
|
/**
|
228
228
|
* the value(s) of the module hash used for this asset
|
229
229
|
*/
|
230
|
-
modulehash?:
|
230
|
+
modulehash?: EntryItem;
|
231
231
|
|
232
232
|
/**
|
233
233
|
* the value(s) of the content hash used for this asset
|
234
234
|
*/
|
235
|
-
contenthash?:
|
235
|
+
contenthash?: EntryItem;
|
236
236
|
|
237
237
|
/**
|
238
238
|
* when asset was created from a source file (potentially transformed), the original filename relative to compilation context
|
@@ -262,7 +262,7 @@ declare interface AssetInfo {
|
|
262
262
|
/**
|
263
263
|
* object of pointers to other assets, keyed by type of relation (only points from parent to child)
|
264
264
|
*/
|
265
|
-
related?: Record<string,
|
265
|
+
related?: Record<string, EntryItem>;
|
266
266
|
}
|
267
267
|
type AssetModuleFilename =
|
268
268
|
| string
|
@@ -784,6 +784,8 @@ declare class ChunkGraph {
|
|
784
784
|
disconnectChunkGroup(chunkGroup: ChunkGroup): void;
|
785
785
|
getModuleId(module: Module): string | number;
|
786
786
|
setModuleId(module: Module, id: string | number): void;
|
787
|
+
getRuntimeId(runtime: string): string | number;
|
788
|
+
setRuntimeId(runtime: string, id: string | number): void;
|
787
789
|
hasModuleHashes(
|
788
790
|
module: Module,
|
789
791
|
runtime: string | SortableSet<string>
|
@@ -1450,6 +1452,7 @@ declare class Compilation {
|
|
1450
1452
|
): void;
|
1451
1453
|
patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
|
1452
1454
|
removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
|
1455
|
+
assignRuntimeIds(): void;
|
1453
1456
|
sortItemsWithChunkIds(): void;
|
1454
1457
|
summarizeDependencies(): void;
|
1455
1458
|
createModuleHashes(): void;
|
@@ -1724,7 +1727,9 @@ declare interface ConcatenationBailoutReasonContext {
|
|
1724
1727
|
}
|
1725
1728
|
declare class ConcatenationScope {
|
1726
1729
|
constructor(
|
1727
|
-
|
1730
|
+
modulesMap:
|
1731
|
+
| (ConcatenatedModuleInfo | ExternalModuleInfo)[]
|
1732
|
+
| Map<Module, ConcatenatedModuleInfo | ExternalModuleInfo>,
|
1728
1733
|
currentModule: ConcatenatedModuleInfo
|
1729
1734
|
);
|
1730
1735
|
isModuleInScope(module: Module): boolean;
|
@@ -2607,9 +2612,9 @@ declare class EnableLibraryPlugin {
|
|
2607
2612
|
}
|
2608
2613
|
type Entry =
|
2609
2614
|
| string
|
2610
|
-
| (() => string | EntryObject |
|
2615
|
+
| (() => string | EntryObject | string[] | Promise<EntryStatic>)
|
2611
2616
|
| EntryObject
|
2612
|
-
|
|
2617
|
+
| string[];
|
2613
2618
|
declare interface EntryData {
|
2614
2619
|
/**
|
2615
2620
|
* dependencies of the entrypoint that should be evaluated at startup
|
@@ -2688,7 +2693,7 @@ declare interface EntryDescriptionNormalized {
|
|
2688
2693
|
/**
|
2689
2694
|
* The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
|
2690
2695
|
*/
|
2691
|
-
dependOn?:
|
2696
|
+
dependOn?: string[];
|
2692
2697
|
|
2693
2698
|
/**
|
2694
2699
|
* Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
|
@@ -2698,7 +2703,7 @@ declare interface EntryDescriptionNormalized {
|
|
2698
2703
|
/**
|
2699
2704
|
* Module(s) that are loaded upon startup. The last one is exported.
|
2700
2705
|
*/
|
2701
|
-
import?:
|
2706
|
+
import?: string[];
|
2702
2707
|
|
2703
2708
|
/**
|
2704
2709
|
* Options for library.
|
@@ -2715,7 +2720,7 @@ declare interface EntryDescriptionNormalized {
|
|
2715
2720
|
*/
|
2716
2721
|
wasmLoading?: DevTool;
|
2717
2722
|
}
|
2718
|
-
type EntryItem = string |
|
2723
|
+
type EntryItem = string | string[];
|
2719
2724
|
type EntryNormalized =
|
2720
2725
|
| (() => Promise<EntryStaticNormalized>)
|
2721
2726
|
| EntryStaticNormalized;
|
@@ -2724,7 +2729,7 @@ type EntryNormalized =
|
|
2724
2729
|
* Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
|
2725
2730
|
*/
|
2726
2731
|
declare interface EntryObject {
|
2727
|
-
[index: string]: string |
|
2732
|
+
[index: string]: string | string[] | EntryDescription;
|
2728
2733
|
}
|
2729
2734
|
declare class EntryOptionPlugin {
|
2730
2735
|
constructor();
|
@@ -2801,7 +2806,7 @@ declare class EntryPlugin {
|
|
2801
2806
|
>)
|
2802
2807
|
): EntryDependency;
|
2803
2808
|
}
|
2804
|
-
type EntryStatic = string | EntryObject |
|
2809
|
+
type EntryStatic = string | EntryObject | string[];
|
2805
2810
|
|
2806
2811
|
/**
|
2807
2812
|
* Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
|
@@ -3093,20 +3098,17 @@ declare abstract class ExportsInfo {
|
|
3093
3098
|
): boolean | SortableSet<string>;
|
3094
3099
|
getProvidedExports(): true | string[];
|
3095
3100
|
getRelevantExports(runtime: string | SortableSet<string>): ExportInfo[];
|
3096
|
-
isExportProvided(name:
|
3101
|
+
isExportProvided(name: EntryItem): boolean;
|
3097
3102
|
getUsageKey(runtime: string | SortableSet<string>): string;
|
3098
3103
|
isEquallyUsed(
|
3099
3104
|
runtimeA: string | SortableSet<string>,
|
3100
3105
|
runtimeB: string | SortableSet<string>
|
3101
3106
|
): boolean;
|
3102
3107
|
getUsed(
|
3103
|
-
name:
|
3108
|
+
name: EntryItem,
|
3104
3109
|
runtime: string | SortableSet<string>
|
3105
3110
|
): 0 | 1 | 2 | 3 | 4;
|
3106
|
-
getUsedName(
|
3107
|
-
name: LibraryExport,
|
3108
|
-
runtime: string | SortableSet<string>
|
3109
|
-
): string | false | string[];
|
3111
|
+
getUsedName(name: EntryItem, runtime: string | SortableSet<string>): Target;
|
3110
3112
|
updateHash(hash: Hash, runtime: string | SortableSet<string>): void;
|
3111
3113
|
getRestoreProvidedData(): any;
|
3112
3114
|
restoreProvided(__0: {
|
@@ -3202,7 +3204,7 @@ type ExternalItem =
|
|
3202
3204
|
) => void);
|
3203
3205
|
declare class ExternalModule extends Module {
|
3204
3206
|
constructor(request?: any, type?: any, userRequest?: any);
|
3205
|
-
request: string | string[] | Record<string,
|
3207
|
+
request: string | string[] | Record<string, EntryItem>;
|
3206
3208
|
externalType: string;
|
3207
3209
|
userRequest: string;
|
3208
3210
|
getSourceData(
|
@@ -4318,6 +4320,7 @@ declare class JavascriptParser extends Parser {
|
|
4318
4320
|
): boolean;
|
4319
4321
|
getComments(range?: any): any;
|
4320
4322
|
isAsiPosition(pos: number): boolean;
|
4323
|
+
unsetAsiPosition(pos: number): void;
|
4321
4324
|
isStatementLevelExpression(expr?: any): boolean;
|
4322
4325
|
getTagData(name?: any, tag?: any): any;
|
4323
4326
|
tagVariable(name?: any, tag?: any, data?: any): void;
|
@@ -4514,9 +4517,8 @@ declare interface LibraryCustomUmdObject {
|
|
4514
4517
|
/**
|
4515
4518
|
* Name of the property exposed globally by a UMD library.
|
4516
4519
|
*/
|
4517
|
-
root?:
|
4520
|
+
root?: EntryItem;
|
4518
4521
|
}
|
4519
|
-
type LibraryExport = string | string[];
|
4520
4522
|
type LibraryName = string | string[] | LibraryCustomUmdObject;
|
4521
4523
|
|
4522
4524
|
/**
|
@@ -4531,7 +4533,7 @@ declare interface LibraryOptions {
|
|
4531
4533
|
/**
|
4532
4534
|
* Specify which export should be exposed as library.
|
4533
4535
|
*/
|
4534
|
-
export?:
|
4536
|
+
export?: EntryItem;
|
4535
4537
|
|
4536
4538
|
/**
|
4537
4539
|
* The name of the library (some types allow unnamed libraries too).
|
@@ -4554,14 +4556,14 @@ declare class LibraryTemplatePlugin {
|
|
4554
4556
|
target: string,
|
4555
4557
|
umdNamedDefine: boolean,
|
4556
4558
|
auxiliaryComment: AuxiliaryComment,
|
4557
|
-
exportProperty:
|
4559
|
+
exportProperty: EntryItem
|
4558
4560
|
);
|
4559
4561
|
library: {
|
4560
4562
|
type: string;
|
4561
4563
|
name: LibraryName;
|
4562
4564
|
umdNamedDefine: boolean;
|
4563
4565
|
auxiliaryComment: AuxiliaryComment;
|
4564
|
-
export:
|
4566
|
+
export: EntryItem;
|
4565
4567
|
};
|
4566
4568
|
|
4567
4569
|
/**
|
@@ -5049,7 +5051,7 @@ declare class ModuleGraph {
|
|
5049
5051
|
module: Module
|
5050
5052
|
): (string | ((requestShortener: RequestShortener) => string))[];
|
5051
5053
|
getProvidedExports(module: Module): true | string[];
|
5052
|
-
isExportProvided(module: Module, exportName:
|
5054
|
+
isExportProvided(module: Module, exportName: EntryItem): boolean;
|
5053
5055
|
getExportsInfo(module: Module): ExportsInfo;
|
5054
5056
|
getExportInfo(module: Module, exportName: string): ExportInfo;
|
5055
5057
|
getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
|
@@ -5160,11 +5162,7 @@ declare interface ModuleOptions {
|
|
5160
5162
|
/**
|
5161
5163
|
* Don't parse files matching. It's matched against the full resolved request.
|
5162
5164
|
*/
|
5163
|
-
noParse?:
|
5164
|
-
| string
|
5165
|
-
| Function
|
5166
|
-
| RegExp
|
5167
|
-
| [string | Function | RegExp, ...(string | Function | RegExp)[]];
|
5165
|
+
noParse?: string | Function | RegExp | (string | Function | RegExp)[];
|
5168
5166
|
|
5169
5167
|
/**
|
5170
5168
|
* An array of rules applied for modules.
|
@@ -5844,9 +5842,9 @@ declare interface Optimization {
|
|
5844
5842
|
runtimeChunk?: OptimizationRuntimeChunk;
|
5845
5843
|
|
5846
5844
|
/**
|
5847
|
-
* Skip over modules which
|
5845
|
+
* Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).
|
5848
5846
|
*/
|
5849
|
-
sideEffects?: boolean;
|
5847
|
+
sideEffects?: boolean | "flag";
|
5850
5848
|
|
5851
5849
|
/**
|
5852
5850
|
* Optimize duplication and caching by splitting chunks by shared modules and cache group.
|
@@ -6262,7 +6260,7 @@ declare interface Output {
|
|
6262
6260
|
/**
|
6263
6261
|
* Specify which export should be exposed as library.
|
6264
6262
|
*/
|
6265
|
-
libraryExport?:
|
6263
|
+
libraryExport?: EntryItem;
|
6266
6264
|
|
6267
6265
|
/**
|
6268
6266
|
* Type of library (types included by default are 'var', 'module', 'assign', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
|
@@ -6782,8 +6780,8 @@ declare interface ProgressPluginOptions {
|
|
6782
6780
|
profile?: boolean;
|
6783
6781
|
}
|
6784
6782
|
declare class ProvidePlugin {
|
6785
|
-
constructor(definitions: Record<string,
|
6786
|
-
definitions: Record<string,
|
6783
|
+
constructor(definitions: Record<string, EntryItem>);
|
6784
|
+
definitions: Record<string, EntryItem>;
|
6787
6785
|
|
6788
6786
|
/**
|
6789
6787
|
* Apply the plugin
|
@@ -7049,7 +7047,7 @@ type ResolveAlias =
|
|
7049
7047
|
/**
|
7050
7048
|
* New request.
|
7051
7049
|
*/
|
7052
|
-
alias:
|
7050
|
+
alias: Target;
|
7053
7051
|
/**
|
7054
7052
|
* Request to be redirected.
|
7055
7053
|
*/
|
@@ -7059,7 +7057,7 @@ type ResolveAlias =
|
|
7059
7057
|
*/
|
7060
7058
|
onlyModule?: boolean;
|
7061
7059
|
}[]
|
7062
|
-
| { [index: string]:
|
7060
|
+
| { [index: string]: Target };
|
7063
7061
|
declare interface ResolveBuildDependenciesResult {
|
7064
7062
|
/**
|
7065
7063
|
* list of files
|
@@ -7147,7 +7145,7 @@ declare interface ResolveOptionsTypes {
|
|
7147
7145
|
/**
|
7148
7146
|
* New request.
|
7149
7147
|
*/
|
7150
|
-
alias:
|
7148
|
+
alias: Target;
|
7151
7149
|
/**
|
7152
7150
|
* Request to be redirected.
|
7153
7151
|
*/
|
@@ -7161,7 +7159,7 @@ declare interface ResolveOptionsTypes {
|
|
7161
7159
|
/**
|
7162
7160
|
* New request.
|
7163
7161
|
*/
|
7164
|
-
alias:
|
7162
|
+
alias: Target;
|
7165
7163
|
/**
|
7166
7164
|
* Request to be redirected.
|
7167
7165
|
*/
|
@@ -7171,7 +7169,7 @@ declare interface ResolveOptionsTypes {
|
|
7171
7169
|
*/
|
7172
7170
|
onlyModule?: boolean;
|
7173
7171
|
}[];
|
7174
|
-
aliasFields: Set<
|
7172
|
+
aliasFields: Set<EntryItem>;
|
7175
7173
|
cachePredicate: (arg0: ResolveRequest) => boolean;
|
7176
7174
|
cacheWithContext: boolean;
|
7177
7175
|
|
@@ -7181,14 +7179,14 @@ declare interface ResolveOptionsTypes {
|
|
7181
7179
|
conditionNames: Set<string>;
|
7182
7180
|
descriptionFiles: string[];
|
7183
7181
|
enforceExtension: boolean;
|
7184
|
-
exportsFields: Set<
|
7185
|
-
importsFields: Set<
|
7182
|
+
exportsFields: Set<EntryItem>;
|
7183
|
+
importsFields: Set<EntryItem>;
|
7186
7184
|
extensions: Set<string>;
|
7187
7185
|
fileSystem: FileSystem;
|
7188
7186
|
unsafeCache: any;
|
7189
7187
|
symlinks: boolean;
|
7190
7188
|
resolver?: Resolver;
|
7191
|
-
modules:
|
7189
|
+
modules: EntryItem[];
|
7192
7190
|
mainFields: { name: string[]; forceRelative: boolean }[];
|
7193
7191
|
mainFiles: Set<string>;
|
7194
7192
|
plugins: (
|
@@ -7215,7 +7213,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7215
7213
|
/**
|
7216
7214
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
7217
7215
|
*/
|
7218
|
-
aliasFields?:
|
7216
|
+
aliasFields?: EntryItem[];
|
7219
7217
|
|
7220
7218
|
/**
|
7221
7219
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
@@ -7285,7 +7283,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7285
7283
|
/**
|
7286
7284
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
7287
7285
|
*/
|
7288
|
-
mainFields?:
|
7286
|
+
mainFields?: EntryItem[];
|
7289
7287
|
|
7290
7288
|
/**
|
7291
7289
|
* Filenames used to find the default entry point if there is no description file or main field.
|
@@ -7417,7 +7415,7 @@ declare abstract class ResolverFactory {
|
|
7417
7415
|
/**
|
7418
7416
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
7419
7417
|
*/
|
7420
|
-
aliasFields?:
|
7418
|
+
aliasFields?: EntryItem[];
|
7421
7419
|
/**
|
7422
7420
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
7423
7421
|
*/
|
@@ -7473,7 +7471,7 @@ declare abstract class ResolverFactory {
|
|
7473
7471
|
/**
|
7474
7472
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
7475
7473
|
*/
|
7476
|
-
mainFields?:
|
7474
|
+
mainFields?: EntryItem[];
|
7477
7475
|
/**
|
7478
7476
|
* Filenames used to find the default entry point if there is no description file or main field.
|
7479
7477
|
*/
|
@@ -7533,7 +7531,7 @@ declare abstract class ResolverFactory {
|
|
7533
7531
|
/**
|
7534
7532
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
7535
7533
|
*/
|
7536
|
-
aliasFields?:
|
7534
|
+
aliasFields?: EntryItem[];
|
7537
7535
|
/**
|
7538
7536
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
7539
7537
|
*/
|
@@ -7589,7 +7587,7 @@ declare abstract class ResolverFactory {
|
|
7589
7587
|
/**
|
7590
7588
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
7591
7589
|
*/
|
7592
|
-
mainFields?:
|
7590
|
+
mainFields?: EntryItem[];
|
7593
7591
|
/**
|
7594
7592
|
* Filenames used to find the default entry point if there is no description file or main field.
|
7595
7593
|
*/
|
@@ -7649,7 +7647,7 @@ declare abstract class ResolverFactory {
|
|
7649
7647
|
/**
|
7650
7648
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
7651
7649
|
*/
|
7652
|
-
aliasFields?:
|
7650
|
+
aliasFields?: EntryItem[];
|
7653
7651
|
/**
|
7654
7652
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
7655
7653
|
*/
|
@@ -7705,7 +7703,7 @@ declare abstract class ResolverFactory {
|
|
7705
7703
|
/**
|
7706
7704
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
7707
7705
|
*/
|
7708
|
-
mainFields?:
|
7706
|
+
mainFields?: EntryItem[];
|
7709
7707
|
/**
|
7710
7708
|
* Filenames used to find the default entry point if there is no description file or main field.
|
7711
7709
|
*/
|
@@ -8234,6 +8232,24 @@ declare abstract class RuntimeTemplate {
|
|
8234
8232
|
*/
|
8235
8233
|
runtimeRequirements: Set<string>;
|
8236
8234
|
}): string;
|
8235
|
+
runtimeConditionExpression(__0: {
|
8236
|
+
/**
|
8237
|
+
* the chunk graph
|
8238
|
+
*/
|
8239
|
+
chunkGraph: ChunkGraph;
|
8240
|
+
/**
|
8241
|
+
* runtime for which this code will be generated
|
8242
|
+
*/
|
8243
|
+
runtime?: string | SortableSet<string>;
|
8244
|
+
/**
|
8245
|
+
* only execute the statement in some runtimes
|
8246
|
+
*/
|
8247
|
+
runtimeCondition?: string | boolean | SortableSet<string>;
|
8248
|
+
/**
|
8249
|
+
* if set, will be filled with runtime requirements
|
8250
|
+
*/
|
8251
|
+
runtimeRequirements: Set<string>;
|
8252
|
+
}): string;
|
8237
8253
|
importStatement(__0: {
|
8238
8254
|
/**
|
8239
8255
|
* whether a new variable should be created or the existing one updated
|
@@ -8263,6 +8279,14 @@ declare abstract class RuntimeTemplate {
|
|
8263
8279
|
* true, if this is a weak dependency
|
8264
8280
|
*/
|
8265
8281
|
weak?: boolean;
|
8282
|
+
/**
|
8283
|
+
* runtime for which this code will be generated
|
8284
|
+
*/
|
8285
|
+
runtime?: string | SortableSet<string>;
|
8286
|
+
/**
|
8287
|
+
* only execute the statement in some runtimes
|
8288
|
+
*/
|
8289
|
+
runtimeCondition?: string | boolean | SortableSet<string>;
|
8266
8290
|
/**
|
8267
8291
|
* if set, will be filled with runtime requirements
|
8268
8292
|
*/
|
@@ -8284,7 +8308,7 @@ declare abstract class RuntimeTemplate {
|
|
8284
8308
|
/**
|
8285
8309
|
* the export name
|
8286
8310
|
*/
|
8287
|
-
exportName:
|
8311
|
+
exportName: EntryItem;
|
8288
8312
|
/**
|
8289
8313
|
* the origin module
|
8290
8314
|
*/
|
@@ -8490,7 +8514,7 @@ declare interface SharedObject {
|
|
8490
8514
|
[index: string]: string | SharedConfig;
|
8491
8515
|
}
|
8492
8516
|
declare class SideEffectsFlagPlugin {
|
8493
|
-
constructor();
|
8517
|
+
constructor(analyseSource?: boolean);
|
8494
8518
|
|
8495
8519
|
/**
|
8496
8520
|
* Apply the plugin
|
@@ -9283,7 +9307,7 @@ declare interface TagInfo {
|
|
9283
9307
|
data: any;
|
9284
9308
|
next: TagInfo;
|
9285
9309
|
}
|
9286
|
-
type Target = string | false |
|
9310
|
+
type Target = string | false | string[];
|
9287
9311
|
declare class Template {
|
9288
9312
|
constructor();
|
9289
9313
|
static getFunctionContent(fn: Function): string;
|
@@ -9293,9 +9317,9 @@ declare class Template {
|
|
9293
9317
|
static toPath(str: string): string;
|
9294
9318
|
static numberToIdentifier(n: number): string;
|
9295
9319
|
static numberToIdentifierContinuation(n: number): string;
|
9296
|
-
static indent(s:
|
9297
|
-
static prefix(s:
|
9298
|
-
static asString(str:
|
9320
|
+
static indent(s: EntryItem): string;
|
9321
|
+
static prefix(s: EntryItem, prefix: string): string;
|
9322
|
+
static asString(str: EntryItem): string;
|
9299
9323
|
static getModulesArrayBounds(modules: WithId[]): false | [number, number];
|
9300
9324
|
static renderChunkModules(
|
9301
9325
|
renderContext: RenderContextModuleTemplate,
|
@@ -9324,6 +9348,7 @@ declare const UNDEFINED_MARKER: unique symbol;
|
|
9324
9348
|
declare interface UpdateHashContextDependency {
|
9325
9349
|
chunkGraph: ChunkGraph;
|
9326
9350
|
runtime: string | SortableSet<string>;
|
9351
|
+
runtimeTemplate?: RuntimeTemplate;
|
9327
9352
|
}
|
9328
9353
|
declare interface UpdateHashContextGenerator {
|
9329
9354
|
/**
|
@@ -9338,12 +9363,12 @@ declare interface UserResolveOptions {
|
|
9338
9363
|
* A list of module alias configurations or an object which maps key to value
|
9339
9364
|
*/
|
9340
9365
|
alias?:
|
9341
|
-
| { [index: string]:
|
9366
|
+
| { [index: string]: Target }
|
9342
9367
|
| {
|
9343
9368
|
/**
|
9344
9369
|
* New request.
|
9345
9370
|
*/
|
9346
|
-
alias:
|
9371
|
+
alias: Target;
|
9347
9372
|
/**
|
9348
9373
|
* Request to be redirected.
|
9349
9374
|
*/
|
@@ -9358,12 +9383,12 @@ declare interface UserResolveOptions {
|
|
9358
9383
|
* A list of module alias configurations or an object which maps key to value, applied only after modules option
|
9359
9384
|
*/
|
9360
9385
|
fallback?:
|
9361
|
-
| { [index: string]:
|
9386
|
+
| { [index: string]: Target }
|
9362
9387
|
| {
|
9363
9388
|
/**
|
9364
9389
|
* New request.
|
9365
9390
|
*/
|
9366
|
-
alias:
|
9391
|
+
alias: Target;
|
9367
9392
|
/**
|
9368
9393
|
* Request to be redirected.
|
9369
9394
|
*/
|
@@ -9377,7 +9402,7 @@ declare interface UserResolveOptions {
|
|
9377
9402
|
/**
|
9378
9403
|
* A list of alias fields in description files
|
9379
9404
|
*/
|
9380
|
-
aliasFields?:
|
9405
|
+
aliasFields?: EntryItem[];
|
9381
9406
|
|
9382
9407
|
/**
|
9383
9408
|
* A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
|
@@ -9407,12 +9432,12 @@ declare interface UserResolveOptions {
|
|
9407
9432
|
/**
|
9408
9433
|
* A list of exports fields in description files
|
9409
9434
|
*/
|
9410
|
-
exportsFields?:
|
9435
|
+
exportsFields?: EntryItem[];
|
9411
9436
|
|
9412
9437
|
/**
|
9413
9438
|
* A list of imports fields in description files
|
9414
9439
|
*/
|
9415
|
-
importsFields?:
|
9440
|
+
importsFields?: EntryItem[];
|
9416
9441
|
|
9417
9442
|
/**
|
9418
9443
|
* A list of extensions which should be tried for files
|
@@ -9442,7 +9467,7 @@ declare interface UserResolveOptions {
|
|
9442
9467
|
/**
|
9443
9468
|
* A list of directories to resolve modules from, can be absolute path or folder name
|
9444
9469
|
*/
|
9445
|
-
modules?:
|
9470
|
+
modules?: EntryItem;
|
9446
9471
|
|
9447
9472
|
/**
|
9448
9473
|
* A list of main fields in description files
|
@@ -9450,7 +9475,7 @@ declare interface UserResolveOptions {
|
|
9450
9475
|
mainFields?: (
|
9451
9476
|
| string
|
9452
9477
|
| string[]
|
9453
|
-
| { name:
|
9478
|
+
| { name: EntryItem; forceRelative: boolean }
|
9454
9479
|
)[];
|
9455
9480
|
|
9456
9481
|
/**
|
@@ -9525,7 +9550,7 @@ declare interface WatchFileSystem {
|
|
9525
9550
|
}
|
9526
9551
|
declare class WatchIgnorePlugin {
|
9527
9552
|
constructor(options: WatchIgnorePluginOptions);
|
9528
|
-
paths:
|
9553
|
+
paths: (string | RegExp)[];
|
9529
9554
|
|
9530
9555
|
/**
|
9531
9556
|
* Apply the plugin
|
@@ -9536,7 +9561,7 @@ declare interface WatchIgnorePluginOptions {
|
|
9536
9561
|
/**
|
9537
9562
|
* A list of RegExps or absolute paths to directories or files that should be ignored.
|
9538
9563
|
*/
|
9539
|
-
paths:
|
9564
|
+
paths: (string | RegExp)[];
|
9540
9565
|
}
|
9541
9566
|
|
9542
9567
|
/**
|
@@ -9888,7 +9913,7 @@ declare interface WithOptions {
|
|
9888
9913
|
/**
|
9889
9914
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
9890
9915
|
*/
|
9891
|
-
aliasFields?:
|
9916
|
+
aliasFields?: EntryItem[];
|
9892
9917
|
/**
|
9893
9918
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
9894
9919
|
*/
|
@@ -9944,7 +9969,7 @@ declare interface WithOptions {
|
|
9944
9969
|
/**
|
9945
9970
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
9946
9971
|
*/
|
9947
|
-
mainFields?:
|
9972
|
+
mainFields?: EntryItem[];
|
9948
9973
|
/**
|
9949
9974
|
* Filenames used to find the default entry point if there is no description file or main field.
|
9950
9975
|
*/
|
@@ -10112,6 +10137,7 @@ declare namespace exports {
|
|
10112
10137
|
export let scriptNonce: string;
|
10113
10138
|
export let loadScript: string;
|
10114
10139
|
export let chunkName: string;
|
10140
|
+
export let runtimeId: string;
|
10115
10141
|
export let getChunkScriptFilename: string;
|
10116
10142
|
export let getChunkUpdateScriptFilename: string;
|
10117
10143
|
export let startup: string;
|