webpack 5.10.3 → 5.11.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
@@ -78,7 +78,12 @@ import {
78
78
  YieldExpression
79
79
  } from "estree";
80
80
  import { Stats as FsStats, WriteStream } from "fs";
81
+ import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
81
82
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
83
+ import {
84
+ Extend,
85
+ ValidationErrorConfiguration
86
+ } from "schema-utils/declarations/validate";
82
87
  import {
83
88
  AsArray,
84
89
  AsyncParallelHook,
@@ -171,7 +176,6 @@ declare interface AggressiveSplittingPluginOptions {
171
176
  */
172
177
  minSize?: number;
173
178
  }
174
- type Amd = false | { [index: string]: any };
175
179
  declare interface Argument {
176
180
  description: string;
177
181
  simpleType: "string" | "number" | "boolean";
@@ -208,70 +212,7 @@ declare interface AssetEmittedInfo {
208
212
  outputPath: string;
209
213
  targetPath: string;
210
214
  }
211
- declare interface AssetInfo {
212
- /**
213
- * true, if the asset can be long term cached forever (contains a hash)
214
- */
215
- immutable?: boolean;
216
-
217
- /**
218
- * whether the asset is minimized
219
- */
220
- minimized?: boolean;
221
-
222
- /**
223
- * the value(s) of the full hash used for this asset
224
- */
225
- fullhash?: EntryItem;
226
-
227
- /**
228
- * the value(s) of the chunk hash used for this asset
229
- */
230
- chunkhash?: EntryItem;
231
-
232
- /**
233
- * the value(s) of the module hash used for this asset
234
- */
235
- modulehash?: EntryItem;
236
-
237
- /**
238
- * the value(s) of the content hash used for this asset
239
- */
240
- contenthash?: EntryItem;
241
-
242
- /**
243
- * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
244
- */
245
- sourceFilename?: string;
246
-
247
- /**
248
- * size in bytes, only set after asset has been emitted
249
- */
250
- size?: number;
251
-
252
- /**
253
- * true, when asset is only used for development and doesn't count towards user-facing assets
254
- */
255
- development?: boolean;
256
-
257
- /**
258
- * true, when asset ships data for updating an existing application (HMR)
259
- */
260
- hotModuleReplacement?: boolean;
261
-
262
- /**
263
- * true, when asset is javascript and an ESM
264
- */
265
- javascriptModule?: boolean;
266
-
267
- /**
268
- * object of pointers to other assets, keyed by type of relation (only points from parent to child)
269
- */
270
- related?: Record<string, EntryItem>;
271
- }
272
- type AssetModuleFilename =
273
- | string
274
- | ((pathData: PathData, assetInfo?: AssetInfo) => string);
215
+ type AssetInfo = KnownAssetInfo & Record<string, any>;
275
216
  declare abstract class AsyncDependenciesBlock extends DependenciesBlock {
276
217
  groupOptions: {
277
218
  preloadOrder?: number;
@@ -279,8 +220,8 @@ declare abstract class AsyncDependenciesBlock extends DependenciesBlock {
279
220
  name?: string;
280
221
  entryOptions?: EntryOptions;
281
222
  };
282
- loc: DependencyLocation;
283
- request: string;
223
+ loc?: SyntheticDependencyLocation | RealDependencyLocation;
224
+ request?: string;
284
225
  parent: DependenciesBlock;
285
226
  chunkName: string;
286
227
  module: any;
@@ -354,12 +295,12 @@ declare interface BannerPluginOptions {
354
295
  /**
355
296
  * Exclude all modules matching any of these conditions.
356
297
  */
357
- exclude?: Rules;
298
+ exclude?: string | RegExp | (string | RegExp)[];
358
299
 
359
300
  /**
360
301
  * Include all modules matching any of these conditions.
361
302
  */
362
- include?: Rules;
303
+ include?: string | RegExp | (string | RegExp)[];
363
304
 
364
305
  /**
365
306
  * If true, banner will not be wrapped in a comment.
@@ -369,7 +310,7 @@ declare interface BannerPluginOptions {
369
310
  /**
370
311
  * Include all modules that pass test assertion.
371
312
  */
372
- test?: Rules;
313
+ test?: string | RegExp | (string | RegExp)[];
373
314
  }
374
315
  declare interface BaseResolveRequest {
375
316
  path: DevTool;
@@ -385,22 +326,22 @@ declare abstract class BasicEvaluatedExpression {
385
326
  range: [number, number];
386
327
  falsy: boolean;
387
328
  truthy: boolean;
388
- nullish: boolean;
329
+ nullish?: boolean;
389
330
  sideEffects: boolean;
390
- bool: boolean;
391
- number: number;
392
- bigint: bigint;
393
- regExp: RegExp;
394
- string: string;
395
- quasis: BasicEvaluatedExpression[];
396
- parts: BasicEvaluatedExpression[];
397
- array: any[];
398
- items: BasicEvaluatedExpression[];
399
- options: BasicEvaluatedExpression[];
400
- prefix: BasicEvaluatedExpression;
401
- postfix: BasicEvaluatedExpression;
331
+ bool?: boolean;
332
+ number?: number;
333
+ bigint?: bigint;
334
+ regExp?: RegExp;
335
+ string?: string;
336
+ quasis?: BasicEvaluatedExpression[];
337
+ parts?: BasicEvaluatedExpression[];
338
+ array?: any[];
339
+ items?: BasicEvaluatedExpression[];
340
+ options?: BasicEvaluatedExpression[];
341
+ prefix?: BasicEvaluatedExpression;
342
+ postfix?: BasicEvaluatedExpression;
402
343
  wrappedInnerExpressions: any;
403
- identifier: string;
344
+ identifier?: string;
404
345
  rootInfo: VariableInfoInterface;
405
346
  getMembers: () => string[];
406
347
  expression: NodeEstreeIndex;
@@ -422,7 +363,7 @@ declare abstract class BasicEvaluatedExpression {
422
363
  /**
423
364
  * Is expression a primitive or an object type value?
424
365
  */
425
- isPrimitiveType(): boolean;
366
+ isPrimitiveType(): undefined | boolean;
426
367
 
427
368
  /**
428
369
  * Is expression a runtime or compile-time value?
@@ -435,14 +376,14 @@ declare abstract class BasicEvaluatedExpression {
435
376
  asCompileTimeValue(): any;
436
377
  isTruthy(): boolean;
437
378
  isFalsy(): boolean;
438
- isNullish(): boolean;
379
+ isNullish(): undefined | boolean;
439
380
 
440
381
  /**
441
382
  * Can this expression have side effects?
442
383
  */
443
384
  couldHaveSideEffects(): boolean;
444
385
  asBool(): any;
445
- asNullish(): boolean;
386
+ asNullish(): undefined | boolean;
446
387
  asString(): any;
447
388
  setString(string?: any): BasicEvaluatedExpression;
448
389
  setUndefined(): BasicEvaluatedExpression;
@@ -489,21 +430,25 @@ declare class Cache {
489
430
  get: AsyncSeriesBailHook<
490
431
  [
491
432
  string,
492
- Etag,
493
- ((result: any, callback: (arg0: Error) => void) => void)[]
433
+ null | Etag,
434
+ ((result: any, callback: (arg0?: Error) => void) => void)[]
494
435
  ],
495
436
  any
496
437
  >;
497
- store: AsyncParallelHook<[string, Etag, any]>;
438
+ store: AsyncParallelHook<[string, null | Etag, any]>;
498
439
  storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
499
440
  beginIdle: SyncHook<[]>;
500
441
  endIdle: AsyncParallelHook<[]>;
501
442
  shutdown: AsyncParallelHook<[]>;
502
443
  };
503
- get<T>(identifier: string, etag: Etag, callback: CallbackCache<T>): void;
444
+ get<T>(
445
+ identifier: string,
446
+ etag: null | Etag,
447
+ callback: CallbackCache<T>
448
+ ): void;
504
449
  store<T>(
505
450
  identifier: string,
506
- etag: Etag,
451
+ etag: null | Etag,
507
452
  data: T,
508
453
  callback: CallbackCache<void>
509
454
  ): void;
@@ -525,34 +470,46 @@ declare class Cache {
525
470
  }
526
471
  declare abstract class CacheFacade {
527
472
  getChildCache(name: string): CacheFacade;
528
- getItemCache(identifier: string, etag: Etag): ItemCacheFacade;
473
+ getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
529
474
  getLazyHashedEtag(obj: HashableObject): Etag;
530
475
  mergeEtags(a: Etag, b: Etag): Etag;
531
- get<T>(identifier: string, etag: Etag, callback: CallbackCache<T>): void;
532
- getPromise<T>(identifier: string, etag: Etag): Promise<T>;
476
+ get<T>(
477
+ identifier: string,
478
+ etag: null | Etag,
479
+ callback: CallbackCache<T>
480
+ ): void;
481
+ getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
533
482
  store<T>(
534
483
  identifier: string,
535
- etag: Etag,
484
+ etag: null | Etag,
536
485
  data: T,
537
486
  callback: CallbackCache<void>
538
487
  ): void;
539
- storePromise<T>(identifier: string, etag: Etag, data: T): Promise<void>;
488
+ storePromise<T>(
489
+ identifier: string,
490
+ etag: null | Etag,
491
+ data: T
492
+ ): Promise<void>;
540
493
  provide<T>(
541
494
  identifier: string,
542
- etag: Etag,
495
+ etag: null | Etag,
543
496
  computer: (arg0: CallbackNormalErrorCache<T>) => void,
544
497
  callback: CallbackNormalErrorCache<T>
545
498
  ): void;
546
499
  providePromise<T>(
547
500
  identifier: string,
548
- etag: Etag,
501
+ etag: null | Etag,
549
502
  computer: () => T | Promise<T>
550
503
  ): Promise<T>;
551
504
  }
552
505
  declare interface CacheGroupSource {
553
506
  key?: string;
554
507
  priority?: number;
555
- getName?: (module?: Module, chunks?: Chunk[], key?: string) => string;
508
+ getName?: (
509
+ module?: Module,
510
+ chunks?: Chunk[],
511
+ key?: string
512
+ ) => undefined | string;
556
513
  chunksFilter?: (chunk: Chunk) => boolean;
557
514
  enforce?: boolean;
558
515
  minSize: Record<string, number>;
@@ -563,7 +520,7 @@ declare interface CacheGroupSource {
563
520
  minChunks?: number;
564
521
  maxAsyncRequests?: number;
565
522
  maxInitialRequests?: number;
566
- filename?: string | ((arg0: PathData, arg1: AssetInfo) => string);
523
+ filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
567
524
  idHint?: string;
568
525
  automaticNameDelimiter: string;
569
526
  reuseExistingChunk?: boolean;
@@ -573,7 +530,6 @@ declare interface CacheGroupsContext {
573
530
  moduleGraph: ModuleGraph;
574
531
  chunkGraph: ChunkGraph;
575
532
  }
576
- type CacheOptions = boolean | MemoryCacheOptions | FileCacheOptions;
577
533
  type CacheOptionsNormalized = false | MemoryCacheOptions | FileCacheOptions;
578
534
  declare class CachedSource extends Source {
579
535
  constructor(source: Source);
@@ -604,25 +560,29 @@ declare interface CallbackNormalErrorCache<T> {
604
560
  declare interface CallbackWebpack<T> {
605
561
  (err?: Error, stats?: T): void;
606
562
  }
563
+ type Cell<T> = undefined | T;
607
564
  declare class Chunk {
608
565
  constructor(name?: string);
609
- id: string | number;
610
- ids: (string | number)[];
566
+ id: null | string | number;
567
+ ids: null | (string | number)[];
611
568
  debugId: number;
612
569
  name: string;
613
570
  idNameHints: SortableSet<string>;
614
571
  preventIntegration: boolean;
615
- filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo) => string);
572
+ filenameTemplate:
573
+ | null
574
+ | string
575
+ | ((arg0: PathData, arg1?: AssetInfo) => string);
616
576
  runtime: RuntimeSpec;
617
577
  files: Set<string>;
618
578
  auxiliaryFiles: Set<string>;
619
579
  rendered: boolean;
620
- hash: string;
580
+ hash?: string;
621
581
  contentHash: Record<string, string>;
622
- renderedHash: string;
623
- chunkReason: string;
582
+ renderedHash?: string;
583
+ chunkReason?: string;
624
584
  extraAsync: boolean;
625
- readonly entryModule: Module;
585
+ readonly entryModule?: Module;
626
586
  hasEntryModule(): boolean;
627
587
  addModule(module: Module): boolean;
628
588
  removeModule(module: Module): void;
@@ -648,7 +608,7 @@ declare class Chunk {
648
608
  hasRuntime(): boolean;
649
609
  canBeInitial(): boolean;
650
610
  isOnlyInitial(): boolean;
651
- getEntryOptions(): EntryOptions;
611
+ getEntryOptions(): undefined | EntryOptions;
652
612
  addGroup(chunkGroup: ChunkGroup): void;
653
613
  removeGroup(chunkGroup: ChunkGroup): void;
654
614
  isInGroup(chunkGroup: ChunkGroup): boolean;
@@ -672,9 +632,6 @@ declare class Chunk {
672
632
  filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
673
633
  ): Record<string | number, Record<string, (string | number)[]>>;
674
634
  }
675
- type ChunkFilename =
676
- | string
677
- | ((pathData: PathData, assetInfo?: AssetInfo) => string);
678
635
  declare class ChunkGraph {
679
636
  constructor(moduleGraph: ModuleGraph);
680
637
  moduleGraph: ModuleGraph;
@@ -701,7 +658,7 @@ declare class ChunkGraph {
701
658
  getChunkModulesIterableBySourceType(
702
659
  chunk: Chunk,
703
660
  sourceType: string
704
- ): Iterable<Module>;
661
+ ): undefined | Iterable<Module>;
705
662
  getOrderedChunkModulesIterable(
706
663
  chunk: Chunk,
707
664
  comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
@@ -710,7 +667,7 @@ declare class ChunkGraph {
710
667
  chunk: Chunk,
711
668
  sourceType: string,
712
669
  comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
713
- ): Iterable<Module>;
670
+ ): undefined | Iterable<Module>;
714
671
  getChunkModules(chunk: Chunk): Module[];
715
672
  getOrderedChunkModules(
716
673
  chunk: Chunk,
@@ -767,10 +724,12 @@ declare class ChunkGraph {
767
724
  hasChunkEntryDependentChunks(chunk: Chunk): boolean;
768
725
  getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
769
726
  getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
770
- getChunkFullHashModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
727
+ getChunkFullHashModulesIterable(
728
+ chunk: Chunk
729
+ ): undefined | Iterable<RuntimeModule>;
771
730
  getChunkEntryModulesWithChunkGroupIterable(
772
731
  chunk: Chunk
773
- ): Iterable<[Module, Entrypoint]>;
732
+ ): Iterable<[Module, undefined | Entrypoint]>;
774
733
  getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup;
775
734
  connectBlockAndChunkGroup(
776
735
  depBlock: AsyncDependenciesBlock,
@@ -832,7 +791,7 @@ declare abstract class ChunkGroup {
832
791
  * returns the name of current ChunkGroup
833
792
  * sets a new name for current ChunkGroup
834
793
  */
835
- name: string;
794
+ name?: string;
836
795
 
837
796
  /**
838
797
  * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
@@ -1171,19 +1130,19 @@ declare class Compilation {
1171
1130
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
1172
1131
  moduleAsset: SyncHook<[Module, string]>;
1173
1132
  chunkAsset: SyncHook<[Chunk, string]>;
1174
- assetPath: SyncWaterfallHook<[string, any, AssetInfo]>;
1133
+ assetPath: SyncWaterfallHook<[string, {}, AssetInfo]>;
1175
1134
  needAdditionalPass: SyncBailHook<[], boolean>;
1176
1135
  childCompiler: SyncHook<[Compiler, string, number]>;
1177
1136
  log: SyncBailHook<[string, LogEntry], true>;
1178
1137
  processWarnings: SyncWaterfallHook<[WebpackError[]]>;
1179
1138
  processErrors: SyncWaterfallHook<[WebpackError[]]>;
1180
- statsPreset: HookMap<SyncHook<[any, any]>>;
1181
- statsNormalize: SyncHook<[any, any]>;
1182
- statsFactory: SyncHook<[StatsFactory, any]>;
1183
- statsPrinter: SyncHook<[StatsPrinter, any]>;
1184
- readonly normalModuleLoader: SyncHook<[any, NormalModule]>;
1139
+ statsPreset: HookMap<SyncHook<[Object, Object]>>;
1140
+ statsNormalize: SyncHook<[Object, Object]>;
1141
+ statsFactory: SyncHook<[StatsFactory, Object]>;
1142
+ statsPrinter: SyncHook<[StatsPrinter, Object]>;
1143
+ readonly normalModuleLoader: SyncHook<[{}, NormalModule]>;
1185
1144
  }>;
1186
- name: string;
1145
+ name?: string;
1187
1146
  startTime: any;
1188
1147
  endTime: any;
1189
1148
  compiler: Compiler;
@@ -1202,7 +1161,7 @@ declare class Compilation {
1202
1161
  runtimeTemplate: RuntimeTemplate;
1203
1162
  moduleTemplates: { javascript: ModuleTemplate };
1204
1163
  moduleGraph: ModuleGraph;
1205
- chunkGraph: ChunkGraph;
1164
+ chunkGraph?: ChunkGraph;
1206
1165
  codeGenerationResults: CodeGenerationResults;
1207
1166
  factorizeQueue: AsyncQueue<FactorizeModuleOptions, string, Module>;
1208
1167
  addModuleQueue: AsyncQueue<Module, string, Module>;
@@ -1267,7 +1226,7 @@ declare class Compilation {
1267
1226
  /**
1268
1227
  * Attempts to search for a module by its identifier
1269
1228
  */
1270
- findModule(identifier: string): Module;
1229
+ findModule(identifier: string): undefined | Module;
1271
1230
 
1272
1231
  /**
1273
1232
  * Schedules a build of the module object
@@ -1354,36 +1313,36 @@ declare class Compilation {
1354
1313
  summarizeDependencies(): void;
1355
1314
  createModuleHashes(): void;
1356
1315
  createHash(): void;
1357
- fullHash: string;
1358
- hash: string;
1316
+ fullHash?: string;
1317
+ hash?: string;
1359
1318
  emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
1360
1319
  updateAsset(
1361
1320
  file: string,
1362
1321
  newSourceOrFunction: Source | ((arg0: Source) => Source),
1363
- assetInfoUpdateOrFunction?: AssetInfo | ((arg0: AssetInfo) => AssetInfo)
1322
+ assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
1364
1323
  ): void;
1365
1324
  renameAsset(file?: any, newFile?: any): void;
1366
1325
  deleteAsset(file: string): void;
1367
1326
  getAssets(): Readonly<Asset>[];
1368
- getAsset(name: string): Readonly<Asset>;
1327
+ getAsset(name: string): undefined | Readonly<Asset>;
1369
1328
  clearAssets(): void;
1370
1329
  createModuleAssets(): void;
1371
1330
  getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
1372
1331
  createChunkAssets(callback: (err?: WebpackError) => void): void;
1373
1332
  getPath(
1374
- filename: string | ((arg0: PathData, arg1: AssetInfo) => string),
1333
+ filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
1375
1334
  data?: PathData
1376
1335
  ): string;
1377
1336
  getPathWithInfo(
1378
- filename: string | ((arg0: PathData, arg1: AssetInfo) => string),
1337
+ filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
1379
1338
  data?: PathData
1380
1339
  ): { path: string; info: AssetInfo };
1381
1340
  getAssetPath(
1382
- filename: string | ((arg0: PathData, arg1: AssetInfo) => string),
1341
+ filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
1383
1342
  data: PathData
1384
1343
  ): string;
1385
1344
  getAssetPathWithInfo(
1386
- filename: string | ((arg0: PathData, arg1: AssetInfo) => string),
1345
+ filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
1387
1346
  data: PathData
1388
1347
  ): { path: string; info: AssetInfo };
1389
1348
  getWarnings(): WebpackError[];
@@ -1532,7 +1491,7 @@ declare class Compiler {
1532
1491
  afterCompile: AsyncSeriesHook<[Compilation]>;
1533
1492
  watchRun: AsyncSeriesHook<[Compiler]>;
1534
1493
  failed: SyncHook<[Error]>;
1535
- invalid: SyncHook<[string, number]>;
1494
+ invalid: SyncHook<[null | string, number]>;
1536
1495
  watchClose: SyncHook<[]>;
1537
1496
  infrastructureLog: SyncBailHook<[string, string, any[]], true>;
1538
1497
  environment: SyncHook<[]>;
@@ -1542,8 +1501,8 @@ declare class Compiler {
1542
1501
  entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
1543
1502
  }>;
1544
1503
  webpack: typeof exports;
1545
- name: string;
1546
- parentCompilation: Compilation;
1504
+ name?: string;
1505
+ parentCompilation?: Compilation;
1547
1506
  root: Compiler;
1548
1507
  outputPath: string;
1549
1508
  watching: Watching;
@@ -1551,15 +1510,15 @@ declare class Compiler {
1551
1510
  intermediateFileSystem: IntermediateFileSystem;
1552
1511
  inputFileSystem: InputFileSystem;
1553
1512
  watchFileSystem: WatchFileSystem;
1554
- recordsInputPath: string;
1555
- recordsOutputPath: string;
1513
+ recordsInputPath: null | string;
1514
+ recordsOutputPath: null | string;
1556
1515
  records: {};
1557
1516
  managedPaths: Set<string>;
1558
1517
  immutablePaths: Set<string>;
1559
1518
  modifiedFiles: Set<string>;
1560
1519
  removedFiles: Set<string>;
1561
- fileTimestamps: Map<string, FileSystemInfoEntry>;
1562
- contextTimestamps: Map<string, FileSystemInfoEntry>;
1520
+ fileTimestamps: Map<string, null | FileSystemInfoEntry>;
1521
+ contextTimestamps: Map<string, null | FileSystemInfoEntry>;
1563
1522
  resolverFactory: ResolverFactory;
1564
1523
  infrastructureLogger: any;
1565
1524
  options: WebpackOptionsNormalized;
@@ -1664,7 +1623,7 @@ declare class ConcatenationScope {
1664
1623
  /**
1665
1624
  * if the position is ASI safe or unknown
1666
1625
  */
1667
- asiSafe: boolean;
1626
+ asiSafe?: boolean;
1668
1627
  index: number;
1669
1628
  };
1670
1629
  static DEFAULT_EXPORT: string;
@@ -1678,7 +1637,7 @@ declare interface Configuration {
1678
1637
  /**
1679
1638
  * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
1680
1639
  */
1681
- amd?: Amd;
1640
+ amd?: false | { [index: string]: any };
1682
1641
 
1683
1642
  /**
1684
1643
  * Report the first error as a hard error instead of tolerating it.
@@ -1688,7 +1647,7 @@ declare interface Configuration {
1688
1647
  /**
1689
1648
  * Cache generated modules and chunks to improve performance for multiple incremental builds.
1690
1649
  */
1691
- cache?: CacheOptions;
1650
+ cache?: boolean | MemoryCacheOptions | FileCacheOptions;
1692
1651
 
1693
1652
  /**
1694
1653
  * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
@@ -1703,12 +1662,16 @@ declare interface Configuration {
1703
1662
  /**
1704
1663
  * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
1705
1664
  */
1706
- devtool?: DevTool;
1665
+ devtool?: string | false;
1707
1666
 
1708
1667
  /**
1709
1668
  * The entry point(s) of the compilation.
1710
1669
  */
1711
- entry?: Entry;
1670
+ entry?:
1671
+ | string
1672
+ | (() => string | EntryObject | string[] | Promise<EntryStatic>)
1673
+ | EntryObject
1674
+ | string[];
1712
1675
 
1713
1676
  /**
1714
1677
  * Enables/Disables experiments (experimental features with relax SemVer compatibility).
@@ -1718,7 +1681,17 @@ declare interface Configuration {
1718
1681
  /**
1719
1682
  * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
1720
1683
  */
1721
- externals?: Externals;
1684
+ externals?:
1685
+ | string
1686
+ | RegExp
1687
+ | ExternalItem[]
1688
+ | {
1689
+ [index: string]: string | boolean | string[] | { [index: string]: any };
1690
+ }
1691
+ | ((
1692
+ data: { context: string; request: string },
1693
+ callback: (err?: Error, result?: string) => void
1694
+ ) => void);
1722
1695
 
1723
1696
  /**
1724
1697
  * Enable presets of externals for specific targets.
@@ -1728,7 +1701,26 @@ declare interface Configuration {
1728
1701
  /**
1729
1702
  * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
1730
1703
  */
1731
- externalsType?: ExternalsType;
1704
+ externalsType?:
1705
+ | "var"
1706
+ | "module"
1707
+ | "assign"
1708
+ | "this"
1709
+ | "window"
1710
+ | "self"
1711
+ | "global"
1712
+ | "commonjs"
1713
+ | "commonjs2"
1714
+ | "commonjs-module"
1715
+ | "amd"
1716
+ | "amd-require"
1717
+ | "umd"
1718
+ | "umd2"
1719
+ | "jsonp"
1720
+ | "system"
1721
+ | "promise"
1722
+ | "import"
1723
+ | "script";
1732
1724
 
1733
1725
  /**
1734
1726
  * Ignore specific warnings.
@@ -1765,7 +1757,7 @@ declare interface Configuration {
1765
1757
  /**
1766
1758
  * Enable production optimizations or development hints.
1767
1759
  */
1768
- mode?: Mode;
1760
+ mode?: "development" | "production" | "none";
1769
1761
 
1770
1762
  /**
1771
1763
  * Options affecting the normal modules (`NormalModuleFactory`).
@@ -1780,7 +1772,7 @@ declare interface Configuration {
1780
1772
  /**
1781
1773
  * Include polyfills or mocks for various node stuff.
1782
1774
  */
1783
- node?: NodeWebpackOptions;
1775
+ node?: false | NodeOptions;
1784
1776
 
1785
1777
  /**
1786
1778
  * Enables/Disables integrated optimizations.
@@ -1800,7 +1792,7 @@ declare interface Configuration {
1800
1792
  /**
1801
1793
  * Configuration for web performance recommendations.
1802
1794
  */
1803
- performance?: Performance;
1795
+ performance?: false | PerformanceOptions;
1804
1796
 
1805
1797
  /**
1806
1798
  * Add additional plugins to the compiler.
@@ -1818,17 +1810,17 @@ declare interface Configuration {
1818
1810
  /**
1819
1811
  * Store compiler state to a json file.
1820
1812
  */
1821
- recordsInputPath?: DevTool;
1813
+ recordsInputPath?: string | false;
1822
1814
 
1823
1815
  /**
1824
1816
  * Load compiler state from a json file.
1825
1817
  */
1826
- recordsOutputPath?: DevTool;
1818
+ recordsOutputPath?: string | false;
1827
1819
 
1828
1820
  /**
1829
1821
  * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.
1830
1822
  */
1831
- recordsPath?: DevTool;
1823
+ recordsPath?: string | false;
1832
1824
 
1833
1825
  /**
1834
1826
  * Options for the resolver.
@@ -1848,12 +1840,22 @@ declare interface Configuration {
1848
1840
  /**
1849
1841
  * Stats options object or preset name.
1850
1842
  */
1851
- stats?: StatsValue;
1843
+ stats?:
1844
+ | boolean
1845
+ | "none"
1846
+ | "summary"
1847
+ | "errors-only"
1848
+ | "errors-warnings"
1849
+ | "minimal"
1850
+ | "normal"
1851
+ | "detailed"
1852
+ | "verbose"
1853
+ | StatsOptions;
1852
1854
 
1853
1855
  /**
1854
1856
  * Environment to build for. An array of environments to build for all of them when possible.
1855
1857
  */
1856
- target?: Target;
1858
+ target?: string | false | string[];
1857
1859
 
1858
1860
  /**
1859
1861
  * Enter watch mode, which rebuilds on file change.
@@ -1909,7 +1911,7 @@ declare interface ConsumesConfig {
1909
1911
  /**
1910
1912
  * Fallback module if no shared module is found in share scope. Defaults to the property name.
1911
1913
  */
1912
- import?: DevTool;
1914
+ import?: string | false;
1913
1915
 
1914
1916
  /**
1915
1917
  * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
@@ -1919,7 +1921,7 @@ declare interface ConsumesConfig {
1919
1921
  /**
1920
1922
  * Version requirement from module in share scope.
1921
1923
  */
1922
- requiredVersion?: DevTool;
1924
+ requiredVersion?: string | false;
1923
1925
 
1924
1926
  /**
1925
1927
  * Module is looked up under this key from the share scope.
@@ -2087,7 +2089,6 @@ declare class ContextReplacementPlugin {
2087
2089
  newContentRegExp: any;
2088
2090
  apply(compiler?: any): void;
2089
2091
  }
2090
- type CrossOriginLoading = false | "anonymous" | "use-credentials";
2091
2092
  type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
2092
2093
  declare class DefinePlugin {
2093
2094
  /**
@@ -2097,14 +2098,30 @@ declare class DefinePlugin {
2097
2098
  definitions: Record<
2098
2099
  string,
2099
2100
  RecursiveArrayOrRecord<
2100
- string | number | bigint | boolean | Function | RegExp | RuntimeValue
2101
+ | undefined
2102
+ | null
2103
+ | string
2104
+ | number
2105
+ | bigint
2106
+ | boolean
2107
+ | Function
2108
+ | RegExp
2109
+ | RuntimeValue
2101
2110
  >
2102
2111
  >
2103
2112
  );
2104
2113
  definitions: Record<
2105
2114
  string,
2106
2115
  RecursiveArrayOrRecord<
2107
- string | number | bigint | boolean | Function | RegExp | RuntimeValue
2116
+ | undefined
2117
+ | null
2118
+ | string
2119
+ | number
2120
+ | bigint
2121
+ | boolean
2122
+ | Function
2123
+ | RegExp
2124
+ | RuntimeValue
2108
2125
  >
2109
2126
  >;
2110
2127
 
@@ -2157,7 +2174,7 @@ declare class Dependency {
2157
2174
  loc: DependencyLocation;
2158
2175
  readonly type: string;
2159
2176
  readonly category: string;
2160
- getResourceIdentifier(): string;
2177
+ getResourceIdentifier(): null | string;
2161
2178
 
2162
2179
  /**
2163
2180
  * Returns the referenced module and export
@@ -2178,7 +2195,7 @@ declare class Dependency {
2178
2195
  /**
2179
2196
  * Returns the exported names
2180
2197
  */
2181
- getExports(moduleGraph: ModuleGraph): ExportsSpec;
2198
+ getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
2182
2199
 
2183
2200
  /**
2184
2201
  * Returns warnings
@@ -2207,7 +2224,7 @@ declare class Dependency {
2207
2224
  module: any;
2208
2225
  readonly disconnect: any;
2209
2226
  static NO_EXPORTS_REFERENCED: any[];
2210
- static EXPORTS_OBJECT_REFERENCED: any[][];
2227
+ static EXPORTS_OBJECT_REFERENCED: never[][];
2211
2228
  }
2212
2229
  declare interface DependencyConstructor {
2213
2230
  new (...args: any[]): Dependency;
@@ -2395,7 +2412,21 @@ type DllReferencePluginOptions =
2395
2412
  /**
2396
2413
  * How the dll is exposed (libraryTarget, defaults to manifest.type).
2397
2414
  */
2398
- sourceType?: DllReferencePluginOptionsSourceType;
2415
+ sourceType?:
2416
+ | "var"
2417
+ | "assign"
2418
+ | "this"
2419
+ | "window"
2420
+ | "global"
2421
+ | "commonjs"
2422
+ | "commonjs2"
2423
+ | "commonjs-module"
2424
+ | "amd"
2425
+ | "amd-require"
2426
+ | "umd"
2427
+ | "umd2"
2428
+ | "jsonp"
2429
+ | "system";
2399
2430
  /**
2400
2431
  * The way how the export of the dll bundle is used.
2401
2432
  */
@@ -2425,7 +2456,21 @@ type DllReferencePluginOptions =
2425
2456
  /**
2426
2457
  * How the dll is exposed (libraryTarget).
2427
2458
  */
2428
- sourceType?: DllReferencePluginOptionsSourceType;
2459
+ sourceType?:
2460
+ | "var"
2461
+ | "assign"
2462
+ | "this"
2463
+ | "window"
2464
+ | "global"
2465
+ | "commonjs"
2466
+ | "commonjs2"
2467
+ | "commonjs-module"
2468
+ | "amd"
2469
+ | "amd-require"
2470
+ | "umd"
2471
+ | "umd2"
2472
+ | "jsonp"
2473
+ | "system";
2429
2474
  /**
2430
2475
  * The way how the export of the dll bundle is used.
2431
2476
  */
@@ -2469,23 +2514,22 @@ declare interface DllReferencePluginOptionsManifest {
2469
2514
  /**
2470
2515
  * The type how the dll is exposed (external type).
2471
2516
  */
2472
- type?: DllReferencePluginOptionsSourceType;
2517
+ type?:
2518
+ | "var"
2519
+ | "assign"
2520
+ | "this"
2521
+ | "window"
2522
+ | "global"
2523
+ | "commonjs"
2524
+ | "commonjs2"
2525
+ | "commonjs-module"
2526
+ | "amd"
2527
+ | "amd-require"
2528
+ | "umd"
2529
+ | "umd2"
2530
+ | "jsonp"
2531
+ | "system";
2473
2532
  }
2474
- type DllReferencePluginOptionsSourceType =
2475
- | "var"
2476
- | "assign"
2477
- | "this"
2478
- | "window"
2479
- | "global"
2480
- | "commonjs"
2481
- | "commonjs2"
2482
- | "commonjs-module"
2483
- | "amd"
2484
- | "amd-require"
2485
- | "umd"
2486
- | "umd2"
2487
- | "jsonp"
2488
- | "system";
2489
2533
  declare class DynamicEntryPlugin {
2490
2534
  constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
2491
2535
  context: string;
@@ -2560,17 +2604,17 @@ declare interface EntryDescription {
2560
2604
  /**
2561
2605
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
2562
2606
  */
2563
- chunkLoading?: DevTool;
2607
+ chunkLoading?: string | false;
2564
2608
 
2565
2609
  /**
2566
2610
  * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
2567
2611
  */
2568
- dependOn?: EntryItem;
2612
+ dependOn?: string | string[];
2569
2613
 
2570
2614
  /**
2571
2615
  * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
2572
2616
  */
2573
- filename?: Filename;
2617
+ filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
2574
2618
 
2575
2619
  /**
2576
2620
  * Module(s) that are loaded upon startup.
@@ -2590,7 +2634,7 @@ declare interface EntryDescription {
2590
2634
  /**
2591
2635
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
2592
2636
  */
2593
- wasmLoading?: DevTool;
2637
+ wasmLoading?: string | false;
2594
2638
  }
2595
2639
 
2596
2640
  /**
@@ -2600,7 +2644,7 @@ declare interface EntryDescriptionNormalized {
2600
2644
  /**
2601
2645
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
2602
2646
  */
2603
- chunkLoading?: DevTool;
2647
+ chunkLoading?: string | false;
2604
2648
 
2605
2649
  /**
2606
2650
  * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
@@ -2610,7 +2654,7 @@ declare interface EntryDescriptionNormalized {
2610
2654
  /**
2611
2655
  * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
2612
2656
  */
2613
- filename?: Filename;
2657
+ filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
2614
2658
 
2615
2659
  /**
2616
2660
  * Module(s) that are loaded upon startup. The last one is exported.
@@ -2630,7 +2674,7 @@ declare interface EntryDescriptionNormalized {
2630
2674
  /**
2631
2675
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
2632
2676
  */
2633
- wasmLoading?: DevTool;
2677
+ wasmLoading?: string | false;
2634
2678
  }
2635
2679
  type EntryItem = string | string[];
2636
2680
  type EntryNormalized =
@@ -2702,7 +2746,7 @@ declare abstract class Entrypoint extends ChunkGroup {
2702
2746
  /**
2703
2747
  * Fetches the chunk reference containing the webpack bootstrap code
2704
2748
  */
2705
- getRuntimeChunk(): Chunk;
2749
+ getRuntimeChunk(): null | Chunk;
2706
2750
 
2707
2751
  /**
2708
2752
  * Sets the chunk with the entrypoint modules for an entrypoint.
@@ -2830,7 +2874,7 @@ declare abstract class ExportInfo {
2830
2874
  * null: only the runtime knows if it is provided
2831
2875
  * undefined: it was not determined if it is provided
2832
2876
  */
2833
- provided: boolean;
2877
+ provided?: null | boolean;
2834
2878
 
2835
2879
  /**
2836
2880
  * is the export a terminal binding that should be checked for export star conflicts
@@ -2842,17 +2886,17 @@ declare abstract class ExportInfo {
2842
2886
  * false: is can not be mangled
2843
2887
  * undefined: it was not determined if it can be mangled
2844
2888
  */
2845
- canMangleProvide: boolean;
2889
+ canMangleProvide?: boolean;
2846
2890
 
2847
2891
  /**
2848
2892
  * true: it can be mangled
2849
2893
  * false: is can not be mangled
2850
2894
  * undefined: it was not determined if it can be mangled
2851
2895
  */
2852
- canMangleUse: boolean;
2896
+ canMangleUse?: boolean;
2853
2897
  exportsInfoOwned: boolean;
2854
- exportsInfo: ExportsInfo;
2855
- readonly canMangle: boolean;
2898
+ exportsInfo?: ExportsInfo;
2899
+ readonly canMangle?: boolean;
2856
2900
  setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
2857
2901
  setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
2858
2902
  setHasUseInfo(): void;
@@ -2872,7 +2916,7 @@ declare abstract class ExportInfo {
2872
2916
  /**
2873
2917
  * get used name
2874
2918
  */
2875
- getUsedName(fallbackName: string, runtime: RuntimeSpec): DevTool;
2919
+ getUsedName(fallbackName: undefined | string, runtime: RuntimeSpec): DevTool;
2876
2920
  hasUsedName(): boolean;
2877
2921
 
2878
2922
  /**
@@ -2883,31 +2927,34 @@ declare abstract class ExportInfo {
2883
2927
  moduleGraph: ModuleGraph,
2884
2928
  resolveTargetFilter?: (arg0: {
2885
2929
  module: Module;
2886
- export: string[];
2930
+ export?: string[];
2887
2931
  }) => boolean
2888
- ): ExportsInfo | ExportInfo;
2889
- isReexport(): boolean;
2932
+ ): undefined | ExportsInfo | ExportInfo;
2933
+ isReexport(): undefined | boolean;
2890
2934
  findTarget(
2891
2935
  moduleGraph: ModuleGraph,
2892
2936
  validTargetModuleFilter: (arg0: Module) => boolean
2893
- ): false | { module: Module; export: string[] };
2937
+ ): undefined | false | { module: Module; export?: string[] };
2894
2938
  getTarget(
2895
2939
  moduleGraph: ModuleGraph,
2896
2940
  resolveTargetFilter?: (arg0: {
2897
2941
  module: Module;
2898
- export: string[];
2942
+ export?: string[];
2899
2943
  }) => boolean
2900
- ): { module: Module; export: string[] };
2944
+ ): undefined | { module: Module; export?: string[] };
2901
2945
 
2902
2946
  /**
2903
2947
  * Move the target forward as long resolveTargetFilter is fulfilled
2904
2948
  */
2905
2949
  moveTarget(
2906
2950
  moduleGraph: ModuleGraph,
2907
- resolveTargetFilter: (arg0: { module: Module; export: string[] }) => boolean
2908
- ): { module: Module; export: string[] };
2909
- createNestedExportsInfo(): ExportsInfo;
2910
- getNestedExportsInfo(): ExportsInfo;
2951
+ resolveTargetFilter: (arg0: {
2952
+ module: Module;
2953
+ export?: string[];
2954
+ }) => boolean
2955
+ ): undefined | { module: Module; export?: string[] };
2956
+ createNestedExportsInfo(): undefined | ExportsInfo;
2957
+ getNestedExportsInfo(): undefined | ExportsInfo;
2911
2958
  updateHash(hash?: any, runtime?: any): void;
2912
2959
  getUsedInfo(): string;
2913
2960
  getProvidedInfo():
@@ -2946,7 +2993,7 @@ declare interface ExportSpec {
2946
2993
  /**
2947
2994
  * when reexported: from which export
2948
2995
  */
2949
- export?: string[];
2996
+ export?: null | string[];
2950
2997
  }
2951
2998
  type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
2952
2999
  declare abstract class ExportsInfo {
@@ -2961,8 +3008,8 @@ declare abstract class ExportsInfo {
2961
3008
  getOwnExportInfo(name: string): ExportInfo;
2962
3009
  getExportInfo(name: string): ExportInfo;
2963
3010
  getReadOnlyExportInfo(name: string): ExportInfo;
2964
- getReadOnlyExportInfoRecursive(name: string[]): ExportInfo;
2965
- getNestedExportsInfo(name?: string[]): ExportsInfo;
3011
+ getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
3012
+ getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
2966
3013
  setUnknownExportsProvided(
2967
3014
  canMangle?: boolean,
2968
3015
  excludeExports?: Set<string>,
@@ -2975,10 +3022,10 @@ declare abstract class ExportsInfo {
2975
3022
  setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
2976
3023
  isUsed(runtime: RuntimeSpec): boolean;
2977
3024
  isModuleUsed(runtime: RuntimeSpec): boolean;
2978
- getUsedExports(runtime: RuntimeSpec): boolean | SortableSet<string>;
2979
- getProvidedExports(): true | string[];
3025
+ getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
3026
+ getProvidedExports(): null | true | string[];
2980
3027
  getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
2981
- isExportProvided(name: EntryItem): boolean;
3028
+ isExportProvided(name: EntryItem): undefined | null | boolean;
2982
3029
  getUsageKey(runtime: RuntimeSpec): string;
2983
3030
  isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
2984
3031
  getUsed(name: EntryItem, runtime: RuntimeSpec): UsageStateType;
@@ -2996,7 +3043,7 @@ declare interface ExportsSpec {
2996
3043
  /**
2997
3044
  * exported names, true for unknown exports or null for no exports
2998
3045
  */
2999
- exports: true | (string | ExportSpec)[];
3046
+ exports: null | true | (string | ExportSpec)[];
3000
3047
 
3001
3048
  /**
3002
3049
  * when exports = true, list of unaffected exports
@@ -3107,8 +3154,8 @@ type Externals =
3107
3154
  callback: (err?: Error, result?: string) => void
3108
3155
  ) => void);
3109
3156
  declare class ExternalsPlugin {
3110
- constructor(type: string, externals: Externals);
3111
- type: string;
3157
+ constructor(type: undefined | string, externals: Externals);
3158
+ type?: string;
3112
3159
  externals: Externals;
3113
3160
 
3114
3161
  /**
@@ -3185,7 +3232,7 @@ declare interface FactorizeModuleOptions {
3185
3232
  currentProfile: ModuleProfile;
3186
3233
  factory: ModuleFactory;
3187
3234
  dependencies: Dependency[];
3188
- originModule: Module;
3235
+ originModule: null | Module;
3189
3236
  context?: string;
3190
3237
  }
3191
3238
  type FakeHook<T> = T & FakeHookMarker;
@@ -3312,7 +3359,7 @@ declare interface FileSystem {
3312
3359
  };
3313
3360
  }
3314
3361
  declare interface FileSystemCallback<T> {
3315
- (err?: PossibleFileSystemError & Error, result?: T): any;
3362
+ (err?: null | (PossibleFileSystemError & Error), result?: T): any;
3316
3363
  }
3317
3364
  declare interface FileSystemDirent {
3318
3365
  name: string | Buffer;
@@ -3321,44 +3368,54 @@ declare interface FileSystemDirent {
3321
3368
  }
3322
3369
  declare abstract class FileSystemInfo {
3323
3370
  fs: InputFileSystem;
3324
- logger: WebpackLogger;
3325
- fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
3326
- fileHashQueue: AsyncQueue<string, string, string>;
3327
- contextTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
3328
- contextHashQueue: AsyncQueue<string, string, string>;
3329
- managedItemQueue: AsyncQueue<string, string, string>;
3371
+ logger?: WebpackLogger;
3372
+ fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3373
+ fileHashQueue: AsyncQueue<string, string, null | string>;
3374
+ contextTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3375
+ contextHashQueue: AsyncQueue<string, string, null | string>;
3376
+ managedItemQueue: AsyncQueue<string, string, null | string>;
3330
3377
  managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
3331
3378
  managedPaths: string[];
3332
3379
  managedPathsWithSlash: string[];
3333
3380
  immutablePaths: string[];
3334
3381
  immutablePathsWithSlash: string[];
3335
3382
  logStatistics(): void;
3336
- addFileTimestamps(map: Map<string, FileSystemInfoEntry | "ignore">): void;
3337
- addContextTimestamps(map: Map<string, FileSystemInfoEntry | "ignore">): void;
3383
+ addFileTimestamps(
3384
+ map: Map<string, null | FileSystemInfoEntry | "ignore">
3385
+ ): void;
3386
+ addContextTimestamps(
3387
+ map: Map<string, null | FileSystemInfoEntry | "ignore">
3388
+ ): void;
3338
3389
  getFileTimestamp(
3339
3390
  path: string,
3340
- callback: (arg0: WebpackError, arg1: FileSystemInfoEntry | "ignore") => void
3391
+ callback: (
3392
+ arg0?: WebpackError,
3393
+ arg1?: null | FileSystemInfoEntry | "ignore"
3394
+ ) => void
3341
3395
  ): void;
3342
3396
  getContextTimestamp(
3343
3397
  path: string,
3344
- callback: (arg0: WebpackError, arg1: FileSystemInfoEntry | "ignore") => void
3398
+ callback: (
3399
+ arg0?: WebpackError,
3400
+ arg1?: null | FileSystemInfoEntry | "ignore"
3401
+ ) => void
3345
3402
  ): void;
3346
3403
  getFileHash(
3347
3404
  path: string,
3348
- callback: (arg0: WebpackError, arg1: string) => void
3405
+ callback: (arg0?: WebpackError, arg1?: string) => void
3349
3406
  ): void;
3350
3407
  getContextHash(
3351
3408
  path: string,
3352
- callback: (arg0: WebpackError, arg1: string) => void
3409
+ callback: (arg0?: WebpackError, arg1?: string) => void
3353
3410
  ): void;
3354
3411
  resolveBuildDependencies(
3355
3412
  context: string,
3356
3413
  deps: Iterable<string>,
3357
- callback: (arg0: Error, arg1: ResolveBuildDependenciesResult) => void
3414
+ callback: (arg0?: Error, arg1?: ResolveBuildDependenciesResult) => void
3358
3415
  ): void;
3359
3416
  checkResolveResultsValid(
3360
3417
  resolveResults: Map<string, string>,
3361
- callback: (arg0: Error, arg1: boolean) => void
3418
+ callback: (arg0?: Error, arg1?: boolean) => void
3362
3419
  ): void;
3363
3420
  createSnapshot(
3364
3421
  startTime: number,
@@ -3375,12 +3432,12 @@ declare abstract class FileSystemInfo {
3375
3432
  */
3376
3433
  timestamp?: boolean;
3377
3434
  },
3378
- callback: (arg0: WebpackError, arg1: Snapshot) => void
3435
+ callback: (arg0?: WebpackError, arg1?: Snapshot) => void
3379
3436
  ): void;
3380
3437
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
3381
3438
  checkSnapshotValid(
3382
3439
  snapshot: Snapshot,
3383
- callback: (arg0: WebpackError, arg1: boolean) => void
3440
+ callback: (arg0?: WebpackError, arg1?: boolean) => void
3384
3441
  ): void;
3385
3442
  getDeprecatedFileTimestamps(): Map<any, any>;
3386
3443
  getDeprecatedContextTimestamps(): Map<any, any>;
@@ -3394,15 +3451,7 @@ declare interface FileSystemStats {
3394
3451
  isDirectory: () => boolean;
3395
3452
  isFile: () => boolean;
3396
3453
  }
3397
- type Filename =
3398
- | string
3399
- | ((pathData: PathData, assetInfo?: AssetInfo) => string);
3400
3454
  type FilterItemTypes = string | RegExp | ((value: string) => boolean);
3401
- type FilterTypes =
3402
- | string
3403
- | RegExp
3404
- | FilterItemTypes[]
3405
- | ((value: string) => boolean);
3406
3455
  declare interface GenerateContext {
3407
3456
  /**
3408
3457
  * mapping from dependencies to templates
@@ -3452,7 +3501,7 @@ declare class Generator {
3452
3501
  getConcatenationBailoutReason(
3453
3502
  module: NormalModule,
3454
3503
  context: ConcatenationBailoutReasonContext
3455
- ): string;
3504
+ ): undefined | string;
3456
3505
  updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
3457
3506
  static byType(map?: any): ByTypeGenerator;
3458
3507
  }
@@ -3463,14 +3512,14 @@ declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
3463
3512
  global: string,
3464
3513
  getFilenameForChunk: (
3465
3514
  arg0: Chunk
3466
- ) => string | ((arg0: PathData, arg1: AssetInfo) => string),
3515
+ ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
3467
3516
  allChunks: boolean
3468
3517
  );
3469
3518
  contentType: string;
3470
3519
  global: string;
3471
3520
  getFilenameForChunk: (
3472
3521
  arg0: Chunk
3473
- ) => string | ((arg0: PathData, arg1: AssetInfo) => string);
3522
+ ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
3474
3523
  allChunks: boolean;
3475
3524
 
3476
3525
  /**
@@ -3510,7 +3559,7 @@ declare interface HMRJavascriptParserHooks {
3510
3559
  declare interface HandleModuleCreationOptions {
3511
3560
  factory: ModuleFactory;
3512
3561
  dependencies: Dependency[];
3513
- originModule: Module;
3562
+ originModule: null | Module;
3514
3563
  context?: string;
3515
3564
 
3516
3565
  /**
@@ -3599,7 +3648,7 @@ declare class IgnorePlugin {
3599
3648
  * Note that if "contextRegExp" is given, both the "resourceRegExp"
3600
3649
  * and "contextRegExp" have to match.
3601
3650
  */
3602
- checkIgnore(resolveData: ResolveData): false;
3651
+ checkIgnore(resolveData: ResolveData): undefined | false;
3603
3652
 
3604
3653
  /**
3605
3654
  * Apply the plugin
@@ -3623,7 +3672,7 @@ type IgnorePluginOptions =
3623
3672
  */
3624
3673
  checkResource?: (resource: string, context: string) => boolean;
3625
3674
  };
3626
- type ImportSource = string | SimpleLiteral | RegExpLiteral;
3675
+ type ImportSource = undefined | null | string | SimpleLiteral | RegExpLiteral;
3627
3676
 
3628
3677
  /**
3629
3678
  * Options for infrastructure level logging.
@@ -3648,38 +3697,38 @@ declare abstract class InitFragment {
3648
3697
  content: string | Source;
3649
3698
  stage: number;
3650
3699
  position: number;
3651
- key: string;
3652
- endContent: string | Source;
3700
+ key?: string;
3701
+ endContent?: string | Source;
3653
3702
  getContent(generateContext: GenerateContext): string | Source;
3654
- getEndContent(generateContext: GenerateContext): string | Source;
3703
+ getEndContent(generateContext: GenerateContext): undefined | string | Source;
3655
3704
  merge: any;
3656
3705
  }
3657
3706
  declare interface InputFileSystem {
3658
3707
  readFile: (
3659
3708
  arg0: string,
3660
- arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void
3709
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
3661
3710
  ) => void;
3662
3711
  readJson?: (
3663
3712
  arg0: string,
3664
- arg1: (arg0: Error | NodeJS.ErrnoException, arg1?: any) => void
3713
+ arg1: (arg0?: Error | NodeJS.ErrnoException, arg1?: any) => void
3665
3714
  ) => void;
3666
3715
  readlink: (
3667
3716
  arg0: string,
3668
- arg1: (arg0: NodeJS.ErrnoException, arg1: string | Buffer) => void
3717
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
3669
3718
  ) => void;
3670
3719
  readdir: (
3671
3720
  arg0: string,
3672
- arg1: (arg0: NodeJS.ErrnoException, arg1: string[]) => void
3721
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string[]) => void
3673
3722
  ) => void;
3674
3723
  stat: (
3675
3724
  arg0: string,
3676
- arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void
3725
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: FsStats) => void
3677
3726
  ) => void;
3678
3727
  realpath?: (
3679
3728
  arg0: string,
3680
- arg1: (arg0: NodeJS.ErrnoException, arg1: string) => void
3729
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: string) => void
3681
3730
  ) => void;
3682
- purge?: (arg0: string) => void;
3731
+ purge?: (arg0?: string) => void;
3683
3732
  join?: (arg0: string, arg1: string) => string;
3684
3733
  relative?: (arg0: string, arg1: string) => string;
3685
3734
  dirname?: (arg0: string) => string;
@@ -3693,7 +3742,7 @@ declare interface IntermediateFileSystemExtras {
3693
3742
  open: (
3694
3743
  arg0: string,
3695
3744
  arg1: string,
3696
- arg2: (arg0: NodeJS.ErrnoException, arg1: number) => void
3745
+ arg2: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
3697
3746
  ) => void;
3698
3747
  read: (
3699
3748
  arg0: number,
@@ -3701,13 +3750,13 @@ declare interface IntermediateFileSystemExtras {
3701
3750
  arg2: number,
3702
3751
  arg3: number,
3703
3752
  arg4: number,
3704
- arg5: (arg0: NodeJS.ErrnoException, arg1: number) => void
3753
+ arg5: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
3705
3754
  ) => void;
3706
- close: (arg0: number, arg1: (arg0: NodeJS.ErrnoException) => void) => void;
3755
+ close: (arg0: number, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
3707
3756
  rename: (
3708
3757
  arg0: string,
3709
3758
  arg1: string,
3710
- arg2: (arg0: NodeJS.ErrnoException) => void
3759
+ arg2: (arg0?: NodeJS.ErrnoException) => void
3711
3760
  ) => void;
3712
3761
  }
3713
3762
  type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
@@ -3774,25 +3823,30 @@ declare class JavascriptParser extends Parser {
3774
3823
  constructor(sourceType?: "module" | "script" | "auto");
3775
3824
  hooks: Readonly<{
3776
3825
  evaluateTypeof: HookMap<
3777
- SyncBailHook<[UnaryExpression], BasicEvaluatedExpression>
3826
+ SyncBailHook<
3827
+ [UnaryExpression],
3828
+ undefined | null | BasicEvaluatedExpression
3829
+ >
3830
+ >;
3831
+ evaluate: HookMap<
3832
+ SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
3778
3833
  >;
3779
- evaluate: HookMap<SyncBailHook<[Expression], BasicEvaluatedExpression>>;
3780
3834
  evaluateIdentifier: HookMap<
3781
3835
  SyncBailHook<
3782
3836
  [ThisExpression | MemberExpression | MetaProperty | Identifier],
3783
- BasicEvaluatedExpression
3837
+ undefined | null | BasicEvaluatedExpression
3784
3838
  >
3785
3839
  >;
3786
3840
  evaluateDefinedIdentifier: HookMap<
3787
3841
  SyncBailHook<
3788
3842
  [ThisExpression | MemberExpression | Identifier],
3789
- BasicEvaluatedExpression
3843
+ undefined | null | BasicEvaluatedExpression
3790
3844
  >
3791
3845
  >;
3792
3846
  evaluateCallExpressionMember: HookMap<
3793
3847
  SyncBailHook<
3794
- [CallExpression, BasicEvaluatedExpression],
3795
- BasicEvaluatedExpression
3848
+ [CallExpression, undefined | BasicEvaluatedExpression],
3849
+ undefined | null | BasicEvaluatedExpression
3796
3850
  >
3797
3851
  >;
3798
3852
  isPure: HookMap<
@@ -3944,11 +3998,11 @@ declare class JavascriptParser extends Parser {
3944
3998
  exportDeclaration: SyncBailHook<[Statement, Declaration], boolean | void>;
3945
3999
  exportExpression: SyncBailHook<[Statement, Declaration], boolean | void>;
3946
4000
  exportSpecifier: SyncBailHook<
3947
- [Statement, string, string, number],
4001
+ [Statement, string, string, undefined | number],
3948
4002
  boolean | void
3949
4003
  >;
3950
4004
  exportImportSpecifier: SyncBailHook<
3951
- [Statement, ImportSource, string, string, number],
4005
+ [Statement, ImportSource, string, string, undefined | number],
3952
4006
  boolean | void
3953
4007
  >;
3954
4008
  preDeclarator: SyncBailHook<
@@ -4056,7 +4110,7 @@ declare class JavascriptParser extends Parser {
4056
4110
  )[];
4057
4111
  prevStatement: any;
4058
4112
  currentTagData: any;
4059
- getRenameIdentifier(expr?: any): string;
4113
+ getRenameIdentifier(expr?: any): undefined | string;
4060
4114
  walkClass(classy: ClassExpression | ClassDeclaration): void;
4061
4115
  walkMethodDefinition(methodDefinition?: any): void;
4062
4116
  preWalkStatements(statements?: any): void;
@@ -4203,12 +4257,16 @@ declare class JavascriptParser extends Parser {
4203
4257
  enterArrayPattern(pattern?: any, onIdent?: any): void;
4204
4258
  enterRestElement(pattern?: any, onIdent?: any): void;
4205
4259
  enterAssignmentPattern(pattern?: any, onIdent?: any): void;
4206
- evaluateExpression(expression: Expression): BasicEvaluatedExpression;
4260
+ evaluateExpression(
4261
+ expression: Expression
4262
+ ): undefined | BasicEvaluatedExpression;
4207
4263
  parseString(expression?: any): any;
4208
4264
  parseCalculatedString(expression?: any): any;
4209
- evaluate(source?: any): BasicEvaluatedExpression;
4265
+ evaluate(source?: any): undefined | BasicEvaluatedExpression;
4210
4266
  isPure(
4211
4267
  expr:
4268
+ | undefined
4269
+ | null
4212
4270
  | UnaryExpression
4213
4271
  | ThisExpression
4214
4272
  | ArrayExpression
@@ -4251,7 +4309,9 @@ declare class JavascriptParser extends Parser {
4251
4309
  isVariableDefined(name?: any): boolean;
4252
4310
  getVariableInfo(name: string): ExportedVariableInfo;
4253
4311
  setVariable(name: string, variableInfo: ExportedVariableInfo): void;
4254
- parseCommentOptions(range?: any): { options: any; errors: any };
4312
+ parseCommentOptions(
4313
+ range?: any
4314
+ ): { options: null; errors: null } | { options: {}; errors: any[] };
4255
4315
  extractMemberExpressionChain(
4256
4316
  expression: MemberExpression
4257
4317
  ): {
@@ -4291,7 +4351,7 @@ declare class JavascriptParser extends Parser {
4291
4351
  getMemberExpressionInfo(
4292
4352
  expression: MemberExpression,
4293
4353
  allowedTypes: number
4294
- ): CallExpressionInfo | ExpressionExpressionInfo;
4354
+ ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
4295
4355
  getNameForExpression(
4296
4356
  expression: MemberExpression
4297
4357
  ): {
@@ -4344,6 +4404,67 @@ declare class JsonpTemplatePlugin {
4344
4404
  compilation: Compilation
4345
4405
  ): JsonpCompilationPluginHooks;
4346
4406
  }
4407
+ declare interface KnownAssetInfo {
4408
+ /**
4409
+ * true, if the asset can be long term cached forever (contains a hash)
4410
+ */
4411
+ immutable?: boolean;
4412
+
4413
+ /**
4414
+ * whether the asset is minimized
4415
+ */
4416
+ minimized?: boolean;
4417
+
4418
+ /**
4419
+ * the value(s) of the full hash used for this asset
4420
+ */
4421
+ fullhash?: string | string[];
4422
+
4423
+ /**
4424
+ * the value(s) of the chunk hash used for this asset
4425
+ */
4426
+ chunkhash?: string | string[];
4427
+
4428
+ /**
4429
+ * the value(s) of the module hash used for this asset
4430
+ */
4431
+ modulehash?: string | string[];
4432
+
4433
+ /**
4434
+ * the value(s) of the content hash used for this asset
4435
+ */
4436
+ contenthash?: string | string[];
4437
+
4438
+ /**
4439
+ * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
4440
+ */
4441
+ sourceFilename?: string;
4442
+
4443
+ /**
4444
+ * size in bytes, only set after asset has been emitted
4445
+ */
4446
+ size?: number;
4447
+
4448
+ /**
4449
+ * true, when asset is only used for development and doesn't count towards user-facing assets
4450
+ */
4451
+ development?: boolean;
4452
+
4453
+ /**
4454
+ * true, when asset ships data for updating an existing application (HMR)
4455
+ */
4456
+ hotModuleReplacement?: boolean;
4457
+
4458
+ /**
4459
+ * true, when asset is javascript and an ESM
4460
+ */
4461
+ javascriptModule?: boolean;
4462
+
4463
+ /**
4464
+ * object of pointers to other assets, keyed by type of relation (only points from parent to child)
4465
+ */
4466
+ related?: Record<string, EntryItem>;
4467
+ }
4347
4468
  declare interface KnownBuildMeta {
4348
4469
  moduleArgument?: string;
4349
4470
  exportsArgument?: string;
@@ -4382,7 +4503,7 @@ declare interface LibIdentOptions {
4382
4503
  /**
4383
4504
  * object for caching
4384
4505
  */
4385
- associatedObjectForCache?: any;
4506
+ associatedObjectForCache?: Object;
4386
4507
  }
4387
4508
  declare class LibManifestPlugin {
4388
4509
  constructor(options?: any);
@@ -4393,7 +4514,6 @@ declare class LibManifestPlugin {
4393
4514
  */
4394
4515
  apply(compiler: Compiler): void;
4395
4516
  }
4396
- type Library = string | string[] | LibraryOptions | LibraryCustomUmdObject;
4397
4517
  declare interface LibraryContext<T> {
4398
4518
  compilation: Compilation;
4399
4519
  options: T;
@@ -4441,7 +4561,7 @@ declare interface LibraryCustomUmdObject {
4441
4561
  /**
4442
4562
  * Name of the property exposed globally by a UMD library.
4443
4563
  */
4444
- root?: EntryItem;
4564
+ root?: string | string[];
4445
4565
  }
4446
4566
  type LibraryName = string | string[] | LibraryCustomUmdObject;
4447
4567
 
@@ -4452,17 +4572,17 @@ declare interface LibraryOptions {
4452
4572
  /**
4453
4573
  * Add a comment in the UMD wrapper.
4454
4574
  */
4455
- auxiliaryComment?: AuxiliaryComment;
4575
+ auxiliaryComment?: string | LibraryCustomUmdCommentObject;
4456
4576
 
4457
4577
  /**
4458
4578
  * Specify which export should be exposed as library.
4459
4579
  */
4460
- export?: EntryItem;
4580
+ export?: string | string[];
4461
4581
 
4462
4582
  /**
4463
4583
  * The name of the library (some types allow unnamed libraries too).
4464
4584
  */
4465
- name?: LibraryName;
4585
+ name?: string | string[] | LibraryCustomUmdObject;
4466
4586
 
4467
4587
  /**
4468
4588
  * 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).
@@ -4497,7 +4617,7 @@ declare class LibraryTemplatePlugin {
4497
4617
  }
4498
4618
  declare class LimitChunkCountPlugin {
4499
4619
  constructor(options?: LimitChunkCountPluginOptions);
4500
- options: LimitChunkCountPluginOptions;
4620
+ options?: LimitChunkCountPluginOptions;
4501
4621
  apply(compiler: Compiler): void;
4502
4622
  }
4503
4623
  declare interface LimitChunkCountPluginOptions {
@@ -4555,8 +4675,8 @@ declare interface Loader {
4555
4675
  declare interface LoaderItem {
4556
4676
  loader: string;
4557
4677
  options: any;
4558
- ident: string;
4559
- type: string;
4678
+ ident: null | string;
4679
+ type: null | string;
4560
4680
  }
4561
4681
  declare class LoaderOptionsPlugin {
4562
4682
  constructor(options?: LoaderOptionsPluginOptions);
@@ -4675,13 +4795,13 @@ declare abstract class MainTemplate {
4675
4795
  readonly linkPreload: SyncWaterfallHook<[string, Chunk]>;
4676
4796
  }>;
4677
4797
  renderCurrentHashCode: (hash: string, length?: number) => string;
4678
- getPublicPath: (options?: any) => string;
4798
+ getPublicPath: (options: {}) => string;
4679
4799
  getAssetPath: (path?: any, options?: any) => string;
4680
4800
  getAssetPathWithInfo: (
4681
4801
  path?: any,
4682
4802
  options?: any
4683
4803
  ) => { path: string; info: AssetInfo };
4684
- readonly requireFn: string;
4804
+ readonly requireFn: "__webpack_require__";
4685
4805
  readonly outputOptions: Output;
4686
4806
  }
4687
4807
  declare interface MapOptions {
@@ -4731,7 +4851,6 @@ declare interface MinChunkSizePluginOptions {
4731
4851
  */
4732
4852
  minChunkSize: number;
4733
4853
  }
4734
- type Mode = "development" | "production" | "none";
4735
4854
  declare class Module extends DependenciesBlock {
4736
4855
  constructor(type: string, context?: string);
4737
4856
  type: string;
@@ -4739,21 +4858,21 @@ declare class Module extends DependenciesBlock {
4739
4858
  needId: boolean;
4740
4859
  debugId: number;
4741
4860
  resolveOptions: ResolveOptionsWebpackOptions;
4742
- factoryMeta: any;
4861
+ factoryMeta?: {};
4743
4862
  useSourceMap: boolean;
4744
4863
  useSimpleSourceMap: boolean;
4745
4864
  buildMeta: BuildMeta;
4746
- buildInfo: any;
4747
- presentationalDependencies: Dependency[];
4865
+ buildInfo: Record<string, any>;
4866
+ presentationalDependencies?: Dependency[];
4748
4867
  id: string | number;
4749
4868
  readonly hash: string;
4750
4869
  readonly renderedHash: string;
4751
- profile: ModuleProfile;
4870
+ profile: null | ModuleProfile;
4752
4871
  index: number;
4753
4872
  index2: number;
4754
4873
  depth: number;
4755
- issuer: Module;
4756
- readonly usedExports: boolean | SortableSet<string>;
4874
+ issuer: null | Module;
4875
+ readonly usedExports: null | boolean | SortableSet<string>;
4757
4876
  readonly optimizationBailout: (
4758
4877
  | string
4759
4878
  | ((requestShortener: RequestShortener) => string)
@@ -4766,7 +4885,7 @@ declare class Module extends DependenciesBlock {
4766
4885
  getChunks(): Chunk[];
4767
4886
  getNumberOfChunks(): number;
4768
4887
  readonly chunksIterable: Iterable<Chunk>;
4769
- isProvided(exportName: string): boolean;
4888
+ isProvided(exportName: string): null | boolean;
4770
4889
  readonly exportsArgument: string;
4771
4890
  readonly moduleArgument: string;
4772
4891
  getExportsType(
@@ -4775,10 +4894,10 @@ declare class Module extends DependenciesBlock {
4775
4894
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
4776
4895
  addPresentationalDependency(presentationalDependency: Dependency): void;
4777
4896
  addWarning(warning: WebpackError): void;
4778
- getWarnings(): Iterable<WebpackError>;
4897
+ getWarnings(): undefined | Iterable<WebpackError>;
4779
4898
  getNumberOfWarnings(): number;
4780
4899
  addError(error: WebpackError): void;
4781
- getErrors(): Iterable<WebpackError>;
4900
+ getErrors(): undefined | Iterable<WebpackError>;
4782
4901
  getNumberOfErrors(): number;
4783
4902
 
4784
4903
  /**
@@ -4804,11 +4923,11 @@ declare class Module extends DependenciesBlock {
4804
4923
  hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
4805
4924
  needBuild(
4806
4925
  context: NeedBuildContext,
4807
- callback: (arg0: WebpackError, arg1: boolean) => void
4926
+ callback: (arg0?: WebpackError, arg1?: boolean) => void
4808
4927
  ): void;
4809
4928
  needRebuild(
4810
- fileTimestamps: Map<string, number>,
4811
- contextTimestamps: Map<string, number>
4929
+ fileTimestamps: Map<string, null | number>,
4930
+ contextTimestamps: Map<string, null | number>
4812
4931
  ): boolean;
4813
4932
  invalidateBuild(): void;
4814
4933
  identifier(): string;
@@ -4818,7 +4937,7 @@ declare class Module extends DependenciesBlock {
4818
4937
  compilation: Compilation,
4819
4938
  resolver: ResolverWithOptions,
4820
4939
  fs: InputFileSystem,
4821
- callback: (arg0: WebpackError) => void
4940
+ callback: (arg0?: WebpackError) => void
4822
4941
  ): void;
4823
4942
  getSourceTypes(): Set<string>;
4824
4943
  source(
@@ -4827,11 +4946,11 @@ declare class Module extends DependenciesBlock {
4827
4946
  type?: string
4828
4947
  ): Source;
4829
4948
  size(type?: string): number;
4830
- libIdent(options: LibIdentOptions): string;
4831
- nameForCondition(): string;
4949
+ libIdent(options: LibIdentOptions): null | string;
4950
+ nameForCondition(): null | string;
4832
4951
  getConcatenationBailoutReason(
4833
4952
  context: ConcatenationBailoutReasonContext
4834
- ): string;
4953
+ ): undefined | string;
4835
4954
  getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
4836
4955
  codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
4837
4956
  chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
@@ -4842,7 +4961,7 @@ declare class Module extends DependenciesBlock {
4842
4961
  * and properties.
4843
4962
  */
4844
4963
  updateCacheModule(module: Module): void;
4845
- originalSource(): Source;
4964
+ originalSource(): null | Source;
4846
4965
  addCacheDependencies(
4847
4966
  fileDependencies: LazySet<string>,
4848
4967
  contextDependencies: LazySet<string>,
@@ -4872,7 +4991,7 @@ declare abstract class ModuleDependency extends Dependency {
4872
4991
  declare abstract class ModuleFactory {
4873
4992
  create(
4874
4993
  data: ModuleFactoryCreateData,
4875
- callback: (arg0: Error, arg1: ModuleFactoryResult) => void
4994
+ callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
4876
4995
  ): void;
4877
4996
  }
4878
4997
  declare interface ModuleFactoryCreateData {
@@ -4906,7 +5025,7 @@ declare interface ModuleFederationPluginOptions {
4906
5025
  /**
4907
5026
  * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
4908
5027
  */
4909
- exposes?: Exposes;
5028
+ exposes?: (string | ExposesObject)[] | ExposesObject;
4910
5029
 
4911
5030
  /**
4912
5031
  * The filename of the container as relative path inside the `output.path` directory.
@@ -4926,12 +5045,31 @@ declare interface ModuleFederationPluginOptions {
4926
5045
  /**
4927
5046
  * The external type of the remote containers.
4928
5047
  */
4929
- remoteType?: ExternalsType;
5048
+ remoteType?:
5049
+ | "var"
5050
+ | "module"
5051
+ | "assign"
5052
+ | "this"
5053
+ | "window"
5054
+ | "self"
5055
+ | "global"
5056
+ | "commonjs"
5057
+ | "commonjs2"
5058
+ | "commonjs-module"
5059
+ | "amd"
5060
+ | "amd-require"
5061
+ | "umd"
5062
+ | "umd2"
5063
+ | "jsonp"
5064
+ | "system"
5065
+ | "promise"
5066
+ | "import"
5067
+ | "script";
4930
5068
 
4931
5069
  /**
4932
5070
  * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
4933
5071
  */
4934
- remotes?: Remotes;
5072
+ remotes?: (string | RemotesObject)[] | RemotesObject;
4935
5073
 
4936
5074
  /**
4937
5075
  * Share scope name used for all shared modules (defaults to 'default').
@@ -4941,7 +5079,7 @@ declare interface ModuleFederationPluginOptions {
4941
5079
  /**
4942
5080
  * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
4943
5081
  */
4944
- shared?: Shared;
5082
+ shared?: (string | SharedObject)[] | SharedObject;
4945
5083
  }
4946
5084
  declare class ModuleGraph {
4947
5085
  constructor();
@@ -4975,29 +5113,29 @@ declare class ModuleGraph {
4975
5113
  ): void;
4976
5114
  addExtraReason(module: Module, explanation: string): void;
4977
5115
  getResolvedModule(dependency: Dependency): Module;
4978
- getConnection(dependency: Dependency): ModuleGraphConnection;
5116
+ getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
4979
5117
  getModule(dependency: Dependency): Module;
4980
5118
  getOrigin(dependency: Dependency): Module;
4981
5119
  getResolvedOrigin(dependency: Dependency): Module;
4982
5120
  getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
4983
5121
  getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
4984
- getProfile(module: Module): ModuleProfile;
4985
- setProfile(module: Module, profile: ModuleProfile): void;
4986
- getIssuer(module: Module): Module;
4987
- setIssuer(module: Module, issuer: Module): void;
4988
- setIssuerIfUnset(module: Module, issuer: Module): void;
5122
+ getProfile(module: Module): null | ModuleProfile;
5123
+ setProfile(module: Module, profile: null | ModuleProfile): void;
5124
+ getIssuer(module: Module): null | Module;
5125
+ setIssuer(module: Module, issuer: null | Module): void;
5126
+ setIssuerIfUnset(module: Module, issuer: null | Module): void;
4989
5127
  getOptimizationBailout(
4990
5128
  module: Module
4991
5129
  ): (string | ((requestShortener: RequestShortener) => string))[];
4992
- getProvidedExports(module: Module): true | string[];
4993
- isExportProvided(module: Module, exportName: EntryItem): boolean;
5130
+ getProvidedExports(module: Module): null | true | string[];
5131
+ isExportProvided(module: Module, exportName: EntryItem): null | boolean;
4994
5132
  getExportsInfo(module: Module): ExportsInfo;
4995
5133
  getExportInfo(module: Module, exportName: string): ExportInfo;
4996
5134
  getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
4997
5135
  getUsedExports(
4998
5136
  module: Module,
4999
5137
  runtime: RuntimeSpec
5000
- ): boolean | SortableSet<string>;
5138
+ ): null | boolean | SortableSet<string>;
5001
5139
  getPreOrderIndex(module: Module): number;
5002
5140
  getPostOrderIndex(module: Module): number;
5003
5141
  setPreOrderIndex(module: Module, index: number): void;
@@ -5009,7 +5147,7 @@ declare class ModuleGraph {
5009
5147
  setDepthIfLower(module: Module, depth: number): boolean;
5010
5148
  isAsync(module: Module): boolean;
5011
5149
  setAsync(module: Module): void;
5012
- getMeta(thing?: any): any;
5150
+ getMeta(thing?: any): Object;
5013
5151
  static getModuleGraphForModule(
5014
5152
  module: Module,
5015
5153
  deprecateMessage: string,
@@ -5023,8 +5161,8 @@ declare class ModuleGraph {
5023
5161
  }
5024
5162
  declare class ModuleGraphConnection {
5025
5163
  constructor(
5026
- originModule: Module,
5027
- dependency: Dependency,
5164
+ originModule: undefined | Module,
5165
+ dependency: undefined | Dependency,
5028
5166
  module: Module,
5029
5167
  explanation?: string,
5030
5168
  weak?: boolean,
@@ -5033,9 +5171,9 @@ declare class ModuleGraphConnection {
5033
5171
  arg1: RuntimeSpec
5034
5172
  ) => ConnectionState
5035
5173
  );
5036
- originModule: Module;
5037
- resolvedOriginModule: Module;
5038
- dependency: Dependency;
5174
+ originModule?: Module;
5175
+ resolvedOriginModule?: Module;
5176
+ dependency?: Dependency;
5039
5177
  resolvedModule: Module;
5040
5178
  module: Module;
5041
5179
  weak: boolean;
@@ -5172,25 +5310,25 @@ declare abstract class ModuleProfile {
5172
5310
  additionalFactories: number;
5173
5311
  additionalIntegration: number;
5174
5312
  markFactoryStart(): void;
5175
- factoryStartTime: number;
5313
+ factoryStartTime?: number;
5176
5314
  markFactoryEnd(): void;
5177
- factoryEndTime: number;
5315
+ factoryEndTime?: number;
5178
5316
  markRestoringStart(): void;
5179
- restoringStartTime: number;
5317
+ restoringStartTime?: number;
5180
5318
  markRestoringEnd(): void;
5181
- restoringEndTime: number;
5319
+ restoringEndTime?: number;
5182
5320
  markIntegrationStart(): void;
5183
- integrationStartTime: number;
5321
+ integrationStartTime?: number;
5184
5322
  markIntegrationEnd(): void;
5185
- integrationEndTime: number;
5323
+ integrationEndTime?: number;
5186
5324
  markBuildingStart(): void;
5187
- buildingStartTime: number;
5325
+ buildingStartTime?: number;
5188
5326
  markBuildingEnd(): void;
5189
- buildingEndTime: number;
5327
+ buildingEndTime?: number;
5190
5328
  markStoringStart(): void;
5191
- storingStartTime: number;
5329
+ storingStartTime?: number;
5192
5330
  markStoringEnd(): void;
5193
- storingEndTime: number;
5331
+ storingEndTime?: number;
5194
5332
 
5195
5333
  /**
5196
5334
  * Merge this profile into another one
@@ -5216,7 +5354,7 @@ declare interface ModuleReferenceOptions {
5216
5354
  /**
5217
5355
  * if the position is ASI safe or unknown
5218
5356
  */
5219
- asiSafe: boolean;
5357
+ asiSafe?: boolean;
5220
5358
  }
5221
5359
  declare abstract class ModuleTemplate {
5222
5360
  type: string;
@@ -5233,7 +5371,7 @@ declare class MultiCompiler {
5233
5371
  constructor(compilers: Compiler[] | Record<string, Compiler>);
5234
5372
  hooks: Readonly<{
5235
5373
  done: SyncHook<[MultiStats]>;
5236
- invalid: MultiHook<SyncHook<[string, number]>>;
5374
+ invalid: MultiHook<SyncHook<[null | string, number]>>;
5237
5375
  run: MultiHook<AsyncSeriesHook<[Compiler]>>;
5238
5376
  watchClose: SyncHook<[]>;
5239
5377
  watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
@@ -5392,11 +5530,11 @@ type NodeEstreeIndex =
5392
5530
  | MethodDefinition
5393
5531
  | VariableDeclarator
5394
5532
  | Program
5533
+ | Super
5395
5534
  | SwitchCase
5396
5535
  | CatchClause
5397
5536
  | Property
5398
5537
  | AssignmentProperty
5399
- | Super
5400
5538
  | TemplateElement
5401
5539
  | SpreadElement
5402
5540
  | ObjectPattern
@@ -5482,7 +5620,7 @@ declare class NormalModule extends Module {
5482
5620
  /**
5483
5621
  * path + query of the matched resource (virtual)
5484
5622
  */
5485
- matchResource: string;
5623
+ matchResource?: string;
5486
5624
  /**
5487
5625
  * the parser used
5488
5626
  */
@@ -5494,7 +5632,7 @@ declare class NormalModule extends Module {
5494
5632
  /**
5495
5633
  * options used for resolving requests from this module
5496
5634
  */
5497
- resolveOptions: any;
5635
+ resolveOptions: Object;
5498
5636
  });
5499
5637
  request: string;
5500
5638
  userRequest: string;
@@ -5503,15 +5641,15 @@ declare class NormalModule extends Module {
5503
5641
  parser: Parser;
5504
5642
  generator: Generator;
5505
5643
  resource: string;
5506
- matchResource: string;
5644
+ matchResource?: string;
5507
5645
  loaders: LoaderItem[];
5508
- error: WebpackError;
5646
+ error?: WebpackError;
5509
5647
  createSourceForAsset(
5510
5648
  context: string,
5511
5649
  name: string,
5512
5650
  content: string,
5513
5651
  sourceMap?: any,
5514
- associatedObjectForCache?: any
5652
+ associatedObjectForCache?: Object
5515
5653
  ): Source;
5516
5654
  createLoaderContext(
5517
5655
  resolver: ResolverWithOptions,
@@ -5519,19 +5657,19 @@ declare class NormalModule extends Module {
5519
5657
  compilation: Compilation,
5520
5658
  fs: InputFileSystem
5521
5659
  ): any;
5522
- getCurrentLoader(loaderContext?: any, index?: any): LoaderItem;
5660
+ getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
5523
5661
  createSource(
5524
5662
  context: string,
5525
5663
  content: string | Buffer,
5526
5664
  sourceMap?: any,
5527
- associatedObjectForCache?: any
5665
+ associatedObjectForCache?: Object
5528
5666
  ): Source;
5529
5667
  doBuild(
5530
5668
  options: WebpackOptionsNormalized,
5531
5669
  compilation: Compilation,
5532
5670
  resolver: ResolverWithOptions,
5533
5671
  fs: InputFileSystem,
5534
- callback: (arg0: WebpackError) => void
5672
+ callback: (arg0?: WebpackError) => void
5535
5673
  ): void;
5536
5674
  markModuleAsErrored(error: WebpackError): void;
5537
5675
  applyNoParseRule(rule?: any, content?: any): any;
@@ -5542,8 +5680,8 @@ declare class NormalModule extends Module {
5542
5680
  static deserialize(context?: any): NormalModule;
5543
5681
  }
5544
5682
  declare interface NormalModuleCompilationHooks {
5545
- loader: SyncHook<[any, NormalModule]>;
5546
- beforeLoaders: SyncHook<[LoaderItem[], NormalModule, any]>;
5683
+ loader: SyncHook<[{}, NormalModule]>;
5684
+ beforeLoaders: SyncHook<[LoaderItem[], NormalModule, {}]>;
5547
5685
  readResourceForScheme: HookMap<
5548
5686
  AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
5549
5687
  >;
@@ -5557,8 +5695,8 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
5557
5695
  factorize: AsyncSeriesBailHook<[ResolveData], any>;
5558
5696
  beforeResolve: AsyncSeriesBailHook<[ResolveData], any>;
5559
5697
  afterResolve: AsyncSeriesBailHook<[ResolveData], any>;
5560
- createModule: AsyncSeriesBailHook<[any, ResolveData], any>;
5561
- module: SyncWaterfallHook<[Module, any, ResolveData], any>;
5698
+ createModule: AsyncSeriesBailHook<[Object, ResolveData], any>;
5699
+ module: SyncWaterfallHook<[Module, Object, ResolveData], any>;
5562
5700
  createParser: HookMap<SyncBailHook<any, any>>;
5563
5701
  parser: HookMap<SyncHook<any>>;
5564
5702
  createGenerator: HookMap<SyncBailHook<any, any>>;
@@ -5570,8 +5708,8 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
5570
5708
  cachePredicate: Function;
5571
5709
  context: string;
5572
5710
  fs: InputFileSystem;
5573
- parserCache: Map<string, WeakMap<any, any>>;
5574
- generatorCache: Map<string, WeakMap<any, Generator>>;
5711
+ parserCache: Map<string, WeakMap<Object, any>>;
5712
+ generatorCache: Map<string, WeakMap<Object, Generator>>;
5575
5713
  resolveResource(
5576
5714
  contextInfo?: any,
5577
5715
  context?: any,
@@ -5590,7 +5728,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
5590
5728
  ): any;
5591
5729
  getParser(type?: any, parserOptions?: {}): any;
5592
5730
  createParser(type: string, parserOptions?: { [index: string]: any }): Parser;
5593
- getGenerator(type?: any, generatorOptions?: {}): Generator;
5731
+ getGenerator(type?: any, generatorOptions?: {}): undefined | Generator;
5594
5732
  createGenerator(type?: any, generatorOptions?: {}): any;
5595
5733
  getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
5596
5734
  }
@@ -5733,7 +5871,7 @@ declare interface Optimization {
5733
5871
  /**
5734
5872
  * Set process.env.NODE_ENV to a specific value.
5735
5873
  */
5736
- nodeEnv?: DevTool;
5874
+ nodeEnv?: string | false;
5737
5875
 
5738
5876
  /**
5739
5877
  * Generate records with relative paths to be able to move the context folder.
@@ -5763,7 +5901,16 @@ declare interface Optimization {
5763
5901
  /**
5764
5902
  * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
5765
5903
  */
5766
- runtimeChunk?: OptimizationRuntimeChunk;
5904
+ runtimeChunk?:
5905
+ | boolean
5906
+ | "single"
5907
+ | "multiple"
5908
+ | {
5909
+ /**
5910
+ * The name or name factory for the runtime chunks.
5911
+ */
5912
+ name?: string | Function;
5913
+ };
5767
5914
 
5768
5915
  /**
5769
5916
  * Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).
@@ -5780,16 +5927,6 @@ declare interface Optimization {
5780
5927
  */
5781
5928
  usedExports?: boolean | "global";
5782
5929
  }
5783
- type OptimizationRuntimeChunk =
5784
- | boolean
5785
- | "single"
5786
- | "multiple"
5787
- | {
5788
- /**
5789
- * The name or name factory for the runtime chunks.
5790
- */
5791
- name?: DevtoolFallbackModuleFilenameTemplate;
5792
- };
5793
5930
 
5794
5931
  /**
5795
5932
  * Options object for describing behavior of a cache group selecting modules that should be cached together.
@@ -5813,7 +5950,7 @@ declare interface OptimizationSplitChunksCacheGroup {
5813
5950
  /**
5814
5951
  * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
5815
5952
  */
5816
- enforceSizeThreshold?: OptimizationSplitChunksSizes;
5953
+ enforceSizeThreshold?: number | { [index: string]: number };
5817
5954
 
5818
5955
  /**
5819
5956
  * Sets the template for the filename for created chunks.
@@ -5833,7 +5970,7 @@ declare interface OptimizationSplitChunksCacheGroup {
5833
5970
  /**
5834
5971
  * Maximal size hint for the on-demand chunks.
5835
5972
  */
5836
- maxAsyncSize?: OptimizationSplitChunksSizes;
5973
+ maxAsyncSize?: number | { [index: string]: number };
5837
5974
 
5838
5975
  /**
5839
5976
  * Maximum number of initial chunks which are accepted for an entry point.
@@ -5843,12 +5980,12 @@ declare interface OptimizationSplitChunksCacheGroup {
5843
5980
  /**
5844
5981
  * Maximal size hint for the initial chunks.
5845
5982
  */
5846
- maxInitialSize?: OptimizationSplitChunksSizes;
5983
+ maxInitialSize?: number | { [index: string]: number };
5847
5984
 
5848
5985
  /**
5849
5986
  * Maximal size hint for the created chunks.
5850
5987
  */
5851
- maxSize?: OptimizationSplitChunksSizes;
5988
+ maxSize?: number | { [index: string]: number };
5852
5989
 
5853
5990
  /**
5854
5991
  * Minimum number of times a module has to be duplicated until it's considered for splitting.
@@ -5858,12 +5995,12 @@ declare interface OptimizationSplitChunksCacheGroup {
5858
5995
  /**
5859
5996
  * Minimal size for the chunks the stay after moving the modules to a new chunk.
5860
5997
  */
5861
- minRemainingSize?: OptimizationSplitChunksSizes;
5998
+ minRemainingSize?: number | { [index: string]: number };
5862
5999
 
5863
6000
  /**
5864
6001
  * Minimal size for the created chunk.
5865
6002
  */
5866
- minSize?: OptimizationSplitChunksSizes;
6003
+ minSize?: number | { [index: string]: number };
5867
6004
 
5868
6005
  /**
5869
6006
  * Give chunks for this cache group a name (chunks with equal name are merged).
@@ -5930,7 +6067,7 @@ declare interface OptimizationSplitChunksOptions {
5930
6067
  /**
5931
6068
  * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
5932
6069
  */
5933
- enforceSizeThreshold?: OptimizationSplitChunksSizes;
6070
+ enforceSizeThreshold?: number | { [index: string]: number };
5934
6071
 
5935
6072
  /**
5936
6073
  * Options for modules not selected by any other cache group.
@@ -5943,19 +6080,19 @@ declare interface OptimizationSplitChunksOptions {
5943
6080
  /**
5944
6081
  * Maximal size hint for the on-demand chunks.
5945
6082
  */
5946
- maxAsyncSize?: OptimizationSplitChunksSizes;
6083
+ maxAsyncSize?: number | { [index: string]: number };
5947
6084
  /**
5948
6085
  * Maximal size hint for the initial chunks.
5949
6086
  */
5950
- maxInitialSize?: OptimizationSplitChunksSizes;
6087
+ maxInitialSize?: number | { [index: string]: number };
5951
6088
  /**
5952
6089
  * Maximal size hint for the created chunks.
5953
6090
  */
5954
- maxSize?: OptimizationSplitChunksSizes;
6091
+ maxSize?: number | { [index: string]: number };
5955
6092
  /**
5956
6093
  * Minimal size for the created chunk.
5957
6094
  */
5958
- minSize?: OptimizationSplitChunksSizes;
6095
+ minSize?: number | { [index: string]: number };
5959
6096
  };
5960
6097
 
5961
6098
  /**
@@ -5976,7 +6113,7 @@ declare interface OptimizationSplitChunksOptions {
5976
6113
  /**
5977
6114
  * Maximal size hint for the on-demand chunks.
5978
6115
  */
5979
- maxAsyncSize?: OptimizationSplitChunksSizes;
6116
+ maxAsyncSize?: number | { [index: string]: number };
5980
6117
 
5981
6118
  /**
5982
6119
  * Maximum number of initial chunks which are accepted for an entry point.
@@ -5986,12 +6123,12 @@ declare interface OptimizationSplitChunksOptions {
5986
6123
  /**
5987
6124
  * Maximal size hint for the initial chunks.
5988
6125
  */
5989
- maxInitialSize?: OptimizationSplitChunksSizes;
6126
+ maxInitialSize?: number | { [index: string]: number };
5990
6127
 
5991
6128
  /**
5992
6129
  * Maximal size hint for the created chunks.
5993
6130
  */
5994
- maxSize?: OptimizationSplitChunksSizes;
6131
+ maxSize?: number | { [index: string]: number };
5995
6132
 
5996
6133
  /**
5997
6134
  * Minimum number of times a module has to be duplicated until it's considered for splitting.
@@ -6001,12 +6138,12 @@ declare interface OptimizationSplitChunksOptions {
6001
6138
  /**
6002
6139
  * Minimal size for the chunks the stay after moving the modules to a new chunk.
6003
6140
  */
6004
- minRemainingSize?: OptimizationSplitChunksSizes;
6141
+ minRemainingSize?: number | { [index: string]: number };
6005
6142
 
6006
6143
  /**
6007
6144
  * Minimal size for the created chunks.
6008
6145
  */
6009
- minSize?: OptimizationSplitChunksSizes;
6146
+ minSize?: number | { [index: string]: number };
6010
6147
 
6011
6148
  /**
6012
6149
  * Give chunks created a name (chunks with equal name are merged).
@@ -6018,7 +6155,6 @@ declare interface OptimizationSplitChunksOptions {
6018
6155
  */
6019
6156
  usedExports?: boolean;
6020
6157
  }
6021
- type OptimizationSplitChunksSizes = number | { [index: string]: number };
6022
6158
  declare abstract class OptionsApply {
6023
6159
  process(options?: any, compiler?: any): void;
6024
6160
  }
@@ -6039,12 +6175,14 @@ declare interface Output {
6039
6175
  /**
6040
6176
  * The filename of asset modules as relative path inside the `output.path` directory.
6041
6177
  */
6042
- assetModuleFilename?: AssetModuleFilename;
6178
+ assetModuleFilename?:
6179
+ | string
6180
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6043
6181
 
6044
6182
  /**
6045
6183
  * Add a comment in the UMD wrapper.
6046
6184
  */
6047
- auxiliaryComment?: AuxiliaryComment;
6185
+ auxiliaryComment?: string | LibraryCustomUmdCommentObject;
6048
6186
 
6049
6187
  /**
6050
6188
  * Add charset attribute for script tag.
@@ -6054,12 +6192,14 @@ declare interface Output {
6054
6192
  /**
6055
6193
  * The filename of non-initial chunks as relative path inside the `output.path` directory.
6056
6194
  */
6057
- chunkFilename?: ChunkFilename;
6195
+ chunkFilename?:
6196
+ | string
6197
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6058
6198
 
6059
6199
  /**
6060
6200
  * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
6061
6201
  */
6062
- chunkFormat?: DevTool;
6202
+ chunkFormat?: string | false;
6063
6203
 
6064
6204
  /**
6065
6205
  * Number of milliseconds before chunk request expires.
@@ -6069,7 +6209,7 @@ declare interface Output {
6069
6209
  /**
6070
6210
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
6071
6211
  */
6072
- chunkLoading?: DevTool;
6212
+ chunkLoading?: string | false;
6073
6213
 
6074
6214
  /**
6075
6215
  * The global variable used by webpack for loading of chunks.
@@ -6084,17 +6224,17 @@ declare interface Output {
6084
6224
  /**
6085
6225
  * This option enables cross-origin loading of chunks.
6086
6226
  */
6087
- crossOriginLoading?: CrossOriginLoading;
6227
+ crossOriginLoading?: false | "anonymous" | "use-credentials";
6088
6228
 
6089
6229
  /**
6090
6230
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
6091
6231
  */
6092
- devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
6232
+ devtoolFallbackModuleFilenameTemplate?: string | Function;
6093
6233
 
6094
6234
  /**
6095
6235
  * Filename template string of function for the sources array in a generated SourceMap.
6096
6236
  */
6097
- devtoolModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
6237
+ devtoolModuleFilenameTemplate?: string | Function;
6098
6238
 
6099
6239
  /**
6100
6240
  * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
@@ -6124,7 +6264,7 @@ declare interface Output {
6124
6264
  /**
6125
6265
  * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
6126
6266
  */
6127
- filename?: Filename;
6267
+ filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6128
6268
 
6129
6269
  /**
6130
6270
  * An expression which is used to address the global object/scope in runtime code.
@@ -6144,7 +6284,7 @@ declare interface Output {
6144
6284
  /**
6145
6285
  * Algorithm used for generation the hash (see node.js crypto package).
6146
6286
  */
6147
- hashFunction?: HashFunction;
6287
+ hashFunction?: string | typeof Hash;
6148
6288
 
6149
6289
  /**
6150
6290
  * Any string which is added to the hash to salt it.
@@ -6184,12 +6324,12 @@ declare interface Output {
6184
6324
  /**
6185
6325
  * Make the output files a library, exporting the exports of the entry point.
6186
6326
  */
6187
- library?: Library;
6327
+ library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
6188
6328
 
6189
6329
  /**
6190
6330
  * Specify which export should be exposed as library.
6191
6331
  */
6192
- libraryExport?: EntryItem;
6332
+ libraryExport?: string | string[];
6193
6333
 
6194
6334
  /**
6195
6335
  * 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).
@@ -6209,17 +6349,17 @@ declare interface Output {
6209
6349
  /**
6210
6350
  * Include comments with information about the modules.
6211
6351
  */
6212
- pathinfo?: Pathinfo;
6352
+ pathinfo?: boolean | "verbose";
6213
6353
 
6214
6354
  /**
6215
6355
  * The `publicPath` specifies the public URL address of the output files when referenced in a browser.
6216
6356
  */
6217
- publicPath?: PublicPath;
6357
+ publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6218
6358
 
6219
6359
  /**
6220
6360
  * This option enables loading async chunks via a custom script type, such as script type="module".
6221
6361
  */
6222
- scriptType?: ScriptType;
6362
+ scriptType?: false | "module" | "text/javascript";
6223
6363
 
6224
6364
  /**
6225
6365
  * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory.
@@ -6249,7 +6389,7 @@ declare interface Output {
6249
6389
  /**
6250
6390
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
6251
6391
  */
6252
- wasmLoading?: DevTool;
6392
+ wasmLoading?: string | false;
6253
6393
 
6254
6394
  /**
6255
6395
  * The filename of WebAssembly modules as relative path inside the `output.path` directory.
@@ -6259,27 +6399,27 @@ declare interface Output {
6259
6399
  /**
6260
6400
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
6261
6401
  */
6262
- workerChunkLoading?: DevTool;
6402
+ workerChunkLoading?: string | false;
6263
6403
 
6264
6404
  /**
6265
6405
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
6266
6406
  */
6267
- workerWasmLoading?: DevTool;
6407
+ workerWasmLoading?: string | false;
6268
6408
  }
6269
6409
  declare interface OutputFileSystem {
6270
6410
  writeFile: (
6271
6411
  arg0: string,
6272
6412
  arg1: string | Buffer,
6273
- arg2: (arg0: NodeJS.ErrnoException) => void
6413
+ arg2: (arg0?: NodeJS.ErrnoException) => void
6274
6414
  ) => void;
6275
- mkdir: (arg0: string, arg1: (arg0: NodeJS.ErrnoException) => void) => void;
6415
+ mkdir: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
6276
6416
  stat: (
6277
6417
  arg0: string,
6278
- arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void
6418
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: FsStats) => void
6279
6419
  ) => void;
6280
6420
  readFile: (
6281
6421
  arg0: string,
6282
- arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void
6422
+ arg1: (arg0?: NodeJS.ErrnoException, arg1?: Buffer) => void
6283
6423
  ) => void;
6284
6424
  join?: (arg0: string, arg1: string) => string;
6285
6425
  relative?: (arg0: string, arg1: string) => string;
@@ -6293,7 +6433,9 @@ declare interface OutputNormalized {
6293
6433
  /**
6294
6434
  * The filename of asset modules as relative path inside the `output.path` directory.
6295
6435
  */
6296
- assetModuleFilename?: AssetModuleFilename;
6436
+ assetModuleFilename?:
6437
+ | string
6438
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6297
6439
 
6298
6440
  /**
6299
6441
  * Add charset attribute for script tag.
@@ -6303,12 +6445,14 @@ declare interface OutputNormalized {
6303
6445
  /**
6304
6446
  * The filename of non-initial chunks as relative path inside the `output.path` directory.
6305
6447
  */
6306
- chunkFilename?: ChunkFilename;
6448
+ chunkFilename?:
6449
+ | string
6450
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6307
6451
 
6308
6452
  /**
6309
6453
  * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
6310
6454
  */
6311
- chunkFormat?: DevTool;
6455
+ chunkFormat?: string | false;
6312
6456
 
6313
6457
  /**
6314
6458
  * Number of milliseconds before chunk request expires.
@@ -6318,7 +6462,7 @@ declare interface OutputNormalized {
6318
6462
  /**
6319
6463
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
6320
6464
  */
6321
- chunkLoading?: DevTool;
6465
+ chunkLoading?: string | false;
6322
6466
 
6323
6467
  /**
6324
6468
  * The global variable used by webpack for loading of chunks.
@@ -6333,17 +6477,17 @@ declare interface OutputNormalized {
6333
6477
  /**
6334
6478
  * This option enables cross-origin loading of chunks.
6335
6479
  */
6336
- crossOriginLoading?: CrossOriginLoading;
6480
+ crossOriginLoading?: false | "anonymous" | "use-credentials";
6337
6481
 
6338
6482
  /**
6339
6483
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
6340
6484
  */
6341
- devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
6485
+ devtoolFallbackModuleFilenameTemplate?: string | Function;
6342
6486
 
6343
6487
  /**
6344
6488
  * Filename template string of function for the sources array in a generated SourceMap.
6345
6489
  */
6346
- devtoolModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
6490
+ devtoolModuleFilenameTemplate?: string | Function;
6347
6491
 
6348
6492
  /**
6349
6493
  * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
@@ -6373,7 +6517,7 @@ declare interface OutputNormalized {
6373
6517
  /**
6374
6518
  * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
6375
6519
  */
6376
- filename?: Filename;
6520
+ filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6377
6521
 
6378
6522
  /**
6379
6523
  * An expression which is used to address the global object/scope in runtime code.
@@ -6393,7 +6537,7 @@ declare interface OutputNormalized {
6393
6537
  /**
6394
6538
  * Algorithm used for generation the hash (see node.js crypto package).
6395
6539
  */
6396
- hashFunction?: HashFunction;
6540
+ hashFunction?: string | typeof Hash;
6397
6541
 
6398
6542
  /**
6399
6543
  * Any string which is added to the hash to salt it.
@@ -6448,17 +6592,17 @@ declare interface OutputNormalized {
6448
6592
  /**
6449
6593
  * Include comments with information about the modules.
6450
6594
  */
6451
- pathinfo?: Pathinfo;
6595
+ pathinfo?: boolean | "verbose";
6452
6596
 
6453
6597
  /**
6454
6598
  * The `publicPath` specifies the public URL address of the output files when referenced in a browser.
6455
6599
  */
6456
- publicPath?: PublicPath;
6600
+ publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6457
6601
 
6458
6602
  /**
6459
6603
  * This option enables loading async chunks via a custom script type, such as script type="module".
6460
6604
  */
6461
- scriptType?: ScriptType;
6605
+ scriptType?: false | "module" | "text/javascript";
6462
6606
 
6463
6607
  /**
6464
6608
  * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory.
@@ -6483,7 +6627,7 @@ declare interface OutputNormalized {
6483
6627
  /**
6484
6628
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
6485
6629
  */
6486
- wasmLoading?: DevTool;
6630
+ wasmLoading?: string | false;
6487
6631
 
6488
6632
  /**
6489
6633
  * The filename of WebAssembly modules as relative path inside the `output.path` directory.
@@ -6493,12 +6637,12 @@ declare interface OutputNormalized {
6493
6637
  /**
6494
6638
  * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
6495
6639
  */
6496
- workerChunkLoading?: DevTool;
6640
+ workerChunkLoading?: string | false;
6497
6641
 
6498
6642
  /**
6499
6643
  * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
6500
6644
  */
6501
- workerWasmLoading?: DevTool;
6645
+ workerWasmLoading?: string | false;
6502
6646
  }
6503
6647
  declare interface ParameterizedComparator<TArg, T> {
6504
6648
  (arg0: TArg): Comparator<T>;
@@ -6542,8 +6686,6 @@ declare interface PathData {
6542
6686
  noChunkHash?: boolean;
6543
6687
  url?: string;
6544
6688
  }
6545
- type Pathinfo = boolean | "verbose";
6546
- type Performance = false | PerformanceOptions;
6547
6689
 
6548
6690
  /**
6549
6691
  * Configuration object for web performance recommendations.
@@ -6638,15 +6780,15 @@ declare interface ProfilingPluginOptions {
6638
6780
  }
6639
6781
  declare class ProgressPlugin {
6640
6782
  constructor(options: ProgressPluginArgument);
6641
- profile: boolean;
6642
- handler: (percentage: number, msg: string, ...args: string[]) => void;
6643
- modulesCount: number;
6644
- dependenciesCount: number;
6645
- showEntries: boolean;
6646
- showModules: boolean;
6647
- showDependencies: boolean;
6648
- showActiveModules: boolean;
6649
- percentBy: "modules" | "dependencies" | "entries";
6783
+ profile?: null | boolean;
6784
+ handler?: (percentage: number, msg: string, ...args: string[]) => void;
6785
+ modulesCount?: number;
6786
+ dependenciesCount?: number;
6787
+ showEntries?: boolean;
6788
+ showModules?: boolean;
6789
+ showDependencies?: boolean;
6790
+ showActiveModules?: boolean;
6791
+ percentBy?: null | "dependencies" | "modules" | "entries";
6650
6792
  apply(compiler: Compiler | MultiCompiler): void;
6651
6793
  static getReporter(
6652
6794
  compiler: Compiler
@@ -6707,12 +6849,12 @@ declare interface ProgressPluginOptions {
6707
6849
  /**
6708
6850
  * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
6709
6851
  */
6710
- percentBy?: "modules" | "dependencies" | "entries";
6852
+ percentBy?: null | "dependencies" | "modules" | "entries";
6711
6853
 
6712
6854
  /**
6713
6855
  * Collect profile data for progress steps. Default: false.
6714
6856
  */
6715
- profile?: boolean;
6857
+ profile?: null | boolean;
6716
6858
  }
6717
6859
  declare class ProvidePlugin {
6718
6860
  constructor(definitions: Record<string, EntryItem>);
@@ -6766,7 +6908,7 @@ declare interface ProvidesConfig {
6766
6908
  /**
6767
6909
  * Version of the provided module. Will replace lower matching versions, but not higher.
6768
6910
  */
6769
- version?: DevTool;
6911
+ version?: string | false;
6770
6912
  }
6771
6913
 
6772
6914
  /**
@@ -6775,9 +6917,6 @@ declare interface ProvidesConfig {
6775
6917
  declare interface ProvidesObject {
6776
6918
  [index: string]: string | ProvidesConfig;
6777
6919
  }
6778
- type PublicPath =
6779
- | string
6780
- | ((pathData: PathData, assetInfo?: AssetInfo) => string);
6781
6920
  declare interface RawChunkGroupOptions {
6782
6921
  preloadOrder?: number;
6783
6922
  prefetchOrder?: number;
@@ -6945,7 +7084,7 @@ declare interface RenderManifestEntryStatic {
6945
7084
  }
6946
7085
  declare interface RenderManifestEntryTemplated {
6947
7086
  render: () => Source;
6948
- filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo) => string);
7087
+ filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
6949
7088
  pathOptions?: PathData;
6950
7089
  info?: AssetInfo;
6951
7090
  identifier: string;
@@ -6983,24 +7122,8 @@ declare class ReplaceSource extends Source {
6983
7122
  }
6984
7123
  declare abstract class RequestShortener {
6985
7124
  contextify: (arg0: string) => string;
6986
- shorten(request: string): string;
7125
+ shorten(request?: null | string): undefined | null | string;
6987
7126
  }
6988
- type ResolveAlias =
6989
- | {
6990
- /**
6991
- * New request.
6992
- */
6993
- alias: Target;
6994
- /**
6995
- * Request to be redirected.
6996
- */
6997
- name: string;
6998
- /**
6999
- * Redirect only exact matching request.
7000
- */
7001
- onlyModule?: boolean;
7002
- }[]
7003
- | { [index: string]: Target };
7004
7127
  declare interface ResolveBuildDependenciesResult {
7005
7128
  /**
7006
7129
  * list of files
@@ -7069,11 +7192,11 @@ declare interface ResolveContext {
7069
7192
  }
7070
7193
  declare interface ResolveData {
7071
7194
  contextInfo: ModuleFactoryCreateDataContextInfo;
7072
- resolveOptions: ResolveOptionsWebpackOptions;
7195
+ resolveOptions?: ResolveOptionsWebpackOptions;
7073
7196
  context: string;
7074
7197
  request: string;
7075
7198
  dependencies: ModuleDependency[];
7076
- createData: any;
7199
+ createData: Object;
7077
7200
  fileDependencies: LazySet<string>;
7078
7201
  missingDependencies: LazySet<string>;
7079
7202
  contextDependencies: LazySet<string>;
@@ -7136,7 +7259,7 @@ declare interface ResolveOptionsTypes {
7136
7259
  | { apply: (arg0: Resolver) => void }
7137
7260
  | ((this: Resolver, arg1: Resolver) => void)
7138
7261
  )[];
7139
- pnpApi: PnpApiImpl;
7262
+ pnpApi: null | PnpApiImpl;
7140
7263
  roots: Set<string>;
7141
7264
  fullySpecified: boolean;
7142
7265
  resolveToContext: boolean;
@@ -7151,7 +7274,22 @@ declare interface ResolveOptionsWebpackOptions {
7151
7274
  /**
7152
7275
  * Redirect module requests.
7153
7276
  */
7154
- alias?: ResolveAlias;
7277
+ alias?:
7278
+ | {
7279
+ /**
7280
+ * New request.
7281
+ */
7282
+ alias: Target;
7283
+ /**
7284
+ * Request to be redirected.
7285
+ */
7286
+ name: string;
7287
+ /**
7288
+ * Redirect only exact matching request.
7289
+ */
7290
+ onlyModule?: boolean;
7291
+ }[]
7292
+ | { [index: string]: Target };
7155
7293
 
7156
7294
  /**
7157
7295
  * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
@@ -7206,7 +7344,22 @@ declare interface ResolveOptionsWebpackOptions {
7206
7344
  /**
7207
7345
  * Redirect module requests when normal resolving fails.
7208
7346
  */
7209
- fallback?: ResolveAlias;
7347
+ fallback?:
7348
+ | {
7349
+ /**
7350
+ * New request.
7351
+ */
7352
+ alias: Target;
7353
+ /**
7354
+ * Request to be redirected.
7355
+ */
7356
+ name: string;
7357
+ /**
7358
+ * Redirect only exact matching request.
7359
+ */
7360
+ onlyModule?: boolean;
7361
+ }[]
7362
+ | { [index: string]: Target };
7210
7363
 
7211
7364
  /**
7212
7365
  * Filesystem for the resolver.
@@ -7286,7 +7439,22 @@ declare interface ResolveOptionsWithDependencyType {
7286
7439
  /**
7287
7440
  * Redirect module requests.
7288
7441
  */
7289
- alias?: ResolveAlias;
7442
+ alias?:
7443
+ | {
7444
+ /**
7445
+ * New request.
7446
+ */
7447
+ alias: Target;
7448
+ /**
7449
+ * Request to be redirected.
7450
+ */
7451
+ name: string;
7452
+ /**
7453
+ * Redirect only exact matching request.
7454
+ */
7455
+ onlyModule?: boolean;
7456
+ }[]
7457
+ | { [index: string]: Target };
7290
7458
 
7291
7459
  /**
7292
7460
  * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
@@ -7341,7 +7509,22 @@ declare interface ResolveOptionsWithDependencyType {
7341
7509
  /**
7342
7510
  * Redirect module requests when normal resolving fails.
7343
7511
  */
7344
- fallback?: ResolveAlias;
7512
+ fallback?:
7513
+ | {
7514
+ /**
7515
+ * New request.
7516
+ */
7517
+ alias: Target;
7518
+ /**
7519
+ * Request to be redirected.
7520
+ */
7521
+ name: string;
7522
+ /**
7523
+ * Redirect only exact matching request.
7524
+ */
7525
+ onlyModule?: boolean;
7526
+ }[]
7527
+ | { [index: string]: Target };
7345
7528
 
7346
7529
  /**
7347
7530
  * Filesystem for the resolver.
@@ -7434,34 +7617,53 @@ declare abstract class Resolver {
7434
7617
  hooks: {
7435
7618
  resolveStep: SyncHook<
7436
7619
  [
7437
- AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest>,
7620
+ AsyncSeriesBailHook<
7621
+ [ResolveRequest, ResolveContext],
7622
+ null | ResolveRequest
7623
+ >,
7438
7624
  ResolveRequest
7439
7625
  ]
7440
7626
  >;
7441
7627
  noResolve: SyncHook<[ResolveRequest, Error]>;
7442
7628
  resolve: AsyncSeriesBailHook<
7443
7629
  [ResolveRequest, ResolveContext],
7444
- ResolveRequest
7630
+ null | ResolveRequest
7445
7631
  >;
7446
7632
  result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
7447
7633
  };
7448
7634
  ensureHook(
7449
7635
  name:
7450
7636
  | string
7451
- | AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest>
7452
- ): AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest>;
7637
+ | AsyncSeriesBailHook<
7638
+ [ResolveRequest, ResolveContext],
7639
+ null | ResolveRequest
7640
+ >
7641
+ ): AsyncSeriesBailHook<
7642
+ [ResolveRequest, ResolveContext],
7643
+ null | ResolveRequest
7644
+ >;
7453
7645
  getHook(
7454
7646
  name:
7455
7647
  | string
7456
- | AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest>
7457
- ): AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest>;
7648
+ | AsyncSeriesBailHook<
7649
+ [ResolveRequest, ResolveContext],
7650
+ null | ResolveRequest
7651
+ >
7652
+ ): AsyncSeriesBailHook<
7653
+ [ResolveRequest, ResolveContext],
7654
+ null | ResolveRequest
7655
+ >;
7458
7656
  resolveSync(context: any, path: string, request: string): DevTool;
7459
7657
  resolve(
7460
7658
  context: any,
7461
7659
  path: string,
7462
7660
  request: string,
7463
7661
  resolveContext: ResolveContext,
7464
- callback: (arg0: Error, arg1?: DevTool, arg2?: ResolveRequest) => void
7662
+ callback: (
7663
+ arg0: null | Error,
7664
+ arg1?: string | false,
7665
+ arg2?: ResolveRequest
7666
+ ) => void
7465
7667
  ): void;
7466
7668
  doResolve(
7467
7669
  hook?: any,
@@ -7478,7 +7680,7 @@ declare abstract class Resolver {
7478
7680
  normalize(path?: any): string;
7479
7681
  }
7480
7682
  declare interface ResolverCache {
7481
- direct: WeakMap<any, ResolverWithOptions>;
7683
+ direct: WeakMap<Object, ResolverWithOptions>;
7482
7684
  stringified: Map<string, ResolverWithOptions>;
7483
7685
  }
7484
7686
  declare abstract class ResolverFactory {
@@ -7514,7 +7716,7 @@ declare interface RuleSet {
7514
7716
  /**
7515
7717
  * execute the rule set
7516
7718
  */
7517
- exec: (arg0?: any) => Effect[];
7719
+ exec: (arg0: {}) => Effect[];
7518
7720
  }
7519
7721
  type RuleSetCondition =
7520
7722
  | string
@@ -7554,7 +7756,6 @@ type RuleSetConditionAbsolute =
7554
7756
  }
7555
7757
  | ((value: string) => boolean)
7556
7758
  | RuleSetConditionAbsolute[];
7557
- type RuleSetLoaderOptions = string | { [index: string]: any };
7558
7759
 
7559
7760
  /**
7560
7761
  * A rule description with conditions and effects for modules.
@@ -7563,12 +7764,48 @@ declare interface RuleSetRule {
7563
7764
  /**
7564
7765
  * Match the child compiler name.
7565
7766
  */
7566
- compiler?: RuleSetCondition;
7767
+ compiler?:
7768
+ | string
7769
+ | RegExp
7770
+ | {
7771
+ /**
7772
+ * Logical AND.
7773
+ */
7774
+ and?: RuleSetCondition[];
7775
+ /**
7776
+ * Logical NOT.
7777
+ */
7778
+ not?: RuleSetCondition[];
7779
+ /**
7780
+ * Logical OR.
7781
+ */
7782
+ or?: RuleSetCondition[];
7783
+ }
7784
+ | ((value: string) => boolean)
7785
+ | RuleSetCondition[];
7567
7786
 
7568
7787
  /**
7569
7788
  * Match dependency type.
7570
7789
  */
7571
- dependency?: RuleSetCondition;
7790
+ dependency?:
7791
+ | string
7792
+ | RegExp
7793
+ | {
7794
+ /**
7795
+ * Logical AND.
7796
+ */
7797
+ and?: RuleSetCondition[];
7798
+ /**
7799
+ * Logical NOT.
7800
+ */
7801
+ not?: RuleSetCondition[];
7802
+ /**
7803
+ * Logical OR.
7804
+ */
7805
+ or?: RuleSetCondition[];
7806
+ }
7807
+ | ((value: string) => boolean)
7808
+ | RuleSetCondition[];
7572
7809
 
7573
7810
  /**
7574
7811
  * Match values of properties in the description file (usually package.json).
@@ -7583,7 +7820,25 @@ declare interface RuleSetRule {
7583
7820
  /**
7584
7821
  * Shortcut for resource.exclude.
7585
7822
  */
7586
- exclude?: RuleSetConditionAbsolute;
7823
+ exclude?:
7824
+ | string
7825
+ | RegExp
7826
+ | {
7827
+ /**
7828
+ * Logical AND.
7829
+ */
7830
+ and?: RuleSetConditionAbsolute[];
7831
+ /**
7832
+ * Logical NOT.
7833
+ */
7834
+ not?: RuleSetConditionAbsolute[];
7835
+ /**
7836
+ * Logical OR.
7837
+ */
7838
+ or?: RuleSetConditionAbsolute[];
7839
+ }
7840
+ | ((value: string) => boolean)
7841
+ | RuleSetConditionAbsolute[];
7587
7842
 
7588
7843
  /**
7589
7844
  * The options for the module generator.
@@ -7593,12 +7848,48 @@ declare interface RuleSetRule {
7593
7848
  /**
7594
7849
  * Shortcut for resource.include.
7595
7850
  */
7596
- include?: RuleSetConditionAbsolute;
7851
+ include?:
7852
+ | string
7853
+ | RegExp
7854
+ | {
7855
+ /**
7856
+ * Logical AND.
7857
+ */
7858
+ and?: RuleSetConditionAbsolute[];
7859
+ /**
7860
+ * Logical NOT.
7861
+ */
7862
+ not?: RuleSetConditionAbsolute[];
7863
+ /**
7864
+ * Logical OR.
7865
+ */
7866
+ or?: RuleSetConditionAbsolute[];
7867
+ }
7868
+ | ((value: string) => boolean)
7869
+ | RuleSetConditionAbsolute[];
7597
7870
 
7598
7871
  /**
7599
7872
  * Match the issuer of the module (The module pointing to this module).
7600
7873
  */
7601
- issuer?: RuleSetConditionAbsolute;
7874
+ issuer?:
7875
+ | string
7876
+ | RegExp
7877
+ | {
7878
+ /**
7879
+ * Logical AND.
7880
+ */
7881
+ and?: RuleSetConditionAbsolute[];
7882
+ /**
7883
+ * Logical NOT.
7884
+ */
7885
+ not?: RuleSetConditionAbsolute[];
7886
+ /**
7887
+ * Logical OR.
7888
+ */
7889
+ or?: RuleSetConditionAbsolute[];
7890
+ }
7891
+ | ((value: string) => boolean)
7892
+ | RuleSetConditionAbsolute[];
7602
7893
 
7603
7894
  /**
7604
7895
  * Shortcut for use.loader.
@@ -7608,7 +7899,25 @@ declare interface RuleSetRule {
7608
7899
  /**
7609
7900
  * Match module mimetype when load from Data URI.
7610
7901
  */
7611
- mimetype?: RuleSetCondition;
7902
+ mimetype?:
7903
+ | string
7904
+ | RegExp
7905
+ | {
7906
+ /**
7907
+ * Logical AND.
7908
+ */
7909
+ and?: RuleSetCondition[];
7910
+ /**
7911
+ * Logical NOT.
7912
+ */
7913
+ not?: RuleSetCondition[];
7914
+ /**
7915
+ * Logical OR.
7916
+ */
7917
+ or?: RuleSetCondition[];
7918
+ }
7919
+ | ((value: string) => boolean)
7920
+ | RuleSetCondition[];
7612
7921
 
7613
7922
  /**
7614
7923
  * Only execute the first matching rule in this array.
@@ -7618,7 +7927,7 @@ declare interface RuleSetRule {
7618
7927
  /**
7619
7928
  * Shortcut for use.options.
7620
7929
  */
7621
- options?: RuleSetLoaderOptions;
7930
+ options?: string | { [index: string]: any };
7622
7931
 
7623
7932
  /**
7624
7933
  * Options for parsing.
@@ -7628,7 +7937,25 @@ declare interface RuleSetRule {
7628
7937
  /**
7629
7938
  * Match the real resource path of the module.
7630
7939
  */
7631
- realResource?: RuleSetConditionAbsolute;
7940
+ realResource?:
7941
+ | string
7942
+ | RegExp
7943
+ | {
7944
+ /**
7945
+ * Logical AND.
7946
+ */
7947
+ and?: RuleSetConditionAbsolute[];
7948
+ /**
7949
+ * Logical NOT.
7950
+ */
7951
+ not?: RuleSetConditionAbsolute[];
7952
+ /**
7953
+ * Logical OR.
7954
+ */
7955
+ or?: RuleSetConditionAbsolute[];
7956
+ }
7957
+ | ((value: string) => boolean)
7958
+ | RuleSetConditionAbsolute[];
7632
7959
 
7633
7960
  /**
7634
7961
  * Options for the resolver.
@@ -7638,17 +7965,71 @@ declare interface RuleSetRule {
7638
7965
  /**
7639
7966
  * Match the resource path of the module.
7640
7967
  */
7641
- resource?: RuleSetConditionAbsolute;
7968
+ resource?:
7969
+ | string
7970
+ | RegExp
7971
+ | {
7972
+ /**
7973
+ * Logical AND.
7974
+ */
7975
+ and?: RuleSetConditionAbsolute[];
7976
+ /**
7977
+ * Logical NOT.
7978
+ */
7979
+ not?: RuleSetConditionAbsolute[];
7980
+ /**
7981
+ * Logical OR.
7982
+ */
7983
+ or?: RuleSetConditionAbsolute[];
7984
+ }
7985
+ | ((value: string) => boolean)
7986
+ | RuleSetConditionAbsolute[];
7642
7987
 
7643
7988
  /**
7644
7989
  * Match the resource fragment of the module.
7645
7990
  */
7646
- resourceFragment?: RuleSetCondition;
7991
+ resourceFragment?:
7992
+ | string
7993
+ | RegExp
7994
+ | {
7995
+ /**
7996
+ * Logical AND.
7997
+ */
7998
+ and?: RuleSetCondition[];
7999
+ /**
8000
+ * Logical NOT.
8001
+ */
8002
+ not?: RuleSetCondition[];
8003
+ /**
8004
+ * Logical OR.
8005
+ */
8006
+ or?: RuleSetCondition[];
8007
+ }
8008
+ | ((value: string) => boolean)
8009
+ | RuleSetCondition[];
7647
8010
 
7648
8011
  /**
7649
8012
  * Match the resource query of the module.
7650
8013
  */
7651
- resourceQuery?: RuleSetCondition;
8014
+ resourceQuery?:
8015
+ | string
8016
+ | RegExp
8017
+ | {
8018
+ /**
8019
+ * Logical AND.
8020
+ */
8021
+ and?: RuleSetCondition[];
8022
+ /**
8023
+ * Logical NOT.
8024
+ */
8025
+ not?: RuleSetCondition[];
8026
+ /**
8027
+ * Logical OR.
8028
+ */
8029
+ or?: RuleSetCondition[];
8030
+ }
8031
+ | ((value: string) => boolean)
8032
+ | RuleSetCondition[];
7652
8033
 
7653
8034
  /**
7654
8035
  * Match and execute these rules when this rule is matched.
@@ -7663,7 +8044,25 @@ declare interface RuleSetRule {
7663
8044
  /**
7664
8045
  * Shortcut for resource.test.
7665
8046
  */
7666
- test?: RuleSetConditionAbsolute;
8047
+ test?:
8048
+ | string
8049
+ | RegExp
8050
+ | {
8051
+ /**
8052
+ * Logical AND.
8053
+ */
8054
+ and?: RuleSetConditionAbsolute[];
8055
+ /**
8056
+ * Logical NOT.
8057
+ */
8058
+ not?: RuleSetConditionAbsolute[];
8059
+ /**
8060
+ * Logical OR.
8061
+ */
8062
+ or?: RuleSetConditionAbsolute[];
8063
+ }
8064
+ | ((value: string) => boolean)
8065
+ | RuleSetConditionAbsolute[];
7667
8066
 
7668
8067
  /**
7669
8068
  * Module type to use for the module.
@@ -7673,7 +8072,48 @@ declare interface RuleSetRule {
7673
8072
  /**
7674
8073
  * Modifiers applied to the module when rule is matched.
7675
8074
  */
7676
- use?: RuleSetUse;
8075
+ use?:
8076
+ | string
8077
+ | RuleSetUseItem[]
8078
+ | ((data: {
8079
+ resource: string;
8080
+ realResource: string;
8081
+ resourceQuery: string;
8082
+ issuer: string;
8083
+ compiler: string;
8084
+ }) => RuleSetUseItem[])
8085
+ | {
8086
+ /**
8087
+ * Unique loader options identifier.
8088
+ */
8089
+ ident?: string;
8090
+ /**
8091
+ * Loader name.
8092
+ */
8093
+ loader?: string;
8094
+ /**
8095
+ * Loader options.
8096
+ */
8097
+ options?: string | { [index: string]: any };
8098
+ }
8099
+ | ((data: {}) =>
8100
+ | string
8101
+ | {
8102
+ /**
8103
+ * Unique loader options identifier.
8104
+ */
8105
+ ident?: string;
8106
+ /**
8107
+ * Loader name.
8108
+ */
8109
+ loader?: string;
8110
+ /**
8111
+ * Loader options.
8112
+ */
8113
+ options?: string | { [index: string]: any };
8114
+ }
8115
+ | __TypeWebpackOptions
8116
+ | RuleSetUseItem[]);
7677
8117
  }
7678
8118
  type RuleSetUse =
7679
8119
  | string
@@ -7697,26 +8137,9 @@ type RuleSetUse =
7697
8137
  /**
7698
8138
  * Loader options.
7699
8139
  */
7700
- options?: RuleSetLoaderOptions;
8140
+ options?: string | { [index: string]: any };
7701
8141
  }
7702
- | ((data: {}) =>
7703
- | string
7704
- | {
7705
- /**
7706
- * Unique loader options identifier.
7707
- */
7708
- ident?: string;
7709
- /**
7710
- * Loader name.
7711
- */
7712
- loader?: string;
7713
- /**
7714
- * Loader options.
7715
- */
7716
- options?: RuleSetLoaderOptions;
7717
- }
7718
- | __TypeWebpackOptions
7719
- | RuleSetUseItem[]);
8142
+ | __TypeWebpackOptions;
7720
8143
  type RuleSetUseItem =
7721
8144
  | string
7722
8145
  | {
@@ -7731,10 +8154,9 @@ type RuleSetUseItem =
7731
8154
  /**
7732
8155
  * Loader options.
7733
8156
  */
7734
- options?: RuleSetLoaderOptions;
8157
+ options?: string | { [index: string]: any };
7735
8158
  }
7736
8159
  | __TypeWebpackOptions;
7737
- type Rules = string | RegExp | (string | RegExp)[];
7738
8160
  declare class RuntimeChunkPlugin {
7739
8161
  constructor(options?: any);
7740
8162
  options: any;
@@ -7776,7 +8198,7 @@ declare class RuntimeModule extends Module {
7776
8198
  */
7777
8199
  static STAGE_TRIGGER: number;
7778
8200
  }
7779
- type RuntimeSpec = string | SortableSet<string>;
8201
+ type RuntimeSpec = undefined | string | SortableSet<string>;
7780
8202
  declare abstract class RuntimeSpecMap<T> {
7781
8203
  get(runtime: RuntimeSpec): T;
7782
8204
  has(runtime: RuntimeSpec): boolean;
@@ -7795,15 +8217,15 @@ declare abstract class RuntimeSpecSet {
7795
8217
  declare abstract class RuntimeTemplate {
7796
8218
  outputOptions: OutputNormalized;
7797
8219
  requestShortener: RequestShortener;
7798
- isIIFE(): boolean;
7799
- isModule(): boolean;
7800
- supportsConst(): boolean;
7801
- supportsArrowFunction(): boolean;
7802
- supportsForOf(): boolean;
7803
- supportsDestructuring(): boolean;
7804
- supportsBigIntLiteral(): boolean;
7805
- supportsDynamicImport(): boolean;
7806
- supportsEcmaScriptModuleSyntax(): boolean;
8220
+ isIIFE(): undefined | boolean;
8221
+ isModule(): undefined | boolean;
8222
+ supportsConst(): undefined | boolean;
8223
+ supportsArrowFunction(): undefined | boolean;
8224
+ supportsForOf(): undefined | boolean;
8225
+ supportsDestructuring(): undefined | boolean;
8226
+ supportsBigIntLiteral(): undefined | boolean;
8227
+ supportsDynamicImport(): undefined | boolean;
8228
+ supportsEcmaScriptModuleSyntax(): undefined | boolean;
7807
8229
  supportTemplateLiteral(): boolean;
7808
8230
  returningFunction(returnValue?: any, args?: string): string;
7809
8231
  basicFunction(args?: any, body?: any): string;
@@ -8087,7 +8509,7 @@ declare abstract class RuntimeTemplate {
8087
8509
  /**
8088
8510
  * true, if location is safe for ASI, a bracket can be emitted
8089
8511
  */
8090
- asiSafe: boolean;
8512
+ asiSafe?: boolean;
8091
8513
  /**
8092
8514
  * true, if expression will be called
8093
8515
  */
@@ -8187,6 +8609,10 @@ declare abstract class RuntimeValue {
8187
8609
  fileDependencies: any;
8188
8610
  exec(parser?: any): any;
8189
8611
  }
8612
+ type Schema =
8613
+ | (JSONSchema4 & Extend)
8614
+ | (JSONSchema6 & Extend)
8615
+ | (JSONSchema7 & Extend);
8190
8616
  declare interface ScopeInfo {
8191
8617
  definitions: StackedMap<string, ScopeInfo | VariableInfo>;
8192
8618
  topLevelScope: boolean | "arrow";
@@ -8195,7 +8621,6 @@ declare interface ScopeInfo {
8195
8621
  isAsmJs: boolean;
8196
8622
  inTry: boolean;
8197
8623
  }
8198
- type ScriptType = false | "module" | "text/javascript";
8199
8624
  declare interface Selector<A, B> {
8200
8625
  (input: A): B;
8201
8626
  }
@@ -8243,7 +8668,7 @@ declare interface SharedConfig {
8243
8668
  /**
8244
8669
  * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
8245
8670
  */
8246
- import?: DevTool;
8671
+ import?: string | false;
8247
8672
 
8248
8673
  /**
8249
8674
  * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
@@ -8253,7 +8678,7 @@ declare interface SharedConfig {
8253
8678
  /**
8254
8679
  * Version requirement from module in share scope.
8255
8680
  */
8256
- requiredVersion?: DevTool;
8681
+ requiredVersion?: string | false;
8257
8682
 
8258
8683
  /**
8259
8684
  * Module is looked up under this key from the share scope.
@@ -8278,7 +8703,7 @@ declare interface SharedConfig {
8278
8703
  /**
8279
8704
  * Version of the provided module. Will replace lower matching versions, but not higher.
8280
8705
  */
8281
- version?: DevTool;
8706
+ version?: string | false;
8282
8707
  }
8283
8708
 
8284
8709
  /**
@@ -8304,19 +8729,19 @@ declare class SizeOnlySource extends Source {
8304
8729
  constructor(size: number);
8305
8730
  }
8306
8731
  declare abstract class Snapshot {
8307
- startTime: number;
8308
- fileTimestamps: Map<string, FileSystemInfoEntry>;
8309
- fileHashes: Map<string, string>;
8310
- fileTshs: Map<string, string | TimestampAndHash>;
8311
- contextTimestamps: Map<string, FileSystemInfoEntry>;
8312
- contextHashes: Map<string, string>;
8313
- contextTshs: Map<string, string | TimestampAndHash>;
8314
- missingExistence: Map<string, boolean>;
8315
- managedItemInfo: Map<string, string>;
8316
- managedFiles: Set<string>;
8317
- managedContexts: Set<string>;
8318
- managedMissing: Set<string>;
8319
- children: Set<Snapshot>;
8732
+ startTime?: number;
8733
+ fileTimestamps?: Map<string, FileSystemInfoEntry>;
8734
+ fileHashes?: Map<string, string>;
8735
+ fileTshs?: Map<string, string | TimestampAndHash>;
8736
+ contextTimestamps?: Map<string, FileSystemInfoEntry>;
8737
+ contextHashes?: Map<string, string>;
8738
+ contextTshs?: Map<string, string | TimestampAndHash>;
8739
+ missingExistence?: Map<string, boolean>;
8740
+ managedItemInfo?: Map<string, string>;
8741
+ managedFiles?: Set<string>;
8742
+ managedContexts?: Set<string>;
8743
+ managedMissing?: Set<string>;
8744
+ children?: Set<Snapshot>;
8320
8745
  hasStartTime(): boolean;
8321
8746
  setStartTime(value?: any): void;
8322
8747
  setMergedStartTime(value?: any, snapshot?: any): void;
@@ -8481,7 +8906,7 @@ declare interface SourceMapDevToolPluginOptions {
8481
8906
  /**
8482
8907
  * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
8483
8908
  */
8484
- append?: DevTool;
8909
+ append?: null | string | false;
8485
8910
 
8486
8911
  /**
8487
8912
  * Indicates whether column mappings should be used (defaults to true).
@@ -8491,12 +8916,12 @@ declare interface SourceMapDevToolPluginOptions {
8491
8916
  /**
8492
8917
  * Exclude modules that match the given value from source map generation.
8493
8918
  */
8494
- exclude?: Rules;
8919
+ exclude?: string | RegExp | (string | RegExp)[];
8495
8920
 
8496
8921
  /**
8497
8922
  * 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.
8498
8923
  */
8499
- fallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
8924
+ fallbackModuleFilenameTemplate?: string | Function;
8500
8925
 
8501
8926
  /**
8502
8927
  * Path prefix to which the [file] placeholder is relative to.
@@ -8506,12 +8931,12 @@ declare interface SourceMapDevToolPluginOptions {
8506
8931
  /**
8507
8932
  * Defines the output filename of the SourceMap (will be inlined if no value is provided).
8508
8933
  */
8509
- filename?: DevTool;
8934
+ filename?: null | string | false;
8510
8935
 
8511
8936
  /**
8512
8937
  * Include source maps for module paths that match the given value.
8513
8938
  */
8514
- include?: Rules;
8939
+ include?: string | RegExp | (string | RegExp)[];
8515
8940
 
8516
8941
  /**
8517
8942
  * Indicates whether SourceMaps from loaders should be used (defaults to true).
@@ -8521,7 +8946,7 @@ declare interface SourceMapDevToolPluginOptions {
8521
8946
  /**
8522
8947
  * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
8523
8948
  */
8524
- moduleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
8949
+ moduleFilenameTemplate?: string | Function;
8525
8950
 
8526
8951
  /**
8527
8952
  * Namespace prefix to allow multiple webpack roots in the devtools.
@@ -8546,7 +8971,7 @@ declare interface SourceMapDevToolPluginOptions {
8546
8971
  /**
8547
8972
  * Include source maps for modules based on their extension (defaults to .js and .css).
8548
8973
  */
8549
- test?: Rules;
8974
+ test?: string | RegExp | (string | RegExp)[];
8550
8975
  }
8551
8976
  declare class SourceMapSource extends Source {
8552
8977
  constructor(
@@ -8554,9 +8979,17 @@ declare class SourceMapSource extends Source {
8554
8979
  name: string,
8555
8980
  sourceMap: string | Object | Buffer,
8556
8981
  originalSource?: string | Buffer,
8557
- innerSourceMap?: string | Object | Buffer
8982
+ innerSourceMap?: string | Object | Buffer,
8983
+ removeOriginalSource?: boolean
8558
8984
  );
8559
- getArgsAsBuffers(): [Buffer, string, Buffer, Buffer, Buffer];
8985
+ getArgsAsBuffers(): [
8986
+ Buffer,
8987
+ string,
8988
+ Buffer,
8989
+ undefined | Buffer,
8990
+ undefined | Buffer,
8991
+ boolean
8992
+ ];
8560
8993
  }
8561
8994
  declare interface SourcePosition {
8562
8995
  line: number;
@@ -8574,13 +9007,17 @@ declare interface SplitChunksOptions {
8574
9007
  maxAsyncRequests: number;
8575
9008
  maxInitialRequests: number;
8576
9009
  hidePathInfo: boolean;
8577
- filename: string | ((arg0: PathData, arg1: AssetInfo) => string);
9010
+ filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
8578
9011
  automaticNameDelimiter: string;
8579
9012
  getCacheGroups: (
8580
9013
  module: Module,
8581
9014
  context: CacheGroupsContext
8582
9015
  ) => CacheGroupSource[];
8583
- getName: (module?: Module, chunks?: Chunk[], key?: string) => string;
9016
+ getName: (
9017
+ module?: Module,
9018
+ chunks?: Chunk[],
9019
+ key?: string
9020
+ ) => undefined | string;
8584
9021
  usedExports: boolean;
8585
9022
  fallbackCacheGroup: FallbackCacheGroup;
8586
9023
  }
@@ -8599,11 +9036,11 @@ declare abstract class StackedMap<K, V> {
8599
9036
  set(item: K, value: V): void;
8600
9037
  delete(item: K): void;
8601
9038
  has(item: K): boolean;
8602
- get(item: K): V;
9039
+ get(item: K): Cell<V>;
8603
9040
  asArray(): K[];
8604
9041
  asSet(): Set<K>;
8605
- asPairArray(): [K, V][];
8606
- asMap(): Map<K, V>;
9042
+ asPairArray(): [K, Cell<V>][];
9043
+ asMap(): Map<K, Cell<V>>;
8607
9044
  readonly size: number;
8608
9045
  createChild(): StackedMap<K, V>;
8609
9046
  }
@@ -8632,7 +9069,7 @@ type Statement =
8632
9069
  declare class Stats {
8633
9070
  constructor(compilation: Compilation);
8634
9071
  compilation: Compilation;
8635
- readonly hash: string;
9072
+ readonly hash?: string;
8636
9073
  readonly startTime: any;
8637
9074
  readonly endTime: any;
8638
9075
  hasWarnings(): boolean;
@@ -8642,21 +9079,21 @@ declare class Stats {
8642
9079
  }
8643
9080
  declare abstract class StatsFactory {
8644
9081
  hooks: Readonly<{
8645
- extract: HookMap<SyncBailHook<[any, any, any], any>>;
8646
- filter: HookMap<SyncBailHook<[any, any, number, number], any>>;
9082
+ extract: HookMap<SyncBailHook<[Object, any, Object], any>>;
9083
+ filter: HookMap<SyncBailHook<[any, Object, number, number], any>>;
8647
9084
  sort: HookMap<
8648
- SyncBailHook<[((arg0?: any, arg1?: any) => number)[], any], any>
9085
+ SyncBailHook<[((arg0?: any, arg1?: any) => number)[], Object], any>
8649
9086
  >;
8650
- filterSorted: HookMap<SyncBailHook<[any, any, number, number], any>>;
8651
- groupResults: HookMap<SyncBailHook<[GroupConfig<any, any>[], any], any>>;
9087
+ filterSorted: HookMap<SyncBailHook<[any, Object, number, number], any>>;
9088
+ groupResults: HookMap<SyncBailHook<[GroupConfig<any, {}>[], Object], any>>;
8652
9089
  sortResults: HookMap<
8653
- SyncBailHook<[((arg0?: any, arg1?: any) => number)[], any], any>
9090
+ SyncBailHook<[((arg0?: any, arg1?: any) => number)[], Object], any>
8654
9091
  >;
8655
9092
  filterResults: HookMap<SyncBailHook<any, any>>;
8656
- merge: HookMap<SyncBailHook<[any[], any], any>>;
8657
- result: HookMap<SyncBailHook<[any[], any], any>>;
8658
- getItemName: HookMap<SyncBailHook<[any, any], any>>;
8659
- getItemFactory: HookMap<SyncBailHook<[any, any], any>>;
9093
+ merge: HookMap<SyncBailHook<[any[], Object], any>>;
9094
+ result: HookMap<SyncBailHook<[any[], Object], any>>;
9095
+ getItemName: HookMap<SyncBailHook<[any, Object], any>>;
9096
+ getItemFactory: HookMap<SyncBailHook<[any, Object], any>>;
8660
9097
  }>;
8661
9098
  create(type?: any, data?: any, baseContext?: any): any;
8662
9099
  }
@@ -8845,7 +9282,11 @@ declare interface StatsOptions {
8845
9282
  /**
8846
9283
  * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
8847
9284
  */
8848
- excludeAssets?: FilterTypes;
9285
+ excludeAssets?:
9286
+ | string
9287
+ | RegExp
9288
+ | FilterItemTypes[]
9289
+ | ((value: string) => boolean);
8849
9290
 
8850
9291
  /**
8851
9292
  * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
@@ -9045,7 +9486,11 @@ declare interface StatsOptions {
9045
9486
  /**
9046
9487
  * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
9047
9488
  */
9048
- warningsFilter?: FilterTypes;
9489
+ warningsFilter?:
9490
+ | string
9491
+ | RegExp
9492
+ | FilterItemTypes[]
9493
+ | ((value: string) => boolean);
9049
9494
  }
9050
9495
  declare abstract class StatsPrinter {
9051
9496
  hooks: Readonly<{
@@ -9057,7 +9502,7 @@ declare abstract class StatsPrinter {
9057
9502
  print: HookMap<SyncBailHook<[{}, {}], string>>;
9058
9503
  result: HookMap<SyncWaterfallHook<[string, {}]>>;
9059
9504
  }>;
9060
- print(type: string, object?: any, baseContext?: any): string;
9505
+ print(type: string, object: Object, baseContext?: Object): string;
9061
9506
  }
9062
9507
  type StatsValue =
9063
9508
  | boolean
@@ -9079,7 +9524,7 @@ declare const TRANSITIVE_ONLY: unique symbol;
9079
9524
  declare interface TagInfo {
9080
9525
  tag: any;
9081
9526
  data: any;
9082
- next: TagInfo;
9527
+ next?: TagInfo;
9083
9528
  }
9084
9529
  type Target = string | false | string[];
9085
9530
  declare class Template {
@@ -9132,7 +9577,7 @@ declare interface UpdateHashContextGenerator {
9132
9577
  chunkGraph: ChunkGraph;
9133
9578
  runtime: RuntimeSpec;
9134
9579
  }
9135
- type UsageStateType = 0 | 1 | 2 | 3 | 4;
9580
+ type UsageStateType = 0 | 2 | 3 | 1 | 4;
9136
9581
  declare interface UserResolveOptions {
9137
9582
  /**
9138
9583
  * A list of module alias configurations or an object which maps key to value
@@ -9242,7 +9687,7 @@ declare interface UserResolveOptions {
9242
9687
  /**
9243
9688
  * A list of directories to resolve modules from, can be absolute path or folder name
9244
9689
  */
9245
- modules?: EntryItem;
9690
+ modules?: string | string[];
9246
9691
 
9247
9692
  /**
9248
9693
  * A list of main fields in description files
@@ -9269,7 +9714,7 @@ declare interface UserResolveOptions {
9269
9714
  /**
9270
9715
  * A PnP API that should be used - null is "never", undefined is "auto"
9271
9716
  */
9272
- pnpApi?: PnpApiImpl;
9717
+ pnpApi?: null | PnpApiImpl;
9273
9718
 
9274
9719
  /**
9275
9720
  * A list of root paths
@@ -9304,12 +9749,12 @@ declare interface UserResolveOptions {
9304
9749
  declare abstract class VariableInfo {
9305
9750
  declaredScope: ScopeInfo;
9306
9751
  freeName: string | true;
9307
- tagInfo: TagInfo;
9752
+ tagInfo?: TagInfo;
9308
9753
  }
9309
9754
  declare interface VariableInfoInterface {
9310
9755
  declaredScope: ScopeInfo;
9311
9756
  freeName: string | true;
9312
- tagInfo: TagInfo;
9757
+ tagInfo?: TagInfo;
9313
9758
  }
9314
9759
  declare interface WatchFileSystem {
9315
9760
  watch: (
@@ -9319,7 +9764,7 @@ declare interface WatchFileSystem {
9319
9764
  startTime: number,
9320
9765
  options: WatchOptions,
9321
9766
  callback: (
9322
- arg0: Error,
9767
+ arg0: undefined | Error,
9323
9768
  arg1: Map<string, FileSystemInfoEntry>,
9324
9769
  arg2: Map<string, FileSystemInfoEntry>,
9325
9770
  arg3: Set<string>,
@@ -9395,7 +9840,7 @@ declare interface Watcher {
9395
9840
  getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry>;
9396
9841
  }
9397
9842
  declare abstract class Watching {
9398
- startTime: number;
9843
+ startTime: null | number;
9399
9844
  invalid: boolean;
9400
9845
  handler: CallbackFunction<Stats>;
9401
9846
  callbacks: CallbackFunction<void>[];
@@ -9445,7 +9890,11 @@ declare class WebWorkerTemplatePlugin {
9445
9890
  */
9446
9891
  apply(compiler: Compiler): void;
9447
9892
  }
9448
- declare interface WebpackError extends Error {
9893
+ declare class WebpackError extends Error {
9894
+ /**
9895
+ * Creates an instance of WebpackError.
9896
+ */
9897
+ constructor(message?: string);
9449
9898
  details: any;
9450
9899
  module: Module;
9451
9900
  loc: DependencyLocation;
@@ -9454,6 +9903,20 @@ declare interface WebpackError extends Error {
9454
9903
  file: string;
9455
9904
  serialize(__0: { write: any }): void;
9456
9905
  deserialize(__0: { read: any }): void;
9906
+
9907
+ /**
9908
+ * Create .stack property on a target object
9909
+ */
9910
+ static captureStackTrace(targetObject: {}, constructorOpt?: Function): void;
9911
+
9912
+ /**
9913
+ * Optional override for formatting stack traces
9914
+ */
9915
+ static prepareStackTrace?: (
9916
+ err: Error,
9917
+ stackTraces: NodeJS.CallSite[]
9918
+ ) => any;
9919
+ static stackTraceLimit: number;
9457
9920
  }
9458
9921
  declare abstract class WebpackLogger {
9459
9922
  getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
@@ -9492,7 +9955,7 @@ declare interface WebpackOptionsNormalized {
9492
9955
  /**
9493
9956
  * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
9494
9957
  */
9495
- amd?: Amd;
9958
+ amd?: false | { [index: string]: any };
9496
9959
 
9497
9960
  /**
9498
9961
  * Report the first error as a hard error instead of tolerating it.
@@ -9522,7 +9985,7 @@ declare interface WebpackOptionsNormalized {
9522
9985
  /**
9523
9986
  * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
9524
9987
  */
9525
- devtool?: DevTool;
9988
+ devtool?: string | false;
9526
9989
 
9527
9990
  /**
9528
9991
  * The entry point(s) of the compilation.
@@ -9547,7 +10010,26 @@ declare interface WebpackOptionsNormalized {
9547
10010
  /**
9548
10011
  * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
9549
10012
  */
9550
- externalsType?: ExternalsType;
10013
+ externalsType?:
10014
+ | "var"
10015
+ | "module"
10016
+ | "assign"
10017
+ | "this"
10018
+ | "window"
10019
+ | "self"
10020
+ | "global"
10021
+ | "commonjs"
10022
+ | "commonjs2"
10023
+ | "commonjs-module"
10024
+ | "amd"
10025
+ | "amd-require"
10026
+ | "umd"
10027
+ | "umd2"
10028
+ | "jsonp"
10029
+ | "system"
10030
+ | "promise"
10031
+ | "import"
10032
+ | "script";
9551
10033
 
9552
10034
  /**
9553
10035
  * Ignore specific warnings.
@@ -9570,7 +10052,7 @@ declare interface WebpackOptionsNormalized {
9570
10052
  /**
9571
10053
  * Enable production optimizations or development hints.
9572
10054
  */
9573
- mode?: Mode;
10055
+ mode?: "development" | "production" | "none";
9574
10056
 
9575
10057
  /**
9576
10058
  * Options affecting the normal modules (`NormalModuleFactory`).
@@ -9605,7 +10087,7 @@ declare interface WebpackOptionsNormalized {
9605
10087
  /**
9606
10088
  * Configuration for web performance recommendations.
9607
10089
  */
9608
- performance?: Performance;
10090
+ performance?: false | PerformanceOptions;
9609
10091
 
9610
10092
  /**
9611
10093
  * Add additional plugins to the compiler.
@@ -9623,12 +10105,12 @@ declare interface WebpackOptionsNormalized {
9623
10105
  /**
9624
10106
  * Store compiler state to a json file.
9625
10107
  */
9626
- recordsInputPath?: DevTool;
10108
+ recordsInputPath?: string | false;
9627
10109
 
9628
10110
  /**
9629
10111
  * Load compiler state from a json file.
9630
10112
  */
9631
- recordsOutputPath?: DevTool;
10113
+ recordsOutputPath?: string | false;
9632
10114
 
9633
10115
  /**
9634
10116
  * Options for the resolver.
@@ -9653,7 +10135,7 @@ declare interface WebpackOptionsNormalized {
9653
10135
  /**
9654
10136
  * Environment to build for. An array of environments to build for all of them when possible.
9655
10137
  */
9656
- target?: Target;
10138
+ target?: string | false | string[];
9657
10139
 
9658
10140
  /**
9659
10141
  * Enter watch mode, which rebuilds on file change.
@@ -9702,7 +10184,7 @@ type __TypeWebpackOptions = (data: {}) =>
9702
10184
  /**
9703
10185
  * Loader options.
9704
10186
  */
9705
- options?: RuleSetLoaderOptions;
10187
+ options?: string | { [index: string]: any };
9706
10188
  }
9707
10189
  | __TypeWebpackOptions
9708
10190
  | RuleSetUseItem[];
@@ -9723,7 +10205,11 @@ declare namespace exports {
9723
10205
  ): MultiCompiler;
9724
10206
  };
9725
10207
  export const validate: (options?: any) => void;
9726
- export const validateSchema: (schema?: any, options?: any) => void;
10208
+ export const validateSchema: (
10209
+ schema: Schema,
10210
+ options: {} | {}[],
10211
+ validationConfiguration?: ValidationErrorConfiguration
10212
+ ) => void;
9727
10213
  export const version: string;
9728
10214
  export namespace cli {
9729
10215
  export let getArguments: (schema?: any) => Record<string, Argument>;
@@ -9738,7 +10224,7 @@ declare namespace exports {
9738
10224
  | RegExp
9739
10225
  | (string | number | boolean | RegExp)[]
9740
10226
  >
9741
- ) => Problem[];
10227
+ ) => null | Problem[];
9742
10228
  }
9743
10229
  export namespace ModuleFilenameHelpers {
9744
10230
  export let ALL_LOADERS_RESOURCE: string;
@@ -10094,6 +10580,7 @@ declare namespace exports {
10094
10580
  Stats,
10095
10581
  Template,
10096
10582
  WatchIgnorePlugin,
10583
+ WebpackError,
10097
10584
  WebpackOptionsApply,
10098
10585
  WebpackOptionsDefaulter,
10099
10586
  Entry,
@@ -10109,6 +10596,8 @@ declare namespace exports {
10109
10596
  Configuration,
10110
10597
  WebpackOptionsNormalized,
10111
10598
  WebpackPluginInstance,
10599
+ Asset,
10600
+ AssetInfo,
10112
10601
  ParserState
10113
10602
  };
10114
10603
  }