webpack 5.12.1 → 5.14.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/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 | (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 | (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 | (string | RegExp)[];
385
+ test?: string | RegExp | Rule[];
378
386
  }
379
387
  declare interface BaseResolveRequest {
380
- path: DevTool;
388
+ path: string | false;
381
389
  descriptionFilePath?: string;
382
390
  descriptionFileRoot?: string;
383
- descriptionFileData?: any;
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: Record<string, number>;
580
- minRemainingSize: Record<string, number>;
581
- enforceSizeThreshold: Record<string, number>;
582
- maxAsyncSize: Record<string, number>;
583
- maxInitialSize: Record<string, number>;
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
- [Record<string, Source>],
1215
+ [CompilationAssets],
1174
1216
  ProcessAssetsAdditionalOptions
1175
1217
  >;
1176
- afterOptimizeAssets: SyncHook<[Record<string, Source>]>;
1218
+ afterOptimizeAssets: SyncHook<[CompilationAssets]>;
1177
1219
  processAssets: AsyncSeriesHook<
1178
- [Record<string, Source>],
1220
+ [CompilationAssets],
1179
1221
  ProcessAssetsAdditionalOptions
1180
1222
  >;
1181
- afterProcessAssets: SyncHook<[Record<string, Source>]>;
1182
- processAdditionalAssets: AsyncSeriesHook<[Record<string, Source>]>;
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: Record<string, Source>;
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;
@@ -1750,15 +1795,7 @@ declare interface Configuration {
1750
1795
  | string
1751
1796
  | RegExp
1752
1797
  | ExternalItem[]
1753
- | {
1754
- [index: string]: string | boolean | string[] | { [index: string]: any };
1755
- /**
1756
- * Specify externals depending on the layer.
1757
- */
1758
- byLayer?:
1759
- | { [index: string]: ExternalItem }
1760
- | ((layer: null | string) => ExternalItem);
1761
- }
1798
+ | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
1762
1799
  | ((
1763
1800
  data: {
1764
1801
  context: string;
@@ -2171,36 +2208,8 @@ declare class DefinePlugin {
2171
2208
  /**
2172
2209
  * Create a new define plugin
2173
2210
  */
2174
- constructor(
2175
- definitions: Record<
2176
- string,
2177
- RecursiveArrayOrRecord<
2178
- | undefined
2179
- | null
2180
- | string
2181
- | number
2182
- | bigint
2183
- | boolean
2184
- | Function
2185
- | RegExp
2186
- | RuntimeValue
2187
- >
2188
- >
2189
- );
2190
- definitions: Record<
2191
- string,
2192
- RecursiveArrayOrRecord<
2193
- | undefined
2194
- | null
2195
- | string
2196
- | number
2197
- | bigint
2198
- | boolean
2199
- | Function
2200
- | RegExp
2201
- | RuntimeValue
2202
- >
2203
- >;
2211
+ constructor(definitions: Record<string, CodeValue>);
2212
+ definitions: Record<string, CodeValue>;
2204
2213
 
2205
2214
  /**
2206
2215
  * Apply the plugin
@@ -2395,8 +2404,6 @@ declare class DeterministicModuleIdsPlugin {
2395
2404
  declare interface DevServer {
2396
2405
  [index: string]: any;
2397
2406
  }
2398
- type DevTool = string | false;
2399
- type DevtoolFallbackModuleFilenameTemplate = string | Function;
2400
2407
  declare class DllPlugin {
2401
2408
  constructor(options: DllPluginOptions);
2402
2409
  options: {
@@ -2798,15 +2805,9 @@ declare class EntryOptionPlugin {
2798
2805
  desc: EntryDescriptionNormalized
2799
2806
  ): EntryOptions;
2800
2807
  }
2801
- type EntryOptions = { name?: string } & Pick<
2808
+ type EntryOptions = { name?: string } & Omit<
2802
2809
  EntryDescriptionNormalized,
2803
- | "filename"
2804
- | "chunkLoading"
2805
- | "dependOn"
2806
- | "layer"
2807
- | "library"
2808
- | "runtime"
2809
- | "wasmLoading"
2810
+ "import"
2810
2811
  >;
2811
2812
  declare class EntryPlugin {
2812
2813
  /**
@@ -2924,7 +2925,7 @@ declare class EvalDevToolModulePlugin {
2924
2925
  declare class EvalSourceMapDevToolPlugin {
2925
2926
  constructor(inputOptions: string | SourceMapDevToolPluginOptions);
2926
2927
  sourceMapComment: string;
2927
- moduleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate;
2928
+ moduleFilenameTemplate: string | Function;
2928
2929
  namespace: string;
2929
2930
  options: SourceMapDevToolPluginOptions;
2930
2931
 
@@ -3019,7 +3020,10 @@ declare abstract class ExportInfo {
3019
3020
  /**
3020
3021
  * get used name
3021
3022
  */
3022
- getUsedName(fallbackName: undefined | string, runtime: RuntimeSpec): DevTool;
3023
+ getUsedName(
3024
+ fallbackName: undefined | string,
3025
+ runtime: RuntimeSpec
3026
+ ): string | false;
3023
3027
  hasUsedName(): boolean;
3024
3028
 
3025
3029
  /**
@@ -3066,7 +3070,17 @@ declare abstract class ExportInfo {
3066
3070
  | "maybe provided (runtime-defined)"
3067
3071
  | "provided"
3068
3072
  | "not provided";
3069
- getRenameInfo(): string;
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";
3070
3084
  }
3071
3085
  declare interface ExportSpec {
3072
3086
  /**
@@ -3129,11 +3143,14 @@ declare abstract class ExportsInfo {
3129
3143
  getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
3130
3144
  getProvidedExports(): null | true | string[];
3131
3145
  getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
3132
- isExportProvided(name: EntryItem): undefined | null | boolean;
3146
+ isExportProvided(name: string | string[]): undefined | null | boolean;
3133
3147
  getUsageKey(runtime: RuntimeSpec): string;
3134
3148
  isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
3135
- getUsed(name: EntryItem, runtime: RuntimeSpec): UsageStateType;
3136
- getUsedName(name: EntryItem, runtime: RuntimeSpec): Target;
3149
+ getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
3150
+ getUsedName(
3151
+ name: string | string[],
3152
+ runtime: RuntimeSpec
3153
+ ): string | false | string[];
3137
3154
  updateHash(hash: Hash, runtime: RuntimeSpec): void;
3138
3155
  getRestoreProvidedData(): any;
3139
3156
  restoreProvided(__0: {
@@ -3228,15 +3245,7 @@ declare interface ExpressionExpressionInfo {
3228
3245
  type ExternalItem =
3229
3246
  | string
3230
3247
  | RegExp
3231
- | {
3232
- [index: string]: string | boolean | string[] | { [index: string]: any };
3233
- /**
3234
- * Specify externals depending on the layer.
3235
- */
3236
- byLayer?:
3237
- | { [index: string]: ExternalItem }
3238
- | ((layer: null | string) => ExternalItem);
3239
- }
3248
+ | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3240
3249
  | ((
3241
3250
  data: {
3242
3251
  context: string;
@@ -3245,9 +3254,28 @@ type ExternalItem =
3245
3254
  },
3246
3255
  callback: (err?: Error, result?: string) => void
3247
3256
  ) => void);
3257
+
3258
+ /**
3259
+ * If an dependency matches exactly a property of the object, the property value is used as dependency.
3260
+ */
3261
+ declare interface ExternalItemObjectKnown {
3262
+ /**
3263
+ * Specify externals depending on the layer.
3264
+ */
3265
+ byLayer?:
3266
+ | { [index: string]: ExternalItem }
3267
+ | ((layer: null | string) => ExternalItem);
3268
+ }
3269
+
3270
+ /**
3271
+ * If an dependency matches exactly a property of the object, the property value is used as dependency.
3272
+ */
3273
+ declare interface ExternalItemObjectUnknown {
3274
+ [index: string]: string | boolean | string[] | { [index: string]: any };
3275
+ }
3248
3276
  declare class ExternalModule extends Module {
3249
3277
  constructor(request?: any, type?: any, userRequest?: any);
3250
- request: string | string[] | Record<string, EntryItem>;
3278
+ request: string | string[] | Record<string, string | string[]>;
3251
3279
  externalType: string;
3252
3280
  userRequest: string;
3253
3281
  getSourceData(
@@ -3264,15 +3292,7 @@ type Externals =
3264
3292
  | string
3265
3293
  | RegExp
3266
3294
  | ExternalItem[]
3267
- | {
3268
- [index: string]: string | boolean | string[] | { [index: string]: any };
3269
- /**
3270
- * Specify externals depending on the layer.
3271
- */
3272
- byLayer?:
3273
- | { [index: string]: ExternalItem }
3274
- | ((layer: null | string) => ExternalItem);
3275
- }
3295
+ | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3276
3296
  | ((
3277
3297
  data: {
3278
3298
  context: string;
@@ -3367,9 +3387,9 @@ declare interface FactorizeModuleOptions {
3367
3387
  type FakeHook<T> = T & FakeHookMarker;
3368
3388
  declare interface FakeHookMarker {}
3369
3389
  declare interface FallbackCacheGroup {
3370
- minSize: Record<string, number>;
3371
- maxAsyncSize: Record<string, number>;
3372
- maxInitialSize: Record<string, number>;
3390
+ minSize: SplitChunksSizes;
3391
+ maxAsyncSize: SplitChunksSizes;
3392
+ maxInitialSize: SplitChunksSizes;
3373
3393
  automaticNameDelimiter: string;
3374
3394
  }
3375
3395
  declare class FetchCompileAsyncWasmPlugin {
@@ -3457,7 +3477,11 @@ declare interface FileCacheOptions {
3457
3477
  declare interface FileSystem {
3458
3478
  readFile: {
3459
3479
  (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
3460
- (arg0: string, arg1: any, arg2: FileSystemCallback<string | Buffer>): void;
3480
+ (
3481
+ arg0: string,
3482
+ arg1: object,
3483
+ arg2: FileSystemCallback<string | Buffer>
3484
+ ): void;
3461
3485
  };
3462
3486
  readdir: {
3463
3487
  (
@@ -3466,25 +3490,37 @@ declare interface FileSystem {
3466
3490
  ): void;
3467
3491
  (
3468
3492
  arg0: string,
3469
- arg1: any,
3493
+ arg1: object,
3470
3494
  arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
3471
3495
  ): void;
3472
3496
  };
3473
3497
  readJson?: {
3474
- (arg0: string, arg1: FileSystemCallback<any>): void;
3475
- (arg0: string, arg1: any, arg2: FileSystemCallback<any>): void;
3498
+ (arg0: string, arg1: FileSystemCallback<object>): void;
3499
+ (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
3476
3500
  };
3477
3501
  readlink: {
3478
3502
  (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
3479
- (arg0: string, arg1: any, arg2: FileSystemCallback<string | Buffer>): void;
3503
+ (
3504
+ arg0: string,
3505
+ arg1: object,
3506
+ arg2: FileSystemCallback<string | Buffer>
3507
+ ): void;
3480
3508
  };
3481
3509
  lstat?: {
3482
3510
  (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
3483
- (arg0: string, arg1: any, arg2: FileSystemCallback<string | Buffer>): void;
3511
+ (
3512
+ arg0: string,
3513
+ arg1: object,
3514
+ arg2: FileSystemCallback<string | Buffer>
3515
+ ): void;
3484
3516
  };
3485
3517
  stat: {
3486
3518
  (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
3487
- (arg0: string, arg1: any, arg2: FileSystemCallback<string | Buffer>): void;
3519
+ (
3520
+ arg0: string,
3521
+ arg1: object,
3522
+ arg2: FileSystemCallback<string | Buffer>
3523
+ ): void;
3488
3524
  };
3489
3525
  }
3490
3526
  declare interface FileSystemCallback<T> {
@@ -3671,10 +3707,10 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
3671
3707
  */
3672
3708
  static STAGE_TRIGGER: number;
3673
3709
  }
3674
- declare interface GroupConfig<T, R> {
3675
- getKeys: (arg0: T) => string[];
3676
- createGroup: (arg0: string, arg1: (T | R)[], arg2: T[]) => R;
3677
- getOptions?: (arg0: string, arg1: T[]) => GroupOptions;
3710
+ declare interface GroupConfig {
3711
+ getKeys: (arg0?: any) => string[];
3712
+ createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
3713
+ getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
3678
3714
  }
3679
3715
  declare interface GroupOptions {
3680
3716
  groupChildren?: boolean;
@@ -3710,7 +3746,6 @@ declare class Hash {
3710
3746
  */
3711
3747
  digest(encoding?: string): string | Buffer;
3712
3748
  }
3713
- type HashFunction = string | typeof Hash;
3714
3749
  declare interface HashableObject {
3715
3750
  updateHash: (arg0: Hash) => void;
3716
3751
  }
@@ -3770,6 +3805,43 @@ declare class HttpsUriPlugin {
3770
3805
  */
3771
3806
  apply(compiler: Compiler): void;
3772
3807
  }
3808
+ declare interface IDirent {
3809
+ isFile: () => boolean;
3810
+ isDirectory: () => boolean;
3811
+ isBlockDevice: () => boolean;
3812
+ isCharacterDevice: () => boolean;
3813
+ isSymbolicLink: () => boolean;
3814
+ isFIFO: () => boolean;
3815
+ isSocket: () => boolean;
3816
+ name: string | Buffer;
3817
+ }
3818
+ declare interface IStats {
3819
+ isFile: () => boolean;
3820
+ isDirectory: () => boolean;
3821
+ isBlockDevice: () => boolean;
3822
+ isCharacterDevice: () => boolean;
3823
+ isSymbolicLink: () => boolean;
3824
+ isFIFO: () => boolean;
3825
+ isSocket: () => boolean;
3826
+ dev: number | bigint;
3827
+ ino: number | bigint;
3828
+ mode: number | bigint;
3829
+ nlink: number | bigint;
3830
+ uid: number | bigint;
3831
+ gid: number | bigint;
3832
+ rdev: number | bigint;
3833
+ size: number | bigint;
3834
+ blksize: number | bigint;
3835
+ blocks: number | bigint;
3836
+ atimeMs: number | bigint;
3837
+ mtimeMs: number | bigint;
3838
+ ctimeMs: number | bigint;
3839
+ birthtimeMs: number | bigint;
3840
+ atime: Date;
3841
+ mtime: Date;
3842
+ ctime: Date;
3843
+ birthtime: Date;
3844
+ }
3773
3845
  declare class IgnorePlugin {
3774
3846
  constructor(options: IgnorePluginOptions);
3775
3847
  options: IgnorePluginOptions;
@@ -3836,7 +3908,7 @@ declare abstract class InitFragment {
3836
3908
  declare interface InputFileSystem {
3837
3909
  readFile: (
3838
3910
  arg0: string,
3839
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
3911
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
3840
3912
  ) => void;
3841
3913
  readJson?: (
3842
3914
  arg0: string,
@@ -3848,15 +3920,18 @@ declare interface InputFileSystem {
3848
3920
  ) => void;
3849
3921
  readdir: (
3850
3922
  arg0: string,
3851
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: string[]) => void
3923
+ arg1: (
3924
+ arg0?: NodeJS.ErrnoException,
3925
+ arg1?: (string | Buffer)[] | IDirent[]
3926
+ ) => void
3852
3927
  ) => void;
3853
3928
  stat: (
3854
3929
  arg0: string,
3855
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: FsStats) => void
3930
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
3856
3931
  ) => void;
3857
3932
  realpath?: (
3858
3933
  arg0: string,
3859
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: string) => void
3934
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
3860
3935
  ) => void;
3861
3936
  purge?: (arg0?: string) => void;
3862
3937
  join?: (arg0: string, arg1: string) => string;
@@ -3868,7 +3943,7 @@ type IntermediateFileSystem = InputFileSystem &
3868
3943
  IntermediateFileSystemExtras;
3869
3944
  declare interface IntermediateFileSystemExtras {
3870
3945
  mkdirSync: (arg0: string) => void;
3871
- createWriteStream: (arg0: string) => WriteStream;
3946
+ createWriteStream: (arg0: string) => NodeJS.WritableStream;
3872
3947
  open: (
3873
3948
  arg0: string,
3874
3949
  arg1: string,
@@ -4346,7 +4421,7 @@ declare class JavascriptParser extends Parser {
4346
4421
  expr: MemberExpression,
4347
4422
  fallback: (
4348
4423
  arg0: string,
4349
- arg1: ExportedVariableInfo,
4424
+ arg1: string | ScopeInfo | VariableInfo,
4350
4425
  arg2: () => string[]
4351
4426
  ) => any,
4352
4427
  defined: (arg0: string) => any,
@@ -4665,7 +4740,7 @@ declare interface KnownAssetInfo {
4665
4740
  /**
4666
4741
  * object of pointers to other assets, keyed by type of relation (only points from parent to child)
4667
4742
  */
4668
- related?: Record<string, EntryItem>;
4743
+ related?: Record<string, string | string[]>;
4669
4744
  }
4670
4745
  declare interface KnownBuildMeta {
4671
4746
  moduleArgument?: string;
@@ -4846,6 +4921,7 @@ declare interface LibraryCustomUmdObject {
4846
4921
  */
4847
4922
  root?: string | string[];
4848
4923
  }
4924
+ type LibraryExport = string | string[];
4849
4925
  type LibraryName = string | string[] | LibraryCustomUmdObject;
4850
4926
 
4851
4927
  /**
@@ -4883,14 +4959,14 @@ declare class LibraryTemplatePlugin {
4883
4959
  target: string,
4884
4960
  umdNamedDefine: boolean,
4885
4961
  auxiliaryComment: AuxiliaryComment,
4886
- exportProperty: EntryItem
4962
+ exportProperty: LibraryExport
4887
4963
  );
4888
4964
  library: {
4889
4965
  type: string;
4890
4966
  name: LibraryName;
4891
4967
  umdNamedDefine: boolean;
4892
4968
  auxiliaryComment: AuxiliaryComment;
4893
- export: EntryItem;
4969
+ export: LibraryExport;
4894
4970
  };
4895
4971
 
4896
4972
  /**
@@ -5413,7 +5489,10 @@ declare class ModuleGraph {
5413
5489
  module: Module
5414
5490
  ): (string | ((requestShortener: RequestShortener) => string))[];
5415
5491
  getProvidedExports(module: Module): null | true | string[];
5416
- isExportProvided(module: Module, exportName: EntryItem): null | boolean;
5492
+ isExportProvided(
5493
+ module: Module,
5494
+ exportName: string | string[]
5495
+ ): null | boolean;
5417
5496
  getExportsInfo(module: Module): ExportsInfo;
5418
5497
  getExportInfo(module: Module, exportName: string): ExportInfo;
5419
5498
  getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
@@ -5523,37 +5602,7 @@ declare interface ModuleOptions {
5523
5602
  /**
5524
5603
  * Specify options for each generator.
5525
5604
  */
5526
- generator?: {
5527
- [index: string]: { [index: string]: any };
5528
- /**
5529
- * Generator options for asset modules.
5530
- */
5531
- asset?: AssetGeneratorOptions;
5532
- /**
5533
- * Generator options for asset/inline modules.
5534
- */
5535
- "asset/inline"?: AssetInlineGeneratorOptions;
5536
- /**
5537
- * Generator options for asset/resource modules.
5538
- */
5539
- "asset/resource"?: AssetResourceGeneratorOptions;
5540
- /**
5541
- * No generator options are supported for this module type.
5542
- */
5543
- javascript?: EmptyGeneratorOptions;
5544
- /**
5545
- * No generator options are supported for this module type.
5546
- */
5547
- "javascript/auto"?: EmptyGeneratorOptions;
5548
- /**
5549
- * No generator options are supported for this module type.
5550
- */
5551
- "javascript/dynamic"?: EmptyGeneratorOptions;
5552
- /**
5553
- * No generator options are supported for this module type.
5554
- */
5555
- "javascript/esm"?: EmptyGeneratorOptions;
5556
- };
5605
+ generator?: ModuleOptionsGeneratorKnown & ModuleOptionsGeneratorUnknown;
5557
5606
 
5558
5607
  /**
5559
5608
  * Don't parse files matching. It's matched against the full resolved request.
@@ -5563,41 +5612,7 @@ declare interface ModuleOptions {
5563
5612
  /**
5564
5613
  * Specify options for each parser.
5565
5614
  */
5566
- parser?: {
5567
- [index: string]: { [index: string]: any };
5568
- /**
5569
- * Parser options for asset modules.
5570
- */
5571
- asset?: AssetParserOptions;
5572
- /**
5573
- * No parser options are supported for this module type.
5574
- */
5575
- "asset/inline"?: EmptyParserOptions;
5576
- /**
5577
- * No parser options are supported for this module type.
5578
- */
5579
- "asset/resource"?: EmptyParserOptions;
5580
- /**
5581
- * No parser options are supported for this module type.
5582
- */
5583
- "asset/source"?: EmptyParserOptions;
5584
- /**
5585
- * Parser options for javascript modules.
5586
- */
5587
- javascript?: JavascriptParserOptions;
5588
- /**
5589
- * Parser options for javascript modules.
5590
- */
5591
- "javascript/auto"?: JavascriptParserOptions;
5592
- /**
5593
- * Parser options for javascript modules.
5594
- */
5595
- "javascript/dynamic"?: JavascriptParserOptions;
5596
- /**
5597
- * Parser options for javascript modules.
5598
- */
5599
- "javascript/esm"?: JavascriptParserOptions;
5600
- };
5615
+ parser?: ModuleOptionsParserKnown & ModuleOptionsParserUnknown;
5601
5616
 
5602
5617
  /**
5603
5618
  * An array of rules applied for modules.
@@ -5654,6 +5669,105 @@ declare interface ModuleOptions {
5654
5669
  */
5655
5670
  wrappedContextRegExp?: RegExp;
5656
5671
  }
5672
+
5673
+ /**
5674
+ * Specify options for each generator.
5675
+ */
5676
+ declare interface ModuleOptionsGeneratorKnown {
5677
+ /**
5678
+ * Generator options for asset modules.
5679
+ */
5680
+ asset?: AssetGeneratorOptions;
5681
+
5682
+ /**
5683
+ * Generator options for asset/inline modules.
5684
+ */
5685
+ "asset/inline"?: AssetInlineGeneratorOptions;
5686
+
5687
+ /**
5688
+ * Generator options for asset/resource modules.
5689
+ */
5690
+ "asset/resource"?: AssetResourceGeneratorOptions;
5691
+
5692
+ /**
5693
+ * No generator options are supported for this module type.
5694
+ */
5695
+ javascript?: EmptyGeneratorOptions;
5696
+
5697
+ /**
5698
+ * No generator options are supported for this module type.
5699
+ */
5700
+ "javascript/auto"?: EmptyGeneratorOptions;
5701
+
5702
+ /**
5703
+ * No generator options are supported for this module type.
5704
+ */
5705
+ "javascript/dynamic"?: EmptyGeneratorOptions;
5706
+
5707
+ /**
5708
+ * No generator options are supported for this module type.
5709
+ */
5710
+ "javascript/esm"?: EmptyGeneratorOptions;
5711
+ }
5712
+
5713
+ /**
5714
+ * Specify options for each generator.
5715
+ */
5716
+ declare interface ModuleOptionsGeneratorUnknown {
5717
+ [index: string]: { [index: string]: any };
5718
+ }
5719
+
5720
+ /**
5721
+ * Specify options for each parser.
5722
+ */
5723
+ declare interface ModuleOptionsParserKnown {
5724
+ /**
5725
+ * Parser options for asset modules.
5726
+ */
5727
+ asset?: AssetParserOptions;
5728
+
5729
+ /**
5730
+ * No parser options are supported for this module type.
5731
+ */
5732
+ "asset/inline"?: EmptyParserOptions;
5733
+
5734
+ /**
5735
+ * No parser options are supported for this module type.
5736
+ */
5737
+ "asset/resource"?: EmptyParserOptions;
5738
+
5739
+ /**
5740
+ * No parser options are supported for this module type.
5741
+ */
5742
+ "asset/source"?: EmptyParserOptions;
5743
+
5744
+ /**
5745
+ * Parser options for javascript modules.
5746
+ */
5747
+ javascript?: JavascriptParserOptions;
5748
+
5749
+ /**
5750
+ * Parser options for javascript modules.
5751
+ */
5752
+ "javascript/auto"?: JavascriptParserOptions;
5753
+
5754
+ /**
5755
+ * Parser options for javascript modules.
5756
+ */
5757
+ "javascript/dynamic"?: JavascriptParserOptions;
5758
+
5759
+ /**
5760
+ * Parser options for javascript modules.
5761
+ */
5762
+ "javascript/esm"?: JavascriptParserOptions;
5763
+ }
5764
+
5765
+ /**
5766
+ * Specify options for each parser.
5767
+ */
5768
+ declare interface ModuleOptionsParserUnknown {
5769
+ [index: string]: { [index: string]: any };
5770
+ }
5657
5771
  declare interface ModulePathData {
5658
5772
  id: string | number;
5659
5773
  hash: string;
@@ -6786,11 +6900,11 @@ declare interface OutputFileSystem {
6786
6900
  mkdir: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
6787
6901
  stat: (
6788
6902
  arg0: string,
6789
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: FsStats) => void
6903
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
6790
6904
  ) => void;
6791
6905
  readFile: (
6792
6906
  arg0: string,
6793
- arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
6907
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
6794
6908
  ) => void;
6795
6909
  join?: (arg0: string, arg1: string) => string;
6796
6910
  relative?: (arg0: string, arg1: string) => string;
@@ -7030,7 +7144,7 @@ declare interface ParsedIdentifier {
7030
7144
  declare class Parser {
7031
7145
  constructor();
7032
7146
  parse(
7033
- source: string | Record<string, any> | Buffer,
7147
+ source: string | Buffer | PreparsedAst,
7034
7148
  state: ParserState
7035
7149
  ): ParserState;
7036
7150
  }
@@ -7082,8 +7196,11 @@ declare interface PerformanceOptions {
7082
7196
  */
7083
7197
  maxEntrypointSize?: number;
7084
7198
  }
7199
+ type Plugin =
7200
+ | { apply: (arg0: Resolver) => void }
7201
+ | ((this: Resolver, arg1: Resolver) => void);
7085
7202
  declare interface PnpApiImpl {
7086
- resolveToUnqualified: (arg0: string, arg1: string, arg2?: any) => string;
7203
+ resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
7087
7204
  }
7088
7205
  declare interface PossibleFileSystemError {
7089
7206
  code?: string;
@@ -7106,6 +7223,9 @@ declare class PrefixSource extends Source {
7106
7223
  original(): Source;
7107
7224
  getPrefix(): string;
7108
7225
  }
7226
+ declare interface PreparsedAst {
7227
+ [index: string]: any;
7228
+ }
7109
7229
  declare interface PrintedElement {
7110
7230
  element: string;
7111
7231
  content: string;
@@ -7228,8 +7348,8 @@ declare interface ProgressPluginOptions {
7228
7348
  profile?: null | boolean;
7229
7349
  }
7230
7350
  declare class ProvidePlugin {
7231
- constructor(definitions: Record<string, EntryItem>);
7232
- definitions: Record<string, EntryItem>;
7351
+ constructor(definitions: Record<string, string | string[]>);
7352
+ definitions: Record<string, string | string[]>;
7233
7353
 
7234
7354
  /**
7235
7355
  * Apply the plugin
@@ -7539,17 +7659,17 @@ declare interface ResolveBuildDependenciesResult {
7539
7659
  * Resolve context
7540
7660
  */
7541
7661
  declare interface ResolveContext {
7542
- contextDependencies?: { add: (T?: any) => void };
7662
+ contextDependencies?: WriteOnlySet<string>;
7543
7663
 
7544
7664
  /**
7545
7665
  * files that was found on file system
7546
7666
  */
7547
- fileDependencies?: { add: (T?: any) => void };
7667
+ fileDependencies?: WriteOnlySet<string>;
7548
7668
 
7549
7669
  /**
7550
7670
  * dependencies that was not found on file system
7551
7671
  */
7552
- missingDependencies?: { add: (T?: any) => void };
7672
+ missingDependencies?: WriteOnlySet<string>;
7553
7673
 
7554
7674
  /**
7555
7675
  * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
@@ -7578,35 +7698,9 @@ declare interface ResolveData {
7578
7698
  cacheable: boolean;
7579
7699
  }
7580
7700
  declare interface ResolveOptionsTypes {
7581
- alias: {
7582
- /**
7583
- * New request.
7584
- */
7585
- alias: Target;
7586
- /**
7587
- * Request to be redirected.
7588
- */
7589
- name: string;
7590
- /**
7591
- * Redirect only exact matching request.
7592
- */
7593
- onlyModule?: boolean;
7594
- }[];
7595
- fallback: {
7596
- /**
7597
- * New request.
7598
- */
7599
- alias: Target;
7600
- /**
7601
- * Request to be redirected.
7602
- */
7603
- name: string;
7604
- /**
7605
- * Redirect only exact matching request.
7606
- */
7607
- onlyModule?: boolean;
7608
- }[];
7609
- aliasFields: Set<EntryItem>;
7701
+ alias: AliasOption[];
7702
+ fallback: AliasOption[];
7703
+ aliasFields: Set<string | string[]>;
7610
7704
  cachePredicate: (arg0: ResolveRequest) => boolean;
7611
7705
  cacheWithContext: boolean;
7612
7706
 
@@ -7616,26 +7710,24 @@ declare interface ResolveOptionsTypes {
7616
7710
  conditionNames: Set<string>;
7617
7711
  descriptionFiles: string[];
7618
7712
  enforceExtension: boolean;
7619
- exportsFields: Set<EntryItem>;
7620
- importsFields: Set<EntryItem>;
7713
+ exportsFields: Set<string | string[]>;
7714
+ importsFields: Set<string | string[]>;
7621
7715
  extensions: Set<string>;
7622
7716
  fileSystem: FileSystem;
7623
- unsafeCache: any;
7717
+ unsafeCache: false | object;
7624
7718
  symlinks: boolean;
7625
7719
  resolver?: Resolver;
7626
- modules: EntryItem[];
7720
+ modules: (string | string[])[];
7627
7721
  mainFields: { name: string[]; forceRelative: boolean }[];
7628
7722
  mainFiles: Set<string>;
7629
- plugins: (
7630
- | { apply: (arg0: Resolver) => void }
7631
- | ((this: Resolver, arg1: Resolver) => void)
7632
- )[];
7723
+ plugins: Plugin[];
7633
7724
  pnpApi: null | PnpApiImpl;
7634
7725
  roots: Set<string>;
7635
7726
  fullySpecified: boolean;
7636
7727
  resolveToContext: boolean;
7637
7728
  restrictions: Set<string | RegExp>;
7638
7729
  preferRelative: boolean;
7730
+ preferAbsolute: boolean;
7639
7731
  }
7640
7732
 
7641
7733
  /**
@@ -7650,7 +7742,7 @@ declare interface ResolveOptionsWebpackOptions {
7650
7742
  /**
7651
7743
  * New request.
7652
7744
  */
7653
- alias: Target;
7745
+ alias: string | false | string[];
7654
7746
  /**
7655
7747
  * Request to be redirected.
7656
7748
  */
@@ -7660,12 +7752,12 @@ declare interface ResolveOptionsWebpackOptions {
7660
7752
  */
7661
7753
  onlyModule?: boolean;
7662
7754
  }[]
7663
- | { [index: string]: Target };
7755
+ | { [index: string]: string | false | string[] };
7664
7756
 
7665
7757
  /**
7666
7758
  * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
7667
7759
  */
7668
- aliasFields?: EntryItem[];
7760
+ aliasFields?: (string | string[])[];
7669
7761
 
7670
7762
  /**
7671
7763
  * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
@@ -7720,7 +7812,7 @@ declare interface ResolveOptionsWebpackOptions {
7720
7812
  /**
7721
7813
  * New request.
7722
7814
  */
7723
- alias: Target;
7815
+ alias: string | false | string[];
7724
7816
  /**
7725
7817
  * Request to be redirected.
7726
7818
  */
@@ -7730,7 +7822,7 @@ declare interface ResolveOptionsWebpackOptions {
7730
7822
  */
7731
7823
  onlyModule?: boolean;
7732
7824
  }[]
7733
- | { [index: string]: Target };
7825
+ | { [index: string]: string | false | string[] };
7734
7826
 
7735
7827
  /**
7736
7828
  * Filesystem for the resolver.
@@ -7750,7 +7842,7 @@ declare interface ResolveOptionsWebpackOptions {
7750
7842
  /**
7751
7843
  * Field names from the description file (package.json) which are used to find the default entry point.
7752
7844
  */
7753
- mainFields?: EntryItem[];
7845
+ mainFields?: (string | string[])[];
7754
7846
 
7755
7847
  /**
7756
7848
  * Filenames used to find the default entry point if there is no description file or main field.
@@ -7767,6 +7859,11 @@ declare interface ResolveOptionsWebpackOptions {
7767
7859
  */
7768
7860
  plugins?: ("..." | ResolvePluginInstance)[];
7769
7861
 
7862
+ /**
7863
+ * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
7864
+ */
7865
+ preferAbsolute?: boolean;
7866
+
7770
7867
  /**
7771
7868
  * Prefer to resolve module requests as relative request and fallback to resolving as module.
7772
7869
  */
@@ -7783,7 +7880,7 @@ declare interface ResolveOptionsWebpackOptions {
7783
7880
  restrictions?: (string | RegExp)[];
7784
7881
 
7785
7882
  /**
7786
- * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.
7883
+ * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
7787
7884
  */
7788
7885
  roots?: string[];
7789
7886
 
@@ -7861,9 +7958,9 @@ declare abstract class Resolver {
7861
7958
  [ResolveRequest, ResolveContext],
7862
7959
  null | ResolveRequest
7863
7960
  >;
7864
- resolveSync(context: any, path: string, request: string): DevTool;
7961
+ resolveSync(context: object, path: string, request: string): string | false;
7865
7962
  resolve(
7866
- context: any,
7963
+ context: object,
7867
7964
  path: string,
7868
7965
  request: string,
7869
7966
  resolveContext: ResolveContext,
@@ -7915,6 +8012,7 @@ declare interface ResourceDataWithData {
7915
8012
  fragment: string;
7916
8013
  data: Record<string, any>;
7917
8014
  }
8015
+ type Rule = string | RegExp;
7918
8016
  declare interface RuleSet {
7919
8017
  /**
7920
8018
  * map of references in the rule set (may grow over time)
@@ -7964,6 +8062,25 @@ type RuleSetConditionAbsolute =
7964
8062
  }
7965
8063
  | ((value: string) => boolean)
7966
8064
  | RuleSetConditionAbsolute[];
8065
+ type RuleSetConditionOrConditions =
8066
+ | string
8067
+ | RegExp
8068
+ | {
8069
+ /**
8070
+ * Logical AND.
8071
+ */
8072
+ and?: RuleSetCondition[];
8073
+ /**
8074
+ * Logical NOT.
8075
+ */
8076
+ not?: RuleSetCondition[];
8077
+ /**
8078
+ * Logical OR.
8079
+ */
8080
+ or?: RuleSetCondition[];
8081
+ }
8082
+ | ((value: string) => boolean)
8083
+ | RuleSetCondition[];
7967
8084
 
7968
8085
  /**
7969
8086
  * A rule description with conditions and effects for modules.
@@ -8018,7 +8135,7 @@ declare interface RuleSetRule {
8018
8135
  /**
8019
8136
  * Match values of properties in the description file (usually package.json).
8020
8137
  */
8021
- descriptionData?: { [index: string]: RuleSetCondition };
8138
+ descriptionData?: { [index: string]: RuleSetConditionOrConditions };
8022
8139
 
8023
8140
  /**
8024
8141
  * Enforce this rule as pre or post step.
@@ -8739,7 +8856,7 @@ declare abstract class RuntimeTemplate {
8739
8856
  /**
8740
8857
  * the export name
8741
8858
  */
8742
- exportName: EntryItem;
8859
+ exportName: string | string[];
8743
8860
  /**
8744
8861
  * the origin module
8745
8862
  */
@@ -9128,10 +9245,10 @@ declare interface SourceLike {
9128
9245
  }
9129
9246
  declare class SourceMapDevToolPlugin {
9130
9247
  constructor(options?: SourceMapDevToolPluginOptions);
9131
- sourceMapFilename: DevTool;
9132
- sourceMappingURLComment: DevTool;
9133
- moduleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate;
9134
- fallbackModuleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate;
9248
+ sourceMapFilename: string | false;
9249
+ sourceMappingURLComment: string | false;
9250
+ moduleFilenameTemplate: string | Function;
9251
+ fallbackModuleFilenameTemplate: string | Function;
9135
9252
  namespace: string;
9136
9253
  options: SourceMapDevToolPluginOptions;
9137
9254
 
@@ -9154,7 +9271,7 @@ declare interface SourceMapDevToolPluginOptions {
9154
9271
  /**
9155
9272
  * Exclude modules that match the given value from source map generation.
9156
9273
  */
9157
- exclude?: string | RegExp | (string | RegExp)[];
9274
+ exclude?: string | RegExp | Rule[];
9158
9275
 
9159
9276
  /**
9160
9277
  * 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.
@@ -9174,7 +9291,7 @@ declare interface SourceMapDevToolPluginOptions {
9174
9291
  /**
9175
9292
  * Include source maps for module paths that match the given value.
9176
9293
  */
9177
- include?: string | RegExp | (string | RegExp)[];
9294
+ include?: string | RegExp | Rule[];
9178
9295
 
9179
9296
  /**
9180
9297
  * Indicates whether SourceMaps from loaders should be used (defaults to true).
@@ -9209,7 +9326,7 @@ declare interface SourceMapDevToolPluginOptions {
9209
9326
  /**
9210
9327
  * Include source maps for modules based on their extension (defaults to .js and .css).
9211
9328
  */
9212
- test?: string | RegExp | (string | RegExp)[];
9329
+ test?: string | RegExp | Rule[];
9213
9330
  }
9214
9331
  declare class SourceMapSource extends Source {
9215
9332
  constructor(
@@ -9236,11 +9353,11 @@ declare interface SourcePosition {
9236
9353
  declare interface SplitChunksOptions {
9237
9354
  chunksFilter: (chunk: Chunk) => boolean;
9238
9355
  defaultSizeTypes: string[];
9239
- minSize: Record<string, number>;
9240
- minRemainingSize: Record<string, number>;
9241
- enforceSizeThreshold: Record<string, number>;
9242
- maxInitialSize: Record<string, number>;
9243
- maxAsyncSize: Record<string, number>;
9356
+ minSize: SplitChunksSizes;
9357
+ minRemainingSize: SplitChunksSizes;
9358
+ enforceSizeThreshold: SplitChunksSizes;
9359
+ maxInitialSize: SplitChunksSizes;
9360
+ maxAsyncSize: SplitChunksSizes;
9244
9361
  minChunks: number;
9245
9362
  maxAsyncRequests: number;
9246
9363
  maxInitialRequests: number;
@@ -9268,6 +9385,9 @@ declare class SplitChunksPlugin {
9268
9385
  */
9269
9386
  apply(compiler: Compiler): void;
9270
9387
  }
9388
+ declare interface SplitChunksSizes {
9389
+ [index: string]: number;
9390
+ }
9271
9391
  declare abstract class StackedMap<K, V> {
9272
9392
  map: Map<K, InternalCell<V>>;
9273
9393
  stack: Map<K, InternalCell<V>>[];
@@ -9331,7 +9451,7 @@ declare abstract class StatsFactory {
9331
9451
  SyncBailHook<[any, StatsFactoryContext, number, number], any>
9332
9452
  >;
9333
9453
  groupResults: HookMap<
9334
- SyncBailHook<[GroupConfig<any, object>[], StatsFactoryContext], any>
9454
+ SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
9335
9455
  >;
9336
9456
  sortResults: HookMap<
9337
9457
  SyncBailHook<
@@ -9350,7 +9470,7 @@ declare abstract class StatsFactory {
9350
9470
  create(
9351
9471
  type: string,
9352
9472
  data: any,
9353
- baseContext: Pick<StatsFactoryContext, string>
9473
+ baseContext: Omit<StatsFactoryContext, "type">
9354
9474
  ): any;
9355
9475
  }
9356
9476
  type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
@@ -9801,7 +9921,6 @@ declare interface TagInfo {
9801
9921
  data: any;
9802
9922
  next?: TagInfo;
9803
9923
  }
9804
- type Target = string | false | string[];
9805
9924
  declare class Template {
9806
9925
  constructor();
9807
9926
  static getFunctionContent(fn: Function): string;
@@ -9811,9 +9930,9 @@ declare class Template {
9811
9930
  static toPath(str: string): string;
9812
9931
  static numberToIdentifier(n: number): string;
9813
9932
  static numberToIdentifierContinuation(n: number): string;
9814
- static indent(s: EntryItem): string;
9815
- static prefix(s: EntryItem, prefix: string): string;
9816
- static asString(str: EntryItem): string;
9933
+ static indent(s: string | string[]): string;
9934
+ static prefix(s: string | string[], prefix: string): string;
9935
+ static asString(str: string | string[]): string;
9817
9936
  static getModulesArrayBounds(modules: WithId[]): false | [number, number];
9818
9937
  static renderChunkModules(
9819
9938
  renderContext: RenderContextModuleTemplate,
@@ -9857,47 +9976,17 @@ declare interface UserResolveOptions {
9857
9976
  /**
9858
9977
  * A list of module alias configurations or an object which maps key to value
9859
9978
  */
9860
- alias?:
9861
- | { [index: string]: Target }
9862
- | {
9863
- /**
9864
- * New request.
9865
- */
9866
- alias: Target;
9867
- /**
9868
- * Request to be redirected.
9869
- */
9870
- name: string;
9871
- /**
9872
- * Redirect only exact matching request.
9873
- */
9874
- onlyModule?: boolean;
9875
- }[];
9979
+ alias?: AliasOption[] | AliasOptions;
9876
9980
 
9877
9981
  /**
9878
9982
  * A list of module alias configurations or an object which maps key to value, applied only after modules option
9879
9983
  */
9880
- fallback?:
9881
- | { [index: string]: Target }
9882
- | {
9883
- /**
9884
- * New request.
9885
- */
9886
- alias: Target;
9887
- /**
9888
- * Request to be redirected.
9889
- */
9890
- name: string;
9891
- /**
9892
- * Redirect only exact matching request.
9893
- */
9894
- onlyModule?: boolean;
9895
- }[];
9984
+ fallback?: AliasOption[] | AliasOptions;
9896
9985
 
9897
9986
  /**
9898
9987
  * A list of alias fields in description files
9899
9988
  */
9900
- aliasFields?: EntryItem[];
9989
+ aliasFields?: (string | string[])[];
9901
9990
 
9902
9991
  /**
9903
9992
  * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
@@ -9927,12 +10016,12 @@ declare interface UserResolveOptions {
9927
10016
  /**
9928
10017
  * A list of exports fields in description files
9929
10018
  */
9930
- exportsFields?: EntryItem[];
10019
+ exportsFields?: (string | string[])[];
9931
10020
 
9932
10021
  /**
9933
10022
  * A list of imports fields in description files
9934
10023
  */
9935
- importsFields?: EntryItem[];
10024
+ importsFields?: (string | string[])[];
9936
10025
 
9937
10026
  /**
9938
10027
  * A list of extensions which should be tried for files
@@ -9947,7 +10036,7 @@ declare interface UserResolveOptions {
9947
10036
  /**
9948
10037
  * Use this cache object to unsafely cache the successful requests
9949
10038
  */
9950
- unsafeCache?: any;
10039
+ unsafeCache?: boolean | object;
9951
10040
 
9952
10041
  /**
9953
10042
  * Resolve symlinks to their symlinked location
@@ -9970,7 +10059,7 @@ declare interface UserResolveOptions {
9970
10059
  mainFields?: (
9971
10060
  | string
9972
10061
  | string[]
9973
- | { name: EntryItem; forceRelative: boolean }
10062
+ | { name: string | string[]; forceRelative: boolean }
9974
10063
  )[];
9975
10064
 
9976
10065
  /**
@@ -9981,10 +10070,7 @@ declare interface UserResolveOptions {
9981
10070
  /**
9982
10071
  * A list of additional resolve plugins which should be applied
9983
10072
  */
9984
- plugins?: (
9985
- | { apply: (arg0: Resolver) => void }
9986
- | ((this: Resolver, arg1: Resolver) => void)
9987
- )[];
10073
+ plugins?: Plugin[];
9988
10074
 
9989
10075
  /**
9990
10076
  * A PnP API that should be used - null is "never", undefined is "auto"
@@ -10020,6 +10106,11 @@ declare interface UserResolveOptions {
10020
10106
  * Prefer to resolve module requests as relative requests before falling back to modules
10021
10107
  */
10022
10108
  preferRelative?: boolean;
10109
+
10110
+ /**
10111
+ * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
10112
+ */
10113
+ preferAbsolute?: boolean;
10023
10114
  }
10024
10115
  declare abstract class VariableInfo {
10025
10116
  declaredScope: ScopeInfo;
@@ -10040,8 +10131,8 @@ declare interface WatchFileSystem {
10040
10131
  options: WatchOptions,
10041
10132
  callback: (
10042
10133
  arg0: undefined | Error,
10043
- arg1: Map<string, FileSystemInfoEntry>,
10044
- arg2: Map<string, FileSystemInfoEntry>,
10134
+ arg1: Map<string, FileSystemInfoEntry | "ignore">,
10135
+ arg2: Map<string, FileSystemInfoEntry | "ignore">,
10045
10136
  arg3: Set<string>,
10046
10137
  arg4: Set<string>
10047
10138
  ) => void,
@@ -10107,12 +10198,12 @@ declare interface Watcher {
10107
10198
  /**
10108
10199
  * get info about files
10109
10200
  */
10110
- getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry>;
10201
+ getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
10111
10202
 
10112
10203
  /**
10113
10204
  * get info about directories
10114
10205
  */
10115
- getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry>;
10206
+ getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
10116
10207
  }
10117
10208
  declare abstract class Watching {
10118
10209
  startTime: null | number;
@@ -10448,6 +10539,9 @@ declare interface WithOptions {
10448
10539
  arg0: Partial<ResolveOptionsWithDependencyType>
10449
10540
  ) => ResolverWithOptions;
10450
10541
  }
10542
+ declare interface WriteOnlySet<T> {
10543
+ add: (T?: any) => void;
10544
+ }
10451
10545
  type __TypeWebpackOptions = (
10452
10546
  data: object
10453
10547
  ) =>
@@ -10712,7 +10806,7 @@ declare namespace exports {
10712
10806
  export { ProfilingPlugin };
10713
10807
  }
10714
10808
  export namespace util {
10715
- export const createHash: (algorithm: HashFunction) => Hash;
10809
+ export const createHash: (algorithm: string | typeof Hash) => Hash;
10716
10810
  export namespace comparators {
10717
10811
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
10718
10812
  export let compareModulesByIdentifier: (