webpack 5.12.3 → 5.16.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/lib/AutomaticPrefetchPlugin.js +1 -1
- package/lib/ChunkGraph.js +14 -4
- package/lib/Compilation.js +20 -15
- package/lib/Compiler.js +6 -3
- package/lib/ContextModule.js +2 -2
- package/lib/ContextModuleFactory.js +6 -4
- package/lib/ExportsInfo.js +0 -1
- package/lib/ExternalModuleFactoryPlugin.js +46 -3
- package/lib/FileSystemInfo.js +288 -157
- package/lib/IgnoreErrorModuleFactory.js +39 -0
- package/lib/MultiCompiler.js +2 -0
- package/lib/NormalModuleFactory.js +26 -7
- package/lib/WatchIgnorePlugin.js +6 -1
- package/lib/WebpackIsIncludedPlugin.js +85 -0
- package/lib/WebpackOptionsApply.js +2 -0
- package/lib/cache/PackFileCacheStrategy.js +5 -5
- package/lib/dependencies/AMDDefineDependency.js +1 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +2 -17
- package/lib/dependencies/URLDependency.js +45 -3
- package/lib/dependencies/URLPlugin.js +33 -7
- package/lib/dependencies/WebpackIsIncludedDependency.js +80 -0
- package/lib/ids/IdHelpers.js +8 -3
- package/lib/javascript/JavascriptModulesPlugin.js +4 -3
- package/lib/library/AssignLibraryPlugin.js +13 -4
- package/lib/library/EnableLibraryPlugin.js +12 -0
- package/lib/optimize/InnerGraph.js +32 -0
- package/lib/optimize/SplitChunksPlugin.js +4 -1
- package/lib/serialization/FileMiddleware.js +1 -1
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ShareRuntimeModule.js +2 -2
- package/lib/stats/DefaultStatsPrinterPlugin.js +6 -0
- package/lib/util/fs.js +51 -11
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/processAsyncTree.js +61 -0
- package/package.json +9 -7
- package/schemas/WebpackOptions.json +62 -25
- package/schemas/plugins/container/ContainerPlugin.json +2 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +2 -1
- package/types.d.ts +339 -236
package/types.d.ts
CHANGED
@@ -77,7 +77,6 @@ import {
|
|
77
77
|
WithStatement,
|
78
78
|
YieldExpression
|
79
79
|
} from "estree";
|
80
|
-
import { Stats as FsStats, WriteStream } from "fs";
|
81
80
|
import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
|
82
81
|
import { default as ValidationError } from "schema-utils/declarations/ValidationError";
|
83
82
|
import {
|
@@ -176,6 +175,15 @@ declare interface AggressiveSplittingPluginOptions {
|
|
176
175
|
*/
|
177
176
|
minSize?: number;
|
178
177
|
}
|
178
|
+
declare interface AliasOption {
|
179
|
+
alias: string | false | string[];
|
180
|
+
name: string;
|
181
|
+
onlyModule?: boolean;
|
182
|
+
}
|
183
|
+
type AliasOptionNewRequest = string | false | string[];
|
184
|
+
declare interface AliasOptions {
|
185
|
+
[index: string]: AliasOptionNewRequest;
|
186
|
+
}
|
179
187
|
declare interface Argument {
|
180
188
|
description: string;
|
181
189
|
simpleType: "string" | "number" | "boolean";
|
@@ -359,12 +367,12 @@ declare interface BannerPluginOptions {
|
|
359
367
|
/**
|
360
368
|
* Exclude all modules matching any of these conditions.
|
361
369
|
*/
|
362
|
-
exclude?: string | RegExp |
|
370
|
+
exclude?: string | RegExp | Rule[];
|
363
371
|
|
364
372
|
/**
|
365
373
|
* Include all modules matching any of these conditions.
|
366
374
|
*/
|
367
|
-
include?: string | RegExp |
|
375
|
+
include?: string | RegExp | Rule[];
|
368
376
|
|
369
377
|
/**
|
370
378
|
* If true, banner will not be wrapped in a comment.
|
@@ -374,13 +382,13 @@ declare interface BannerPluginOptions {
|
|
374
382
|
/**
|
375
383
|
* Include all modules that pass test assertion.
|
376
384
|
*/
|
377
|
-
test?: string | RegExp |
|
385
|
+
test?: string | RegExp | Rule[];
|
378
386
|
}
|
379
387
|
declare interface BaseResolveRequest {
|
380
|
-
path:
|
388
|
+
path: string | false;
|
381
389
|
descriptionFilePath?: string;
|
382
390
|
descriptionFileRoot?: string;
|
383
|
-
descriptionFileData?:
|
391
|
+
descriptionFileData?: object;
|
384
392
|
relativePath?: string;
|
385
393
|
ignoreSymlinks?: boolean;
|
386
394
|
fullySpecified?: boolean;
|
@@ -576,11 +584,11 @@ declare interface CacheGroupSource {
|
|
576
584
|
) => undefined | string;
|
577
585
|
chunksFilter?: (chunk: Chunk) => boolean;
|
578
586
|
enforce?: boolean;
|
579
|
-
minSize:
|
580
|
-
minRemainingSize:
|
581
|
-
enforceSizeThreshold:
|
582
|
-
maxAsyncSize:
|
583
|
-
maxInitialSize:
|
587
|
+
minSize: SplitChunksSizes;
|
588
|
+
minRemainingSize: SplitChunksSizes;
|
589
|
+
enforceSizeThreshold: SplitChunksSizes;
|
590
|
+
maxAsyncSize: SplitChunksSizes;
|
591
|
+
maxInitialSize: SplitChunksSizes;
|
584
592
|
minChunks?: number;
|
585
593
|
maxAsyncRequests?: number;
|
586
594
|
maxInitialRequests?: number;
|
@@ -1067,6 +1075,40 @@ declare abstract class CodeGenerationResults {
|
|
1067
1075
|
getData(module: Module, runtime: RuntimeSpec, key: string): any;
|
1068
1076
|
add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
|
1069
1077
|
}
|
1078
|
+
type CodeValue =
|
1079
|
+
| undefined
|
1080
|
+
| null
|
1081
|
+
| string
|
1082
|
+
| number
|
1083
|
+
| bigint
|
1084
|
+
| boolean
|
1085
|
+
| Function
|
1086
|
+
| RegExp
|
1087
|
+
| RuntimeValue
|
1088
|
+
| {
|
1089
|
+
[index: string]: RecursiveArrayOrRecord<
|
1090
|
+
| undefined
|
1091
|
+
| null
|
1092
|
+
| string
|
1093
|
+
| number
|
1094
|
+
| bigint
|
1095
|
+
| boolean
|
1096
|
+
| Function
|
1097
|
+
| RegExp
|
1098
|
+
| RuntimeValue
|
1099
|
+
>;
|
1100
|
+
}
|
1101
|
+
| RecursiveArrayOrRecord<
|
1102
|
+
| undefined
|
1103
|
+
| null
|
1104
|
+
| string
|
1105
|
+
| number
|
1106
|
+
| bigint
|
1107
|
+
| boolean
|
1108
|
+
| Function
|
1109
|
+
| RegExp
|
1110
|
+
| RuntimeValue
|
1111
|
+
>[];
|
1070
1112
|
declare interface Comparator<T> {
|
1071
1113
|
(arg0: T, arg1: T): 0 | 1 | -1;
|
1072
1114
|
}
|
@@ -1170,16 +1212,16 @@ declare class Compilation {
|
|
1170
1212
|
>
|
1171
1213
|
>;
|
1172
1214
|
optimizeAssets: AsyncSeriesHook<
|
1173
|
-
[
|
1215
|
+
[CompilationAssets],
|
1174
1216
|
ProcessAssetsAdditionalOptions
|
1175
1217
|
>;
|
1176
|
-
afterOptimizeAssets: SyncHook<[
|
1218
|
+
afterOptimizeAssets: SyncHook<[CompilationAssets]>;
|
1177
1219
|
processAssets: AsyncSeriesHook<
|
1178
|
-
[
|
1220
|
+
[CompilationAssets],
|
1179
1221
|
ProcessAssetsAdditionalOptions
|
1180
1222
|
>;
|
1181
|
-
afterProcessAssets: SyncHook<[
|
1182
|
-
processAdditionalAssets: AsyncSeriesHook<[
|
1223
|
+
afterProcessAssets: SyncHook<[CompilationAssets]>;
|
1224
|
+
processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
|
1183
1225
|
needAdditionalSeal: SyncBailHook<[], boolean>;
|
1184
1226
|
afterSeal: AsyncSeriesHook<[]>;
|
1185
1227
|
renderManifest: SyncWaterfallHook<
|
@@ -1249,7 +1291,7 @@ declare class Compilation {
|
|
1249
1291
|
modules: Set<Module>;
|
1250
1292
|
records: any;
|
1251
1293
|
additionalChunkAssets: string[];
|
1252
|
-
assets:
|
1294
|
+
assets: CompilationAssets;
|
1253
1295
|
assetsInfo: Map<string, AssetInfo>;
|
1254
1296
|
errors: WebpackError[];
|
1255
1297
|
warnings: WebpackError[];
|
@@ -1527,6 +1569,9 @@ declare class Compilation {
|
|
1527
1569
|
*/
|
1528
1570
|
static PROCESS_ASSETS_STAGE_REPORT: number;
|
1529
1571
|
}
|
1572
|
+
declare interface CompilationAssets {
|
1573
|
+
[index: string]: Source;
|
1574
|
+
}
|
1530
1575
|
declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
|
1531
1576
|
renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContextObject]>;
|
1532
1577
|
}
|
@@ -1600,8 +1645,8 @@ declare class Compiler {
|
|
1600
1645
|
immutablePaths: Set<string>;
|
1601
1646
|
modifiedFiles: Set<string>;
|
1602
1647
|
removedFiles: Set<string>;
|
1603
|
-
fileTimestamps: Map<string, null | FileSystemInfoEntry>;
|
1604
|
-
contextTimestamps: Map<string, null | FileSystemInfoEntry>;
|
1648
|
+
fileTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
|
1649
|
+
contextTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
|
1605
1650
|
resolverFactory: ResolverFactory;
|
1606
1651
|
infrastructureLogger: any;
|
1607
1652
|
options: WebpackOptionsNormalized;
|
@@ -1752,13 +1797,13 @@ declare interface Configuration {
|
|
1752
1797
|
| ExternalItem[]
|
1753
1798
|
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
|
1754
1799
|
| ((
|
1755
|
-
data:
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1800
|
+
data: ExternalItemFunctionData,
|
1801
|
+
callback: (
|
1802
|
+
err?: Error,
|
1803
|
+
result?: string | boolean | string[] | { [index: string]: any }
|
1804
|
+
) => void
|
1805
|
+
) => void)
|
1806
|
+
| ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
|
1762
1807
|
|
1763
1808
|
/**
|
1764
1809
|
* Enable presets of externals for specific targets.
|
@@ -2163,36 +2208,8 @@ declare class DefinePlugin {
|
|
2163
2208
|
/**
|
2164
2209
|
* Create a new define plugin
|
2165
2210
|
*/
|
2166
|
-
constructor(
|
2167
|
-
|
2168
|
-
string,
|
2169
|
-
RecursiveArrayOrRecord<
|
2170
|
-
| undefined
|
2171
|
-
| null
|
2172
|
-
| string
|
2173
|
-
| number
|
2174
|
-
| bigint
|
2175
|
-
| boolean
|
2176
|
-
| Function
|
2177
|
-
| RegExp
|
2178
|
-
| RuntimeValue
|
2179
|
-
>
|
2180
|
-
>
|
2181
|
-
);
|
2182
|
-
definitions: Record<
|
2183
|
-
string,
|
2184
|
-
RecursiveArrayOrRecord<
|
2185
|
-
| undefined
|
2186
|
-
| null
|
2187
|
-
| string
|
2188
|
-
| number
|
2189
|
-
| bigint
|
2190
|
-
| boolean
|
2191
|
-
| Function
|
2192
|
-
| RegExp
|
2193
|
-
| RuntimeValue
|
2194
|
-
>
|
2195
|
-
>;
|
2211
|
+
constructor(definitions: Record<string, CodeValue>);
|
2212
|
+
definitions: Record<string, CodeValue>;
|
2196
2213
|
|
2197
2214
|
/**
|
2198
2215
|
* Apply the plugin
|
@@ -2387,8 +2404,6 @@ declare class DeterministicModuleIdsPlugin {
|
|
2387
2404
|
declare interface DevServer {
|
2388
2405
|
[index: string]: any;
|
2389
2406
|
}
|
2390
|
-
type DevTool = string | false;
|
2391
|
-
type DevtoolFallbackModuleFilenameTemplate = string | Function;
|
2392
2407
|
declare class DllPlugin {
|
2393
2408
|
constructor(options: DllPluginOptions);
|
2394
2409
|
options: {
|
@@ -2790,15 +2805,9 @@ declare class EntryOptionPlugin {
|
|
2790
2805
|
desc: EntryDescriptionNormalized
|
2791
2806
|
): EntryOptions;
|
2792
2807
|
}
|
2793
|
-
type EntryOptions = { name?: string } &
|
2808
|
+
type EntryOptions = { name?: string } & Omit<
|
2794
2809
|
EntryDescriptionNormalized,
|
2795
|
-
|
2796
|
-
| "chunkLoading"
|
2797
|
-
| "dependOn"
|
2798
|
-
| "layer"
|
2799
|
-
| "library"
|
2800
|
-
| "runtime"
|
2801
|
-
| "wasmLoading"
|
2810
|
+
"import"
|
2802
2811
|
>;
|
2803
2812
|
declare class EntryPlugin {
|
2804
2813
|
/**
|
@@ -2916,7 +2925,7 @@ declare class EvalDevToolModulePlugin {
|
|
2916
2925
|
declare class EvalSourceMapDevToolPlugin {
|
2917
2926
|
constructor(inputOptions: string | SourceMapDevToolPluginOptions);
|
2918
2927
|
sourceMapComment: string;
|
2919
|
-
moduleFilenameTemplate:
|
2928
|
+
moduleFilenameTemplate: string | Function;
|
2920
2929
|
namespace: string;
|
2921
2930
|
options: SourceMapDevToolPluginOptions;
|
2922
2931
|
|
@@ -3011,7 +3020,10 @@ declare abstract class ExportInfo {
|
|
3011
3020
|
/**
|
3012
3021
|
* get used name
|
3013
3022
|
*/
|
3014
|
-
getUsedName(
|
3023
|
+
getUsedName(
|
3024
|
+
fallbackName: undefined | string,
|
3025
|
+
runtime: RuntimeSpec
|
3026
|
+
): string | false;
|
3015
3027
|
hasUsedName(): boolean;
|
3016
3028
|
|
3017
3029
|
/**
|
@@ -3058,7 +3070,17 @@ declare abstract class ExportInfo {
|
|
3058
3070
|
| "maybe provided (runtime-defined)"
|
3059
3071
|
| "provided"
|
3060
3072
|
| "not provided";
|
3061
|
-
getRenameInfo():
|
3073
|
+
getRenameInfo():
|
3074
|
+
| string
|
3075
|
+
| "missing provision and use info prevents renaming"
|
3076
|
+
| "usage prevents renaming (no provision info)"
|
3077
|
+
| "missing provision info prevents renaming"
|
3078
|
+
| "missing usage info prevents renaming"
|
3079
|
+
| "usage prevents renaming"
|
3080
|
+
| "could be renamed"
|
3081
|
+
| "provision prevents renaming (no use info)"
|
3082
|
+
| "usage and provision prevents renaming"
|
3083
|
+
| "provision prevents renaming";
|
3062
3084
|
}
|
3063
3085
|
declare interface ExportSpec {
|
3064
3086
|
/**
|
@@ -3121,11 +3143,14 @@ declare abstract class ExportsInfo {
|
|
3121
3143
|
getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
|
3122
3144
|
getProvidedExports(): null | true | string[];
|
3123
3145
|
getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
|
3124
|
-
isExportProvided(name:
|
3146
|
+
isExportProvided(name: string | string[]): undefined | null | boolean;
|
3125
3147
|
getUsageKey(runtime: RuntimeSpec): string;
|
3126
3148
|
isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
|
3127
|
-
getUsed(name:
|
3128
|
-
getUsedName(
|
3149
|
+
getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
|
3150
|
+
getUsedName(
|
3151
|
+
name: string | string[],
|
3152
|
+
runtime: RuntimeSpec
|
3153
|
+
): string | false | string[];
|
3129
3154
|
updateHash(hash: Hash, runtime: RuntimeSpec): void;
|
3130
3155
|
getRestoreProvidedData(): any;
|
3131
3156
|
restoreProvided(__0: {
|
@@ -3222,13 +3247,46 @@ type ExternalItem =
|
|
3222
3247
|
| RegExp
|
3223
3248
|
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
|
3224
3249
|
| ((
|
3225
|
-
data:
|
3226
|
-
|
3227
|
-
|
3228
|
-
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
3250
|
+
data: ExternalItemFunctionData,
|
3251
|
+
callback: (
|
3252
|
+
err?: Error,
|
3253
|
+
result?: string | boolean | string[] | { [index: string]: any }
|
3254
|
+
) => void
|
3255
|
+
) => void)
|
3256
|
+
| ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
|
3257
|
+
|
3258
|
+
/**
|
3259
|
+
* Data object passed as argument when a function is set for 'externals'.
|
3260
|
+
*/
|
3261
|
+
declare interface ExternalItemFunctionData {
|
3262
|
+
/**
|
3263
|
+
* The directory in which the request is placed.
|
3264
|
+
*/
|
3265
|
+
context?: string;
|
3266
|
+
|
3267
|
+
/**
|
3268
|
+
* Contextual information.
|
3269
|
+
*/
|
3270
|
+
contextInfo?: ModuleFactoryCreateDataContextInfo;
|
3271
|
+
|
3272
|
+
/**
|
3273
|
+
* Get a resolve function with the current resolver options.
|
3274
|
+
*/
|
3275
|
+
getResolve?: (
|
3276
|
+
options?: ResolveOptionsWebpackOptions
|
3277
|
+
) =>
|
3278
|
+
| ((
|
3279
|
+
context: string,
|
3280
|
+
request: string,
|
3281
|
+
callback: (err?: Error, result?: string) => void
|
3282
|
+
) => void)
|
3283
|
+
| ((context: string, request: string) => Promise<string>);
|
3284
|
+
|
3285
|
+
/**
|
3286
|
+
* The request as written by the user in the require/import expression/statement.
|
3287
|
+
*/
|
3288
|
+
request?: string;
|
3289
|
+
}
|
3232
3290
|
|
3233
3291
|
/**
|
3234
3292
|
* If an dependency matches exactly a property of the object, the property value is used as dependency.
|
@@ -3246,11 +3304,12 @@ declare interface ExternalItemObjectKnown {
|
|
3246
3304
|
* If an dependency matches exactly a property of the object, the property value is used as dependency.
|
3247
3305
|
*/
|
3248
3306
|
declare interface ExternalItemObjectUnknown {
|
3249
|
-
[index: string]:
|
3307
|
+
[index: string]: ExternalItemValue;
|
3250
3308
|
}
|
3309
|
+
type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
|
3251
3310
|
declare class ExternalModule extends Module {
|
3252
3311
|
constructor(request?: any, type?: any, userRequest?: any);
|
3253
|
-
request: string | string[] | Record<string,
|
3312
|
+
request: string | string[] | Record<string, string | string[]>;
|
3254
3313
|
externalType: string;
|
3255
3314
|
userRequest: string;
|
3256
3315
|
getSourceData(
|
@@ -3269,13 +3328,13 @@ type Externals =
|
|
3269
3328
|
| ExternalItem[]
|
3270
3329
|
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
|
3271
3330
|
| ((
|
3272
|
-
data:
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3277
|
-
|
3278
|
-
|
3331
|
+
data: ExternalItemFunctionData,
|
3332
|
+
callback: (
|
3333
|
+
err?: Error,
|
3334
|
+
result?: string | boolean | string[] | { [index: string]: any }
|
3335
|
+
) => void
|
3336
|
+
) => void)
|
3337
|
+
| ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
|
3279
3338
|
declare class ExternalsPlugin {
|
3280
3339
|
constructor(type: undefined | string, externals: Externals);
|
3281
3340
|
type?: string;
|
@@ -3362,9 +3421,9 @@ declare interface FactorizeModuleOptions {
|
|
3362
3421
|
type FakeHook<T> = T & FakeHookMarker;
|
3363
3422
|
declare interface FakeHookMarker {}
|
3364
3423
|
declare interface FallbackCacheGroup {
|
3365
|
-
minSize:
|
3366
|
-
maxAsyncSize:
|
3367
|
-
maxInitialSize:
|
3424
|
+
minSize: SplitChunksSizes;
|
3425
|
+
maxAsyncSize: SplitChunksSizes;
|
3426
|
+
maxInitialSize: SplitChunksSizes;
|
3368
3427
|
automaticNameDelimiter: string;
|
3369
3428
|
}
|
3370
3429
|
declare class FetchCompileAsyncWasmPlugin {
|
@@ -3452,7 +3511,11 @@ declare interface FileCacheOptions {
|
|
3452
3511
|
declare interface FileSystem {
|
3453
3512
|
readFile: {
|
3454
3513
|
(arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
|
3455
|
-
(
|
3514
|
+
(
|
3515
|
+
arg0: string,
|
3516
|
+
arg1: object,
|
3517
|
+
arg2: FileSystemCallback<string | Buffer>
|
3518
|
+
): void;
|
3456
3519
|
};
|
3457
3520
|
readdir: {
|
3458
3521
|
(
|
@@ -3461,25 +3524,37 @@ declare interface FileSystem {
|
|
3461
3524
|
): void;
|
3462
3525
|
(
|
3463
3526
|
arg0: string,
|
3464
|
-
arg1:
|
3527
|
+
arg1: object,
|
3465
3528
|
arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
|
3466
3529
|
): void;
|
3467
3530
|
};
|
3468
3531
|
readJson?: {
|
3469
|
-
(arg0: string, arg1: FileSystemCallback<
|
3470
|
-
(arg0: string, arg1:
|
3532
|
+
(arg0: string, arg1: FileSystemCallback<object>): void;
|
3533
|
+
(arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
|
3471
3534
|
};
|
3472
3535
|
readlink: {
|
3473
3536
|
(arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
|
3474
|
-
(
|
3537
|
+
(
|
3538
|
+
arg0: string,
|
3539
|
+
arg1: object,
|
3540
|
+
arg2: FileSystemCallback<string | Buffer>
|
3541
|
+
): void;
|
3475
3542
|
};
|
3476
3543
|
lstat?: {
|
3477
3544
|
(arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
|
3478
|
-
(
|
3545
|
+
(
|
3546
|
+
arg0: string,
|
3547
|
+
arg1: object,
|
3548
|
+
arg2: FileSystemCallback<string | Buffer>
|
3549
|
+
): void;
|
3479
3550
|
};
|
3480
3551
|
stat: {
|
3481
3552
|
(arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
|
3482
|
-
(
|
3553
|
+
(
|
3554
|
+
arg0: string,
|
3555
|
+
arg1: object,
|
3556
|
+
arg2: FileSystemCallback<string | Buffer>
|
3557
|
+
): void;
|
3483
3558
|
};
|
3484
3559
|
}
|
3485
3560
|
declare interface FileSystemCallback<T> {
|
@@ -3666,10 +3741,10 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
|
|
3666
3741
|
*/
|
3667
3742
|
static STAGE_TRIGGER: number;
|
3668
3743
|
}
|
3669
|
-
declare interface GroupConfig
|
3670
|
-
getKeys: (arg0
|
3671
|
-
createGroup: (arg0: string, arg1:
|
3672
|
-
getOptions?: (arg0: string, arg1:
|
3744
|
+
declare interface GroupConfig {
|
3745
|
+
getKeys: (arg0?: any) => string[];
|
3746
|
+
createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
|
3747
|
+
getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
|
3673
3748
|
}
|
3674
3749
|
declare interface GroupOptions {
|
3675
3750
|
groupChildren?: boolean;
|
@@ -3705,7 +3780,6 @@ declare class Hash {
|
|
3705
3780
|
*/
|
3706
3781
|
digest(encoding?: string): string | Buffer;
|
3707
3782
|
}
|
3708
|
-
type HashFunction = string | typeof Hash;
|
3709
3783
|
declare interface HashableObject {
|
3710
3784
|
updateHash: (arg0: Hash) => void;
|
3711
3785
|
}
|
@@ -3765,6 +3839,43 @@ declare class HttpsUriPlugin {
|
|
3765
3839
|
*/
|
3766
3840
|
apply(compiler: Compiler): void;
|
3767
3841
|
}
|
3842
|
+
declare interface IDirent {
|
3843
|
+
isFile: () => boolean;
|
3844
|
+
isDirectory: () => boolean;
|
3845
|
+
isBlockDevice: () => boolean;
|
3846
|
+
isCharacterDevice: () => boolean;
|
3847
|
+
isSymbolicLink: () => boolean;
|
3848
|
+
isFIFO: () => boolean;
|
3849
|
+
isSocket: () => boolean;
|
3850
|
+
name: string | Buffer;
|
3851
|
+
}
|
3852
|
+
declare interface IStats {
|
3853
|
+
isFile: () => boolean;
|
3854
|
+
isDirectory: () => boolean;
|
3855
|
+
isBlockDevice: () => boolean;
|
3856
|
+
isCharacterDevice: () => boolean;
|
3857
|
+
isSymbolicLink: () => boolean;
|
3858
|
+
isFIFO: () => boolean;
|
3859
|
+
isSocket: () => boolean;
|
3860
|
+
dev: number | bigint;
|
3861
|
+
ino: number | bigint;
|
3862
|
+
mode: number | bigint;
|
3863
|
+
nlink: number | bigint;
|
3864
|
+
uid: number | bigint;
|
3865
|
+
gid: number | bigint;
|
3866
|
+
rdev: number | bigint;
|
3867
|
+
size: number | bigint;
|
3868
|
+
blksize: number | bigint;
|
3869
|
+
blocks: number | bigint;
|
3870
|
+
atimeMs: number | bigint;
|
3871
|
+
mtimeMs: number | bigint;
|
3872
|
+
ctimeMs: number | bigint;
|
3873
|
+
birthtimeMs: number | bigint;
|
3874
|
+
atime: Date;
|
3875
|
+
mtime: Date;
|
3876
|
+
ctime: Date;
|
3877
|
+
birthtime: Date;
|
3878
|
+
}
|
3768
3879
|
declare class IgnorePlugin {
|
3769
3880
|
constructor(options: IgnorePluginOptions);
|
3770
3881
|
options: IgnorePluginOptions;
|
@@ -3831,7 +3942,7 @@ declare abstract class InitFragment {
|
|
3831
3942
|
declare interface InputFileSystem {
|
3832
3943
|
readFile: (
|
3833
3944
|
arg0: string,
|
3834
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
|
3945
|
+
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
3835
3946
|
) => void;
|
3836
3947
|
readJson?: (
|
3837
3948
|
arg0: string,
|
@@ -3843,15 +3954,18 @@ declare interface InputFileSystem {
|
|
3843
3954
|
) => void;
|
3844
3955
|
readdir: (
|
3845
3956
|
arg0: string,
|
3846
|
-
arg1: (
|
3957
|
+
arg1: (
|
3958
|
+
arg0?: NodeJS.ErrnoException,
|
3959
|
+
arg1?: (string | Buffer)[] | IDirent[]
|
3960
|
+
) => void
|
3847
3961
|
) => void;
|
3848
3962
|
stat: (
|
3849
3963
|
arg0: string,
|
3850
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?:
|
3964
|
+
arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
|
3851
3965
|
) => void;
|
3852
3966
|
realpath?: (
|
3853
3967
|
arg0: string,
|
3854
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string) => void
|
3968
|
+
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
3855
3969
|
) => void;
|
3856
3970
|
purge?: (arg0?: string) => void;
|
3857
3971
|
join?: (arg0: string, arg1: string) => string;
|
@@ -3863,7 +3977,7 @@ type IntermediateFileSystem = InputFileSystem &
|
|
3863
3977
|
IntermediateFileSystemExtras;
|
3864
3978
|
declare interface IntermediateFileSystemExtras {
|
3865
3979
|
mkdirSync: (arg0: string) => void;
|
3866
|
-
createWriteStream: (arg0: string) =>
|
3980
|
+
createWriteStream: (arg0: string) => NodeJS.WritableStream;
|
3867
3981
|
open: (
|
3868
3982
|
arg0: string,
|
3869
3983
|
arg1: string,
|
@@ -4341,7 +4455,7 @@ declare class JavascriptParser extends Parser {
|
|
4341
4455
|
expr: MemberExpression,
|
4342
4456
|
fallback: (
|
4343
4457
|
arg0: string,
|
4344
|
-
arg1:
|
4458
|
+
arg1: string | ScopeInfo | VariableInfo,
|
4345
4459
|
arg2: () => string[]
|
4346
4460
|
) => any,
|
4347
4461
|
defined: (arg0: string) => any,
|
@@ -4660,7 +4774,7 @@ declare interface KnownAssetInfo {
|
|
4660
4774
|
/**
|
4661
4775
|
* object of pointers to other assets, keyed by type of relation (only points from parent to child)
|
4662
4776
|
*/
|
4663
|
-
related?: Record<string,
|
4777
|
+
related?: Record<string, string | string[]>;
|
4664
4778
|
}
|
4665
4779
|
declare interface KnownBuildMeta {
|
4666
4780
|
moduleArgument?: string;
|
@@ -4841,6 +4955,7 @@ declare interface LibraryCustomUmdObject {
|
|
4841
4955
|
*/
|
4842
4956
|
root?: string | string[];
|
4843
4957
|
}
|
4958
|
+
type LibraryExport = string | string[];
|
4844
4959
|
type LibraryName = string | string[] | LibraryCustomUmdObject;
|
4845
4960
|
|
4846
4961
|
/**
|
@@ -4863,7 +4978,7 @@ declare interface LibraryOptions {
|
|
4863
4978
|
name?: string | string[] | LibraryCustomUmdObject;
|
4864
4979
|
|
4865
4980
|
/**
|
4866
|
-
* 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).
|
4981
|
+
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
|
4867
4982
|
*/
|
4868
4983
|
type: string;
|
4869
4984
|
|
@@ -4878,14 +4993,14 @@ declare class LibraryTemplatePlugin {
|
|
4878
4993
|
target: string,
|
4879
4994
|
umdNamedDefine: boolean,
|
4880
4995
|
auxiliaryComment: AuxiliaryComment,
|
4881
|
-
exportProperty:
|
4996
|
+
exportProperty: LibraryExport
|
4882
4997
|
);
|
4883
4998
|
library: {
|
4884
4999
|
type: string;
|
4885
5000
|
name: LibraryName;
|
4886
5001
|
umdNamedDefine: boolean;
|
4887
5002
|
auxiliaryComment: AuxiliaryComment;
|
4888
|
-
export:
|
5003
|
+
export: LibraryExport;
|
4889
5004
|
};
|
4890
5005
|
|
4891
5006
|
/**
|
@@ -5408,7 +5523,10 @@ declare class ModuleGraph {
|
|
5408
5523
|
module: Module
|
5409
5524
|
): (string | ((requestShortener: RequestShortener) => string))[];
|
5410
5525
|
getProvidedExports(module: Module): null | true | string[];
|
5411
|
-
isExportProvided(
|
5526
|
+
isExportProvided(
|
5527
|
+
module: Module,
|
5528
|
+
exportName: string | string[]
|
5529
|
+
): null | boolean;
|
5412
5530
|
getExportsInfo(module: Module): ExportsInfo;
|
5413
5531
|
getExportInfo(module: Module, exportName: string): ExportInfo;
|
5414
5532
|
getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
|
@@ -6733,7 +6851,7 @@ declare interface Output {
|
|
6733
6851
|
libraryExport?: string | string[];
|
6734
6852
|
|
6735
6853
|
/**
|
6736
|
-
* 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).
|
6854
|
+
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
|
6737
6855
|
*/
|
6738
6856
|
libraryTarget?: string;
|
6739
6857
|
|
@@ -6816,11 +6934,11 @@ declare interface OutputFileSystem {
|
|
6816
6934
|
mkdir: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
|
6817
6935
|
stat: (
|
6818
6936
|
arg0: string,
|
6819
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?:
|
6937
|
+
arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
|
6820
6938
|
) => void;
|
6821
6939
|
readFile: (
|
6822
6940
|
arg0: string,
|
6823
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
|
6941
|
+
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
6824
6942
|
) => void;
|
6825
6943
|
join?: (arg0: string, arg1: string) => string;
|
6826
6944
|
relative?: (arg0: string, arg1: string) => string;
|
@@ -7060,7 +7178,7 @@ declare interface ParsedIdentifier {
|
|
7060
7178
|
declare class Parser {
|
7061
7179
|
constructor();
|
7062
7180
|
parse(
|
7063
|
-
source: string |
|
7181
|
+
source: string | Buffer | PreparsedAst,
|
7064
7182
|
state: ParserState
|
7065
7183
|
): ParserState;
|
7066
7184
|
}
|
@@ -7112,8 +7230,11 @@ declare interface PerformanceOptions {
|
|
7112
7230
|
*/
|
7113
7231
|
maxEntrypointSize?: number;
|
7114
7232
|
}
|
7233
|
+
type Plugin =
|
7234
|
+
| { apply: (arg0: Resolver) => void }
|
7235
|
+
| ((this: Resolver, arg1: Resolver) => void);
|
7115
7236
|
declare interface PnpApiImpl {
|
7116
|
-
resolveToUnqualified: (arg0: string, arg1: string, arg2
|
7237
|
+
resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
|
7117
7238
|
}
|
7118
7239
|
declare interface PossibleFileSystemError {
|
7119
7240
|
code?: string;
|
@@ -7136,6 +7257,9 @@ declare class PrefixSource extends Source {
|
|
7136
7257
|
original(): Source;
|
7137
7258
|
getPrefix(): string;
|
7138
7259
|
}
|
7260
|
+
declare interface PreparsedAst {
|
7261
|
+
[index: string]: any;
|
7262
|
+
}
|
7139
7263
|
declare interface PrintedElement {
|
7140
7264
|
element: string;
|
7141
7265
|
content: string;
|
@@ -7258,8 +7382,8 @@ declare interface ProgressPluginOptions {
|
|
7258
7382
|
profile?: null | boolean;
|
7259
7383
|
}
|
7260
7384
|
declare class ProvidePlugin {
|
7261
|
-
constructor(definitions: Record<string,
|
7262
|
-
definitions: Record<string,
|
7385
|
+
constructor(definitions: Record<string, string | string[]>);
|
7386
|
+
definitions: Record<string, string | string[]>;
|
7263
7387
|
|
7264
7388
|
/**
|
7265
7389
|
* Apply the plugin
|
@@ -7569,17 +7693,17 @@ declare interface ResolveBuildDependenciesResult {
|
|
7569
7693
|
* Resolve context
|
7570
7694
|
*/
|
7571
7695
|
declare interface ResolveContext {
|
7572
|
-
contextDependencies?:
|
7696
|
+
contextDependencies?: WriteOnlySet<string>;
|
7573
7697
|
|
7574
7698
|
/**
|
7575
7699
|
* files that was found on file system
|
7576
7700
|
*/
|
7577
|
-
fileDependencies?:
|
7701
|
+
fileDependencies?: WriteOnlySet<string>;
|
7578
7702
|
|
7579
7703
|
/**
|
7580
7704
|
* dependencies that was not found on file system
|
7581
7705
|
*/
|
7582
|
-
missingDependencies?:
|
7706
|
+
missingDependencies?: WriteOnlySet<string>;
|
7583
7707
|
|
7584
7708
|
/**
|
7585
7709
|
* set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
|
@@ -7608,35 +7732,9 @@ declare interface ResolveData {
|
|
7608
7732
|
cacheable: boolean;
|
7609
7733
|
}
|
7610
7734
|
declare interface ResolveOptionsTypes {
|
7611
|
-
alias:
|
7612
|
-
|
7613
|
-
|
7614
|
-
*/
|
7615
|
-
alias: Target;
|
7616
|
-
/**
|
7617
|
-
* Request to be redirected.
|
7618
|
-
*/
|
7619
|
-
name: string;
|
7620
|
-
/**
|
7621
|
-
* Redirect only exact matching request.
|
7622
|
-
*/
|
7623
|
-
onlyModule?: boolean;
|
7624
|
-
}[];
|
7625
|
-
fallback: {
|
7626
|
-
/**
|
7627
|
-
* New request.
|
7628
|
-
*/
|
7629
|
-
alias: Target;
|
7630
|
-
/**
|
7631
|
-
* Request to be redirected.
|
7632
|
-
*/
|
7633
|
-
name: string;
|
7634
|
-
/**
|
7635
|
-
* Redirect only exact matching request.
|
7636
|
-
*/
|
7637
|
-
onlyModule?: boolean;
|
7638
|
-
}[];
|
7639
|
-
aliasFields: Set<EntryItem>;
|
7735
|
+
alias: AliasOption[];
|
7736
|
+
fallback: AliasOption[];
|
7737
|
+
aliasFields: Set<string | string[]>;
|
7640
7738
|
cachePredicate: (arg0: ResolveRequest) => boolean;
|
7641
7739
|
cacheWithContext: boolean;
|
7642
7740
|
|
@@ -7646,26 +7744,24 @@ declare interface ResolveOptionsTypes {
|
|
7646
7744
|
conditionNames: Set<string>;
|
7647
7745
|
descriptionFiles: string[];
|
7648
7746
|
enforceExtension: boolean;
|
7649
|
-
exportsFields: Set<
|
7650
|
-
importsFields: Set<
|
7747
|
+
exportsFields: Set<string | string[]>;
|
7748
|
+
importsFields: Set<string | string[]>;
|
7651
7749
|
extensions: Set<string>;
|
7652
7750
|
fileSystem: FileSystem;
|
7653
|
-
unsafeCache:
|
7751
|
+
unsafeCache: false | object;
|
7654
7752
|
symlinks: boolean;
|
7655
7753
|
resolver?: Resolver;
|
7656
|
-
modules:
|
7754
|
+
modules: (string | string[])[];
|
7657
7755
|
mainFields: { name: string[]; forceRelative: boolean }[];
|
7658
7756
|
mainFiles: Set<string>;
|
7659
|
-
plugins:
|
7660
|
-
| { apply: (arg0: Resolver) => void }
|
7661
|
-
| ((this: Resolver, arg1: Resolver) => void)
|
7662
|
-
)[];
|
7757
|
+
plugins: Plugin[];
|
7663
7758
|
pnpApi: null | PnpApiImpl;
|
7664
7759
|
roots: Set<string>;
|
7665
7760
|
fullySpecified: boolean;
|
7666
7761
|
resolveToContext: boolean;
|
7667
7762
|
restrictions: Set<string | RegExp>;
|
7668
7763
|
preferRelative: boolean;
|
7764
|
+
preferAbsolute: boolean;
|
7669
7765
|
}
|
7670
7766
|
|
7671
7767
|
/**
|
@@ -7680,7 +7776,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7680
7776
|
/**
|
7681
7777
|
* New request.
|
7682
7778
|
*/
|
7683
|
-
alias:
|
7779
|
+
alias: string | false | string[];
|
7684
7780
|
/**
|
7685
7781
|
* Request to be redirected.
|
7686
7782
|
*/
|
@@ -7690,12 +7786,12 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7690
7786
|
*/
|
7691
7787
|
onlyModule?: boolean;
|
7692
7788
|
}[]
|
7693
|
-
| { [index: string]:
|
7789
|
+
| { [index: string]: string | false | string[] };
|
7694
7790
|
|
7695
7791
|
/**
|
7696
7792
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
7697
7793
|
*/
|
7698
|
-
aliasFields?:
|
7794
|
+
aliasFields?: (string | string[])[];
|
7699
7795
|
|
7700
7796
|
/**
|
7701
7797
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
@@ -7750,7 +7846,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7750
7846
|
/**
|
7751
7847
|
* New request.
|
7752
7848
|
*/
|
7753
|
-
alias:
|
7849
|
+
alias: string | false | string[];
|
7754
7850
|
/**
|
7755
7851
|
* Request to be redirected.
|
7756
7852
|
*/
|
@@ -7760,7 +7856,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7760
7856
|
*/
|
7761
7857
|
onlyModule?: boolean;
|
7762
7858
|
}[]
|
7763
|
-
| { [index: string]:
|
7859
|
+
| { [index: string]: string | false | string[] };
|
7764
7860
|
|
7765
7861
|
/**
|
7766
7862
|
* Filesystem for the resolver.
|
@@ -7780,7 +7876,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7780
7876
|
/**
|
7781
7877
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
7782
7878
|
*/
|
7783
|
-
mainFields?:
|
7879
|
+
mainFields?: (string | string[])[];
|
7784
7880
|
|
7785
7881
|
/**
|
7786
7882
|
* Filenames used to find the default entry point if there is no description file or main field.
|
@@ -7797,6 +7893,11 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7797
7893
|
*/
|
7798
7894
|
plugins?: ("..." | ResolvePluginInstance)[];
|
7799
7895
|
|
7896
|
+
/**
|
7897
|
+
* Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
|
7898
|
+
*/
|
7899
|
+
preferAbsolute?: boolean;
|
7900
|
+
|
7800
7901
|
/**
|
7801
7902
|
* Prefer to resolve module requests as relative request and fallback to resolving as module.
|
7802
7903
|
*/
|
@@ -7813,7 +7914,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
7813
7914
|
restrictions?: (string | RegExp)[];
|
7814
7915
|
|
7815
7916
|
/**
|
7816
|
-
* A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
|
7917
|
+
* A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
|
7817
7918
|
*/
|
7818
7919
|
roots?: string[];
|
7819
7920
|
|
@@ -7891,9 +7992,9 @@ declare abstract class Resolver {
|
|
7891
7992
|
[ResolveRequest, ResolveContext],
|
7892
7993
|
null | ResolveRequest
|
7893
7994
|
>;
|
7894
|
-
resolveSync(context:
|
7995
|
+
resolveSync(context: object, path: string, request: string): string | false;
|
7895
7996
|
resolve(
|
7896
|
-
context:
|
7997
|
+
context: object,
|
7897
7998
|
path: string,
|
7898
7999
|
request: string,
|
7899
8000
|
resolveContext: ResolveContext,
|
@@ -7945,6 +8046,7 @@ declare interface ResourceDataWithData {
|
|
7945
8046
|
fragment: string;
|
7946
8047
|
data: Record<string, any>;
|
7947
8048
|
}
|
8049
|
+
type Rule = string | RegExp;
|
7948
8050
|
declare interface RuleSet {
|
7949
8051
|
/**
|
7950
8052
|
* map of references in the rule set (may grow over time)
|
@@ -7994,6 +8096,25 @@ type RuleSetConditionAbsolute =
|
|
7994
8096
|
}
|
7995
8097
|
| ((value: string) => boolean)
|
7996
8098
|
| RuleSetConditionAbsolute[];
|
8099
|
+
type RuleSetConditionOrConditions =
|
8100
|
+
| string
|
8101
|
+
| RegExp
|
8102
|
+
| {
|
8103
|
+
/**
|
8104
|
+
* Logical AND.
|
8105
|
+
*/
|
8106
|
+
and?: RuleSetCondition[];
|
8107
|
+
/**
|
8108
|
+
* Logical NOT.
|
8109
|
+
*/
|
8110
|
+
not?: RuleSetCondition[];
|
8111
|
+
/**
|
8112
|
+
* Logical OR.
|
8113
|
+
*/
|
8114
|
+
or?: RuleSetCondition[];
|
8115
|
+
}
|
8116
|
+
| ((value: string) => boolean)
|
8117
|
+
| RuleSetCondition[];
|
7997
8118
|
|
7998
8119
|
/**
|
7999
8120
|
* A rule description with conditions and effects for modules.
|
@@ -8048,7 +8169,7 @@ declare interface RuleSetRule {
|
|
8048
8169
|
/**
|
8049
8170
|
* Match values of properties in the description file (usually package.json).
|
8050
8171
|
*/
|
8051
|
-
descriptionData?: { [index: string]:
|
8172
|
+
descriptionData?: { [index: string]: RuleSetConditionOrConditions };
|
8052
8173
|
|
8053
8174
|
/**
|
8054
8175
|
* Enforce this rule as pre or post step.
|
@@ -8769,7 +8890,7 @@ declare abstract class RuntimeTemplate {
|
|
8769
8890
|
/**
|
8770
8891
|
* the export name
|
8771
8892
|
*/
|
8772
|
-
exportName:
|
8893
|
+
exportName: string | string[];
|
8773
8894
|
/**
|
8774
8895
|
* the origin module
|
8775
8896
|
*/
|
@@ -9158,10 +9279,10 @@ declare interface SourceLike {
|
|
9158
9279
|
}
|
9159
9280
|
declare class SourceMapDevToolPlugin {
|
9160
9281
|
constructor(options?: SourceMapDevToolPluginOptions);
|
9161
|
-
sourceMapFilename:
|
9162
|
-
sourceMappingURLComment:
|
9163
|
-
moduleFilenameTemplate:
|
9164
|
-
fallbackModuleFilenameTemplate:
|
9282
|
+
sourceMapFilename: string | false;
|
9283
|
+
sourceMappingURLComment: string | false;
|
9284
|
+
moduleFilenameTemplate: string | Function;
|
9285
|
+
fallbackModuleFilenameTemplate: string | Function;
|
9165
9286
|
namespace: string;
|
9166
9287
|
options: SourceMapDevToolPluginOptions;
|
9167
9288
|
|
@@ -9184,7 +9305,7 @@ declare interface SourceMapDevToolPluginOptions {
|
|
9184
9305
|
/**
|
9185
9306
|
* Exclude modules that match the given value from source map generation.
|
9186
9307
|
*/
|
9187
|
-
exclude?: string | RegExp |
|
9308
|
+
exclude?: string | RegExp | Rule[];
|
9188
9309
|
|
9189
9310
|
/**
|
9190
9311
|
* Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
|
@@ -9204,7 +9325,7 @@ declare interface SourceMapDevToolPluginOptions {
|
|
9204
9325
|
/**
|
9205
9326
|
* Include source maps for module paths that match the given value.
|
9206
9327
|
*/
|
9207
|
-
include?: string | RegExp |
|
9328
|
+
include?: string | RegExp | Rule[];
|
9208
9329
|
|
9209
9330
|
/**
|
9210
9331
|
* Indicates whether SourceMaps from loaders should be used (defaults to true).
|
@@ -9239,7 +9360,7 @@ declare interface SourceMapDevToolPluginOptions {
|
|
9239
9360
|
/**
|
9240
9361
|
* Include source maps for modules based on their extension (defaults to .js and .css).
|
9241
9362
|
*/
|
9242
|
-
test?: string | RegExp |
|
9363
|
+
test?: string | RegExp | Rule[];
|
9243
9364
|
}
|
9244
9365
|
declare class SourceMapSource extends Source {
|
9245
9366
|
constructor(
|
@@ -9266,11 +9387,11 @@ declare interface SourcePosition {
|
|
9266
9387
|
declare interface SplitChunksOptions {
|
9267
9388
|
chunksFilter: (chunk: Chunk) => boolean;
|
9268
9389
|
defaultSizeTypes: string[];
|
9269
|
-
minSize:
|
9270
|
-
minRemainingSize:
|
9271
|
-
enforceSizeThreshold:
|
9272
|
-
maxInitialSize:
|
9273
|
-
maxAsyncSize:
|
9390
|
+
minSize: SplitChunksSizes;
|
9391
|
+
minRemainingSize: SplitChunksSizes;
|
9392
|
+
enforceSizeThreshold: SplitChunksSizes;
|
9393
|
+
maxInitialSize: SplitChunksSizes;
|
9394
|
+
maxAsyncSize: SplitChunksSizes;
|
9274
9395
|
minChunks: number;
|
9275
9396
|
maxAsyncRequests: number;
|
9276
9397
|
maxInitialRequests: number;
|
@@ -9298,6 +9419,9 @@ declare class SplitChunksPlugin {
|
|
9298
9419
|
*/
|
9299
9420
|
apply(compiler: Compiler): void;
|
9300
9421
|
}
|
9422
|
+
declare interface SplitChunksSizes {
|
9423
|
+
[index: string]: number;
|
9424
|
+
}
|
9301
9425
|
declare abstract class StackedMap<K, V> {
|
9302
9426
|
map: Map<K, InternalCell<V>>;
|
9303
9427
|
stack: Map<K, InternalCell<V>>[];
|
@@ -9361,7 +9485,7 @@ declare abstract class StatsFactory {
|
|
9361
9485
|
SyncBailHook<[any, StatsFactoryContext, number, number], any>
|
9362
9486
|
>;
|
9363
9487
|
groupResults: HookMap<
|
9364
|
-
SyncBailHook<[GroupConfig
|
9488
|
+
SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
|
9365
9489
|
>;
|
9366
9490
|
sortResults: HookMap<
|
9367
9491
|
SyncBailHook<
|
@@ -9380,7 +9504,7 @@ declare abstract class StatsFactory {
|
|
9380
9504
|
create(
|
9381
9505
|
type: string,
|
9382
9506
|
data: any,
|
9383
|
-
baseContext:
|
9507
|
+
baseContext: Omit<StatsFactoryContext, "type">
|
9384
9508
|
): any;
|
9385
9509
|
}
|
9386
9510
|
type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
|
@@ -9459,6 +9583,11 @@ declare interface StatsOptions {
|
|
9459
9583
|
*/
|
9460
9584
|
chunkModules?: boolean;
|
9461
9585
|
|
9586
|
+
/**
|
9587
|
+
* Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
|
9588
|
+
*/
|
9589
|
+
chunkModulesSpace?: number;
|
9590
|
+
|
9462
9591
|
/**
|
9463
9592
|
* Add the origins of chunks and chunk merging info.
|
9464
9593
|
*/
|
@@ -9831,7 +9960,6 @@ declare interface TagInfo {
|
|
9831
9960
|
data: any;
|
9832
9961
|
next?: TagInfo;
|
9833
9962
|
}
|
9834
|
-
type Target = string | false | string[];
|
9835
9963
|
declare class Template {
|
9836
9964
|
constructor();
|
9837
9965
|
static getFunctionContent(fn: Function): string;
|
@@ -9841,9 +9969,9 @@ declare class Template {
|
|
9841
9969
|
static toPath(str: string): string;
|
9842
9970
|
static numberToIdentifier(n: number): string;
|
9843
9971
|
static numberToIdentifierContinuation(n: number): string;
|
9844
|
-
static indent(s:
|
9845
|
-
static prefix(s:
|
9846
|
-
static asString(str:
|
9972
|
+
static indent(s: string | string[]): string;
|
9973
|
+
static prefix(s: string | string[], prefix: string): string;
|
9974
|
+
static asString(str: string | string[]): string;
|
9847
9975
|
static getModulesArrayBounds(modules: WithId[]): false | [number, number];
|
9848
9976
|
static renderChunkModules(
|
9849
9977
|
renderContext: RenderContextModuleTemplate,
|
@@ -9887,47 +10015,17 @@ declare interface UserResolveOptions {
|
|
9887
10015
|
/**
|
9888
10016
|
* A list of module alias configurations or an object which maps key to value
|
9889
10017
|
*/
|
9890
|
-
alias?:
|
9891
|
-
| { [index: string]: Target }
|
9892
|
-
| {
|
9893
|
-
/**
|
9894
|
-
* New request.
|
9895
|
-
*/
|
9896
|
-
alias: Target;
|
9897
|
-
/**
|
9898
|
-
* Request to be redirected.
|
9899
|
-
*/
|
9900
|
-
name: string;
|
9901
|
-
/**
|
9902
|
-
* Redirect only exact matching request.
|
9903
|
-
*/
|
9904
|
-
onlyModule?: boolean;
|
9905
|
-
}[];
|
10018
|
+
alias?: AliasOption[] | AliasOptions;
|
9906
10019
|
|
9907
10020
|
/**
|
9908
10021
|
* A list of module alias configurations or an object which maps key to value, applied only after modules option
|
9909
10022
|
*/
|
9910
|
-
fallback?:
|
9911
|
-
| { [index: string]: Target }
|
9912
|
-
| {
|
9913
|
-
/**
|
9914
|
-
* New request.
|
9915
|
-
*/
|
9916
|
-
alias: Target;
|
9917
|
-
/**
|
9918
|
-
* Request to be redirected.
|
9919
|
-
*/
|
9920
|
-
name: string;
|
9921
|
-
/**
|
9922
|
-
* Redirect only exact matching request.
|
9923
|
-
*/
|
9924
|
-
onlyModule?: boolean;
|
9925
|
-
}[];
|
10023
|
+
fallback?: AliasOption[] | AliasOptions;
|
9926
10024
|
|
9927
10025
|
/**
|
9928
10026
|
* A list of alias fields in description files
|
9929
10027
|
*/
|
9930
|
-
aliasFields?:
|
10028
|
+
aliasFields?: (string | string[])[];
|
9931
10029
|
|
9932
10030
|
/**
|
9933
10031
|
* A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
|
@@ -9957,12 +10055,12 @@ declare interface UserResolveOptions {
|
|
9957
10055
|
/**
|
9958
10056
|
* A list of exports fields in description files
|
9959
10057
|
*/
|
9960
|
-
exportsFields?:
|
10058
|
+
exportsFields?: (string | string[])[];
|
9961
10059
|
|
9962
10060
|
/**
|
9963
10061
|
* A list of imports fields in description files
|
9964
10062
|
*/
|
9965
|
-
importsFields?:
|
10063
|
+
importsFields?: (string | string[])[];
|
9966
10064
|
|
9967
10065
|
/**
|
9968
10066
|
* A list of extensions which should be tried for files
|
@@ -9977,7 +10075,7 @@ declare interface UserResolveOptions {
|
|
9977
10075
|
/**
|
9978
10076
|
* Use this cache object to unsafely cache the successful requests
|
9979
10077
|
*/
|
9980
|
-
unsafeCache?:
|
10078
|
+
unsafeCache?: boolean | object;
|
9981
10079
|
|
9982
10080
|
/**
|
9983
10081
|
* Resolve symlinks to their symlinked location
|
@@ -10000,7 +10098,7 @@ declare interface UserResolveOptions {
|
|
10000
10098
|
mainFields?: (
|
10001
10099
|
| string
|
10002
10100
|
| string[]
|
10003
|
-
| { name:
|
10101
|
+
| { name: string | string[]; forceRelative: boolean }
|
10004
10102
|
)[];
|
10005
10103
|
|
10006
10104
|
/**
|
@@ -10011,10 +10109,7 @@ declare interface UserResolveOptions {
|
|
10011
10109
|
/**
|
10012
10110
|
* A list of additional resolve plugins which should be applied
|
10013
10111
|
*/
|
10014
|
-
plugins?:
|
10015
|
-
| { apply: (arg0: Resolver) => void }
|
10016
|
-
| ((this: Resolver, arg1: Resolver) => void)
|
10017
|
-
)[];
|
10112
|
+
plugins?: Plugin[];
|
10018
10113
|
|
10019
10114
|
/**
|
10020
10115
|
* A PnP API that should be used - null is "never", undefined is "auto"
|
@@ -10050,6 +10145,11 @@ declare interface UserResolveOptions {
|
|
10050
10145
|
* Prefer to resolve module requests as relative requests before falling back to modules
|
10051
10146
|
*/
|
10052
10147
|
preferRelative?: boolean;
|
10148
|
+
|
10149
|
+
/**
|
10150
|
+
* Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
|
10151
|
+
*/
|
10152
|
+
preferAbsolute?: boolean;
|
10053
10153
|
}
|
10054
10154
|
declare abstract class VariableInfo {
|
10055
10155
|
declaredScope: ScopeInfo;
|
@@ -10070,8 +10170,8 @@ declare interface WatchFileSystem {
|
|
10070
10170
|
options: WatchOptions,
|
10071
10171
|
callback: (
|
10072
10172
|
arg0: undefined | Error,
|
10073
|
-
arg1: Map<string, FileSystemInfoEntry>,
|
10074
|
-
arg2: Map<string, FileSystemInfoEntry>,
|
10173
|
+
arg1: Map<string, FileSystemInfoEntry | "ignore">,
|
10174
|
+
arg2: Map<string, FileSystemInfoEntry | "ignore">,
|
10075
10175
|
arg3: Set<string>,
|
10076
10176
|
arg4: Set<string>
|
10077
10177
|
) => void,
|
@@ -10137,12 +10237,12 @@ declare interface Watcher {
|
|
10137
10237
|
/**
|
10138
10238
|
* get info about files
|
10139
10239
|
*/
|
10140
|
-
getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry>;
|
10240
|
+
getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
|
10141
10241
|
|
10142
10242
|
/**
|
10143
10243
|
* get info about directories
|
10144
10244
|
*/
|
10145
|
-
getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry>;
|
10245
|
+
getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
|
10146
10246
|
}
|
10147
10247
|
declare abstract class Watching {
|
10148
10248
|
startTime: null | number;
|
@@ -10478,6 +10578,9 @@ declare interface WithOptions {
|
|
10478
10578
|
arg0: Partial<ResolveOptionsWithDependencyType>
|
10479
10579
|
) => ResolverWithOptions;
|
10480
10580
|
}
|
10581
|
+
declare interface WriteOnlySet<T> {
|
10582
|
+
add: (T?: any) => void;
|
10583
|
+
}
|
10481
10584
|
type __TypeWebpackOptions = (
|
10482
10585
|
data: object
|
10483
10586
|
) =>
|
@@ -10742,7 +10845,7 @@ declare namespace exports {
|
|
10742
10845
|
export { ProfilingPlugin };
|
10743
10846
|
}
|
10744
10847
|
export namespace util {
|
10745
|
-
export const createHash: (algorithm:
|
10848
|
+
export const createHash: (algorithm: string | typeof Hash) => Hash;
|
10746
10849
|
export namespace comparators {
|
10747
10850
|
export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
|
10748
10851
|
export let compareModulesByIdentifier: (
|