webpack 5.14.0 → 5.18.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.

Files changed (71) hide show
  1. package/bin/webpack.js +0 -0
  2. package/hot/lazy-compilation-node.js +38 -0
  3. package/hot/lazy-compilation-web.js +74 -0
  4. package/lib/AutomaticPrefetchPlugin.js +14 -7
  5. package/lib/CacheFacade.js +1 -0
  6. package/lib/ChunkGraph.js +132 -19
  7. package/lib/CodeGenerationResults.js +43 -8
  8. package/lib/Compilation.js +253 -149
  9. package/lib/Compiler.js +7 -2
  10. package/lib/ContextModule.js +2 -2
  11. package/lib/Dependency.js +1 -7
  12. package/lib/ExportsInfo.js +23 -5
  13. package/lib/ExternalModuleFactoryPlugin.js +46 -3
  14. package/lib/FileSystemInfo.js +192 -137
  15. package/lib/HotModuleReplacementPlugin.js +76 -29
  16. package/lib/IgnoreErrorModuleFactory.js +39 -0
  17. package/lib/Module.js +2 -3
  18. package/lib/NormalModuleFactory.js +27 -8
  19. package/lib/Template.js +32 -23
  20. package/lib/WebpackIsIncludedPlugin.js +85 -0
  21. package/lib/WebpackOptionsApply.js +27 -5
  22. package/lib/cache/PackFileCacheStrategy.js +5 -1
  23. package/lib/config/defaults.js +18 -18
  24. package/lib/config/normalization.js +44 -9
  25. package/lib/debug/ProfilingPlugin.js +20 -1
  26. package/lib/dependencies/AMDDefineDependency.js +1 -1
  27. package/lib/dependencies/AMDPlugin.js +6 -7
  28. package/lib/dependencies/CommonJsImportsParserPlugin.js +43 -1
  29. package/lib/dependencies/CommonJsPlugin.js +1 -6
  30. package/lib/dependencies/ContextDependencyHelpers.js +3 -2
  31. package/lib/dependencies/ExportsInfoDependency.js +0 -20
  32. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +1 -2
  33. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +0 -29
  34. package/lib/dependencies/HarmonyImportDependency.js +0 -41
  35. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +2 -3
  36. package/lib/dependencies/HarmonyImportSpecifierDependency.js +2 -36
  37. package/lib/dependencies/HarmonyModulesPlugin.js +2 -2
  38. package/lib/dependencies/ImportPlugin.js +1 -6
  39. package/lib/dependencies/JsonExportsDependency.js +0 -1
  40. package/lib/dependencies/ModuleDecoratorDependency.js +0 -1
  41. package/lib/dependencies/NullDependency.js +0 -8
  42. package/lib/dependencies/ProvidedDependency.js +0 -1
  43. package/lib/dependencies/StaticExportsDependency.js +0 -12
  44. package/lib/dependencies/SystemPlugin.js +0 -4
  45. package/lib/dependencies/URLDependency.js +45 -3
  46. package/lib/dependencies/URLPlugin.js +33 -7
  47. package/lib/dependencies/WebpackIsIncludedDependency.js +80 -0
  48. package/lib/hmr/LazyCompilationPlugin.js +348 -0
  49. package/lib/hmr/lazyCompilationBackend.js +86 -0
  50. package/lib/javascript/JavascriptModulesPlugin.js +4 -3
  51. package/lib/javascript/JavascriptParser.js +20 -5
  52. package/lib/library/AssignLibraryPlugin.js +13 -4
  53. package/lib/library/EnableLibraryPlugin.js +12 -0
  54. package/lib/optimize/ConcatenatedModule.js +0 -12
  55. package/lib/optimize/InnerGraph.js +32 -0
  56. package/lib/optimize/SplitChunksPlugin.js +4 -1
  57. package/lib/serialization/ObjectMiddleware.js +7 -5
  58. package/lib/sharing/ProvideSharedModule.js +1 -1
  59. package/lib/sharing/ShareRuntimeModule.js +2 -2
  60. package/lib/stats/DefaultStatsPresetPlugin.js +1 -0
  61. package/lib/util/MapHelpers.js +22 -0
  62. package/lib/util/binarySearchBounds.js +86 -0
  63. package/lib/util/createHash.js +13 -7
  64. package/lib/util/internalSerializables.js +2 -0
  65. package/lib/util/processAsyncTree.js +61 -0
  66. package/lib/util/runtime.js +12 -1
  67. package/package.json +3 -3
  68. package/schemas/WebpackOptions.json +330 -140
  69. package/schemas/plugins/container/ContainerPlugin.json +2 -1
  70. package/schemas/plugins/container/ModuleFederationPlugin.json +2 -1
  71. package/types.d.ts +320 -121
package/types.d.ts CHANGED
@@ -799,6 +799,9 @@ declare class ChunkGraph {
799
799
  getChunkFullHashModulesIterable(
800
800
  chunk: Chunk
801
801
  ): undefined | Iterable<RuntimeModule>;
802
+ getChunkFullHashModulesSet(
803
+ chunk: Chunk
804
+ ): undefined | ReadonlySet<RuntimeModule>;
802
805
  getChunkEntryModulesWithChunkGroupIterable(
803
806
  chunk: Chunk
804
807
  ): Iterable<[Module, undefined | Entrypoint]>;
@@ -833,6 +836,11 @@ declare class ChunkGraph {
833
836
  runtime: RuntimeSpec
834
837
  ): ReadonlySet<string>;
835
838
  getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
839
+ getModuleGraphHash(
840
+ module?: any,
841
+ runtime?: any,
842
+ withConnections?: boolean
843
+ ): any;
836
844
  getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
837
845
  static getChunkGraphForModule(
838
846
  module: Module,
@@ -1063,16 +1071,24 @@ declare interface CodeGenerationResult {
1063
1071
  * the runtime requirements
1064
1072
  */
1065
1073
  runtimeRequirements: ReadonlySet<string>;
1074
+
1075
+ /**
1076
+ * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
1077
+ */
1078
+ hash?: string;
1066
1079
  }
1067
1080
  declare abstract class CodeGenerationResults {
1068
1081
  map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
1082
+ hashes: Map<Module, RuntimeSpecMap<string>>;
1069
1083
  get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
1084
+ has(module: Module, runtime: RuntimeSpec): boolean;
1070
1085
  getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
1071
1086
  getRuntimeRequirements(
1072
1087
  module: Module,
1073
1088
  runtime: RuntimeSpec
1074
1089
  ): ReadonlySet<string>;
1075
1090
  getData(module: Module, runtime: RuntimeSpec, key: string): any;
1091
+ getHash(module: Module, runtime: RuntimeSpec): any;
1076
1092
  add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
1077
1093
  }
1078
1094
  type CodeValue =
@@ -1437,7 +1453,12 @@ declare class Compilation {
1437
1453
  sortItemsWithChunkIds(): void;
1438
1454
  summarizeDependencies(): void;
1439
1455
  createModuleHashes(): void;
1440
- createHash(): void;
1456
+ createHash(): {
1457
+ module: Module;
1458
+ hash: string;
1459
+ runtime: RuntimeSpec;
1460
+ runtimes: RuntimeSpec[];
1461
+ }[];
1441
1462
  fullHash?: string;
1442
1463
  hash?: string;
1443
1464
  emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
@@ -1621,6 +1642,7 @@ declare class Compiler {
1621
1642
  failed: SyncHook<[Error]>;
1622
1643
  invalid: SyncHook<[null | string, number]>;
1623
1644
  watchClose: SyncHook<[]>;
1645
+ shutdown: AsyncSeriesHook<[]>;
1624
1646
  infrastructureLog: SyncBailHook<[string, string, any[]], true>;
1625
1647
  environment: SyncHook<[]>;
1626
1648
  afterEnvironment: SyncHook<[]>;
@@ -1797,13 +1819,13 @@ declare interface Configuration {
1797
1819
  | ExternalItem[]
1798
1820
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
1799
1821
  | ((
1800
- data: {
1801
- context: string;
1802
- request: string;
1803
- contextInfo: ModuleFactoryCreateDataContextInfo;
1804
- },
1805
- callback: (err?: Error, result?: string) => void
1806
- ) => void);
1822
+ data: ExternalItemFunctionData,
1823
+ callback: (
1824
+ err?: Error,
1825
+ result?: string | boolean | string[] | { [index: string]: any }
1826
+ ) => void
1827
+ ) => void)
1828
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
1807
1829
 
1808
1830
  /**
1809
1831
  * Enable presets of externals for specific targets.
@@ -2954,6 +2976,32 @@ declare interface Experiments {
2954
2976
  */
2955
2977
  layers?: boolean;
2956
2978
 
2979
+ /**
2980
+ * Compile entrypoints and import()s only when they are accessed.
2981
+ */
2982
+ lazyCompilation?:
2983
+ | boolean
2984
+ | {
2985
+ /**
2986
+ * A custom backend.
2987
+ */
2988
+ backend?:
2989
+ | ((
2990
+ compiler: Compiler,
2991
+ client: string,
2992
+ callback: (err?: Error, api?: any) => void
2993
+ ) => void)
2994
+ | ((compiler: Compiler, client: string) => Promise<any>);
2995
+ /**
2996
+ * A custom client.
2997
+ */
2998
+ client?: string;
2999
+ /**
3000
+ * Enable/disable lazy compilation for entries.
3001
+ */
3002
+ entries?: boolean;
3003
+ };
3004
+
2957
3005
  /**
2958
3006
  * Allow output javascript files as module source type.
2959
3007
  */
@@ -3247,13 +3295,46 @@ type ExternalItem =
3247
3295
  | RegExp
3248
3296
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3249
3297
  | ((
3250
- data: {
3251
- context: string;
3252
- request: string;
3253
- contextInfo: ModuleFactoryCreateDataContextInfo;
3254
- },
3255
- callback: (err?: Error, result?: string) => void
3256
- ) => void);
3298
+ data: ExternalItemFunctionData,
3299
+ callback: (
3300
+ err?: Error,
3301
+ result?: string | boolean | string[] | { [index: string]: any }
3302
+ ) => void
3303
+ ) => void)
3304
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
3305
+
3306
+ /**
3307
+ * Data object passed as argument when a function is set for 'externals'.
3308
+ */
3309
+ declare interface ExternalItemFunctionData {
3310
+ /**
3311
+ * The directory in which the request is placed.
3312
+ */
3313
+ context?: string;
3314
+
3315
+ /**
3316
+ * Contextual information.
3317
+ */
3318
+ contextInfo?: ModuleFactoryCreateDataContextInfo;
3319
+
3320
+ /**
3321
+ * Get a resolve function with the current resolver options.
3322
+ */
3323
+ getResolve?: (
3324
+ options?: ResolveOptionsWebpackOptions
3325
+ ) =>
3326
+ | ((
3327
+ context: string,
3328
+ request: string,
3329
+ callback: (err?: Error, result?: string) => void
3330
+ ) => void)
3331
+ | ((context: string, request: string) => Promise<string>);
3332
+
3333
+ /**
3334
+ * The request as written by the user in the require/import expression/statement.
3335
+ */
3336
+ request?: string;
3337
+ }
3257
3338
 
3258
3339
  /**
3259
3340
  * If an dependency matches exactly a property of the object, the property value is used as dependency.
@@ -3271,8 +3352,9 @@ declare interface ExternalItemObjectKnown {
3271
3352
  * If an dependency matches exactly a property of the object, the property value is used as dependency.
3272
3353
  */
3273
3354
  declare interface ExternalItemObjectUnknown {
3274
- [index: string]: string | boolean | string[] | { [index: string]: any };
3355
+ [index: string]: ExternalItemValue;
3275
3356
  }
3357
+ type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
3276
3358
  declare class ExternalModule extends Module {
3277
3359
  constructor(request?: any, type?: any, userRequest?: any);
3278
3360
  request: string | string[] | Record<string, string | string[]>;
@@ -3294,13 +3376,13 @@ type Externals =
3294
3376
  | ExternalItem[]
3295
3377
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3296
3378
  | ((
3297
- data: {
3298
- context: string;
3299
- request: string;
3300
- contextInfo: ModuleFactoryCreateDataContextInfo;
3301
- },
3302
- callback: (err?: Error, result?: string) => void
3303
- ) => void);
3379
+ data: ExternalItemFunctionData,
3380
+ callback: (
3381
+ err?: Error,
3382
+ result?: string | boolean | string[] | { [index: string]: any }
3383
+ ) => void
3384
+ ) => void)
3385
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
3304
3386
  declare class ExternalsPlugin {
3305
3387
  constructor(type: undefined | string, externals: Externals);
3306
3388
  type?: string;
@@ -3670,6 +3752,55 @@ declare class Generator {
3670
3752
  updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
3671
3753
  static byType(map?: any): ByTypeGenerator;
3672
3754
  }
3755
+ type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
3756
+ GeneratorOptionsByModuleTypeUnknown;
3757
+
3758
+ /**
3759
+ * Specify options for each generator.
3760
+ */
3761
+ declare interface GeneratorOptionsByModuleTypeKnown {
3762
+ /**
3763
+ * Generator options for asset modules.
3764
+ */
3765
+ asset?: AssetGeneratorOptions;
3766
+
3767
+ /**
3768
+ * Generator options for asset/inline modules.
3769
+ */
3770
+ "asset/inline"?: AssetInlineGeneratorOptions;
3771
+
3772
+ /**
3773
+ * Generator options for asset/resource modules.
3774
+ */
3775
+ "asset/resource"?: AssetResourceGeneratorOptions;
3776
+
3777
+ /**
3778
+ * No generator options are supported for this module type.
3779
+ */
3780
+ javascript?: EmptyGeneratorOptions;
3781
+
3782
+ /**
3783
+ * No generator options are supported for this module type.
3784
+ */
3785
+ "javascript/auto"?: EmptyGeneratorOptions;
3786
+
3787
+ /**
3788
+ * No generator options are supported for this module type.
3789
+ */
3790
+ "javascript/dynamic"?: EmptyGeneratorOptions;
3791
+
3792
+ /**
3793
+ * No generator options are supported for this module type.
3794
+ */
3795
+ "javascript/esm"?: EmptyGeneratorOptions;
3796
+ }
3797
+
3798
+ /**
3799
+ * Specify options for each generator.
3800
+ */
3801
+ declare interface GeneratorOptionsByModuleTypeUnknown {
3802
+ [index: string]: { [index: string]: any };
3803
+ }
3673
3804
  declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
3674
3805
  constructor(
3675
3806
  contentType: string,
@@ -4503,7 +4634,7 @@ declare class JavascriptParser extends Parser {
4503
4634
  | ClassDeclaration,
4504
4635
  commentsStartPos: number
4505
4636
  ): boolean;
4506
- getComments(range?: any): any;
4637
+ getComments(range?: any): any[];
4507
4638
  isAsiPosition(pos: number): boolean;
4508
4639
  unsetAsiPosition(pos: number): void;
4509
4640
  isStatementLevelExpression(expr?: any): boolean;
@@ -4590,6 +4721,31 @@ declare interface JavascriptParserOptions {
4590
4721
  */
4591
4722
  commonjs?: boolean;
4592
4723
 
4724
+ /**
4725
+ * Enable/disable parsing of magic comments in CommonJs syntax.
4726
+ */
4727
+ commonjsMagicComments?: boolean;
4728
+
4729
+ /**
4730
+ * Enable warnings for full dynamic dependencies.
4731
+ */
4732
+ exprContextCritical?: boolean;
4733
+
4734
+ /**
4735
+ * Enable recursive directory lookup for full dynamic dependencies.
4736
+ */
4737
+ exprContextRecursive?: boolean;
4738
+
4739
+ /**
4740
+ * Sets the default regular expression for full dynamic dependencies.
4741
+ */
4742
+ exprContextRegExp?: boolean | RegExp;
4743
+
4744
+ /**
4745
+ * Set the default request for full dynamic dependencies.
4746
+ */
4747
+ exprContextRequest?: string;
4748
+
4593
4749
  /**
4594
4750
  * Enable/disable parsing of EcmaScript Modules syntax.
4595
4751
  */
@@ -4625,11 +4781,41 @@ declare interface JavascriptParserOptions {
4625
4781
  */
4626
4782
  requireJs?: boolean;
4627
4783
 
4784
+ /**
4785
+ * Emit errors instead of warnings when imported names don't exist in imported module.
4786
+ */
4787
+ strictExportPresence?: boolean;
4788
+
4789
+ /**
4790
+ * Handle the this context correctly according to the spec for namespace objects.
4791
+ */
4792
+ strictThisContextOnImports?: boolean;
4793
+
4628
4794
  /**
4629
4795
  * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
4630
4796
  */
4631
4797
  system?: boolean;
4632
4798
 
4799
+ /**
4800
+ * Enable warnings when using the require function in a not statically analyse-able way.
4801
+ */
4802
+ unknownContextCritical?: boolean;
4803
+
4804
+ /**
4805
+ * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
4806
+ */
4807
+ unknownContextRecursive?: boolean;
4808
+
4809
+ /**
4810
+ * Sets the regular expression when using the require function in a not statically analyse-able way.
4811
+ */
4812
+ unknownContextRegExp?: boolean | RegExp;
4813
+
4814
+ /**
4815
+ * Sets the request when using the require function in a not statically analyse-able way.
4816
+ */
4817
+ unknownContextRequest?: string;
4818
+
4633
4819
  /**
4634
4820
  * Enable/disable parsing of new URL() syntax.
4635
4821
  */
@@ -4639,6 +4825,21 @@ declare interface JavascriptParserOptions {
4639
4825
  * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
4640
4826
  */
4641
4827
  worker?: boolean | string[];
4828
+
4829
+ /**
4830
+ * Enable warnings for partial dynamic dependencies.
4831
+ */
4832
+ wrappedContextCritical?: boolean;
4833
+
4834
+ /**
4835
+ * Enable recursive directory lookup for partial dynamic dependencies.
4836
+ */
4837
+ wrappedContextRecursive?: boolean;
4838
+
4839
+ /**
4840
+ * Set the inner regular expression for partial dynamic dependencies.
4841
+ */
4842
+ wrappedContextRegExp?: RegExp;
4642
4843
  }
4643
4844
  declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
4644
4845
  constructor(runtimeRequirements?: any);
@@ -4944,7 +5145,7 @@ declare interface LibraryOptions {
4944
5145
  name?: string | string[] | LibraryCustomUmdObject;
4945
5146
 
4946
5147
  /**
4947
- * 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).
5148
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
4948
5149
  */
4949
5150
  type: string;
4950
5151
 
@@ -5585,24 +5786,24 @@ declare interface ModuleOptions {
5585
5786
  exprContextCritical?: boolean;
5586
5787
 
5587
5788
  /**
5588
- * Enable recursive directory lookup for full dynamic dependencies.
5789
+ * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
5589
5790
  */
5590
5791
  exprContextRecursive?: boolean;
5591
5792
 
5592
5793
  /**
5593
- * Sets the default regular expression for full dynamic dependencies.
5794
+ * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
5594
5795
  */
5595
5796
  exprContextRegExp?: boolean | RegExp;
5596
5797
 
5597
5798
  /**
5598
- * Set the default request for full dynamic dependencies.
5799
+ * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
5599
5800
  */
5600
5801
  exprContextRequest?: string;
5601
5802
 
5602
5803
  /**
5603
5804
  * Specify options for each generator.
5604
5805
  */
5605
- generator?: ModuleOptionsGeneratorKnown & ModuleOptionsGeneratorUnknown;
5806
+ generator?: GeneratorOptionsByModuleType;
5606
5807
 
5607
5808
  /**
5608
5809
  * Don't parse files matching. It's matched against the full resolved request.
@@ -5612,7 +5813,7 @@ declare interface ModuleOptions {
5612
5813
  /**
5613
5814
  * Specify options for each parser.
5614
5815
  */
5615
- parser?: ModuleOptionsParserKnown & ModuleOptionsParserUnknown;
5816
+ parser?: ParserOptionsByModuleType;
5616
5817
 
5617
5818
  /**
5618
5819
  * An array of rules applied for modules.
@@ -5620,32 +5821,32 @@ declare interface ModuleOptions {
5620
5821
  rules?: (RuleSetRule | "...")[];
5621
5822
 
5622
5823
  /**
5623
- * Emit errors instead of warnings when imported names don't exist in imported module.
5824
+ * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
5624
5825
  */
5625
5826
  strictExportPresence?: boolean;
5626
5827
 
5627
5828
  /**
5628
- * Handle the this context correctly according to the spec for namespace objects.
5829
+ * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
5629
5830
  */
5630
5831
  strictThisContextOnImports?: boolean;
5631
5832
 
5632
5833
  /**
5633
- * Enable warnings when using the require function in a not statically analyse-able way.
5834
+ * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
5634
5835
  */
5635
5836
  unknownContextCritical?: boolean;
5636
5837
 
5637
5838
  /**
5638
- * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
5839
+ * Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.
5639
5840
  */
5640
5841
  unknownContextRecursive?: boolean;
5641
5842
 
5642
5843
  /**
5643
- * Sets the regular expression when using the require function in a not statically analyse-able way.
5844
+ * Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.
5644
5845
  */
5645
5846
  unknownContextRegExp?: boolean | RegExp;
5646
5847
 
5647
5848
  /**
5648
- * Sets the request when using the require function in a not statically analyse-able way.
5849
+ * Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.
5649
5850
  */
5650
5851
  unknownContextRequest?: string;
5651
5852
 
@@ -5655,118 +5856,54 @@ declare interface ModuleOptions {
5655
5856
  unsafeCache?: boolean | Function;
5656
5857
 
5657
5858
  /**
5658
- * Enable warnings for partial dynamic dependencies.
5859
+ * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
5659
5860
  */
5660
5861
  wrappedContextCritical?: boolean;
5661
5862
 
5662
5863
  /**
5663
- * Enable recursive directory lookup for partial dynamic dependencies.
5864
+ * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
5664
5865
  */
5665
5866
  wrappedContextRecursive?: boolean;
5666
5867
 
5667
5868
  /**
5668
- * Set the inner regular expression for partial dynamic dependencies.
5869
+ * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
5669
5870
  */
5670
5871
  wrappedContextRegExp?: RegExp;
5671
5872
  }
5672
5873
 
5673
5874
  /**
5674
- * Specify options for each generator.
5675
- */
5676
- declare interface ModuleOptionsGeneratorKnown {
5677
- /**
5678
- * Generator options for asset modules.
5679
- */
5680
- asset?: AssetGeneratorOptions;
5681
-
5682
- /**
5683
- * Generator options for asset/inline modules.
5684
- */
5685
- "asset/inline"?: AssetInlineGeneratorOptions;
5686
-
5687
- /**
5688
- * Generator options for asset/resource modules.
5689
- */
5690
- "asset/resource"?: AssetResourceGeneratorOptions;
5691
-
5692
- /**
5693
- * No generator options are supported for this module type.
5694
- */
5695
- javascript?: EmptyGeneratorOptions;
5696
-
5697
- /**
5698
- * No generator options are supported for this module type.
5699
- */
5700
- "javascript/auto"?: EmptyGeneratorOptions;
5701
-
5702
- /**
5703
- * No generator options are supported for this module type.
5704
- */
5705
- "javascript/dynamic"?: EmptyGeneratorOptions;
5706
-
5707
- /**
5708
- * No generator options are supported for this module type.
5709
- */
5710
- "javascript/esm"?: EmptyGeneratorOptions;
5711
- }
5712
-
5713
- /**
5714
- * Specify options for each generator.
5715
- */
5716
- declare interface ModuleOptionsGeneratorUnknown {
5717
- [index: string]: { [index: string]: any };
5718
- }
5719
-
5720
- /**
5721
- * Specify options for each parser.
5875
+ * Options affecting the normal modules (`NormalModuleFactory`).
5722
5876
  */
5723
- declare interface ModuleOptionsParserKnown {
5724
- /**
5725
- * Parser options for asset modules.
5726
- */
5727
- asset?: AssetParserOptions;
5728
-
5877
+ declare interface ModuleOptionsNormalized {
5729
5878
  /**
5730
- * No parser options are supported for this module type.
5879
+ * An array of rules applied by default for modules.
5731
5880
  */
5732
- "asset/inline"?: EmptyParserOptions;
5881
+ defaultRules: (RuleSetRule | "...")[];
5733
5882
 
5734
5883
  /**
5735
- * No parser options are supported for this module type.
5884
+ * Specify options for each generator.
5736
5885
  */
5737
- "asset/resource"?: EmptyParserOptions;
5886
+ generator: GeneratorOptionsByModuleType;
5738
5887
 
5739
5888
  /**
5740
- * No parser options are supported for this module type.
5741
- */
5742
- "asset/source"?: EmptyParserOptions;
5743
-
5744
- /**
5745
- * Parser options for javascript modules.
5889
+ * Don't parse files matching. It's matched against the full resolved request.
5746
5890
  */
5747
- javascript?: JavascriptParserOptions;
5891
+ noParse?: string | Function | RegExp | (string | Function | RegExp)[];
5748
5892
 
5749
5893
  /**
5750
- * Parser options for javascript modules.
5894
+ * Specify options for each parser.
5751
5895
  */
5752
- "javascript/auto"?: JavascriptParserOptions;
5896
+ parser: ParserOptionsByModuleType;
5753
5897
 
5754
5898
  /**
5755
- * Parser options for javascript modules.
5899
+ * An array of rules applied for modules.
5756
5900
  */
5757
- "javascript/dynamic"?: JavascriptParserOptions;
5901
+ rules: (RuleSetRule | "...")[];
5758
5902
 
5759
5903
  /**
5760
- * Parser options for javascript modules.
5904
+ * Cache the resolving of module requests.
5761
5905
  */
5762
- "javascript/esm"?: JavascriptParserOptions;
5763
- }
5764
-
5765
- /**
5766
- * Specify options for each parser.
5767
- */
5768
- declare interface ModuleOptionsParserUnknown {
5769
- [index: string]: { [index: string]: any };
5906
+ unsafeCache?: boolean | Function;
5770
5907
  }
5771
5908
  declare interface ModulePathData {
5772
5909
  id: string | number;
@@ -6817,7 +6954,7 @@ declare interface Output {
6817
6954
  libraryExport?: string | string[];
6818
6955
 
6819
6956
  /**
6820
- * 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).
6957
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
6821
6958
  */
6822
6959
  libraryTarget?: string;
6823
6960
 
@@ -7148,6 +7285,60 @@ declare class Parser {
7148
7285
  state: ParserState
7149
7286
  ): ParserState;
7150
7287
  }
7288
+ type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
7289
+ ParserOptionsByModuleTypeUnknown;
7290
+
7291
+ /**
7292
+ * Specify options for each parser.
7293
+ */
7294
+ declare interface ParserOptionsByModuleTypeKnown {
7295
+ /**
7296
+ * Parser options for asset modules.
7297
+ */
7298
+ asset?: AssetParserOptions;
7299
+
7300
+ /**
7301
+ * No parser options are supported for this module type.
7302
+ */
7303
+ "asset/inline"?: EmptyParserOptions;
7304
+
7305
+ /**
7306
+ * No parser options are supported for this module type.
7307
+ */
7308
+ "asset/resource"?: EmptyParserOptions;
7309
+
7310
+ /**
7311
+ * No parser options are supported for this module type.
7312
+ */
7313
+ "asset/source"?: EmptyParserOptions;
7314
+
7315
+ /**
7316
+ * Parser options for javascript modules.
7317
+ */
7318
+ javascript?: JavascriptParserOptions;
7319
+
7320
+ /**
7321
+ * Parser options for javascript modules.
7322
+ */
7323
+ "javascript/auto"?: JavascriptParserOptions;
7324
+
7325
+ /**
7326
+ * Parser options for javascript modules.
7327
+ */
7328
+ "javascript/dynamic"?: JavascriptParserOptions;
7329
+
7330
+ /**
7331
+ * Parser options for javascript modules.
7332
+ */
7333
+ "javascript/esm"?: JavascriptParserOptions;
7334
+ }
7335
+
7336
+ /**
7337
+ * Specify options for each parser.
7338
+ */
7339
+ declare interface ParserOptionsByModuleTypeUnknown {
7340
+ [index: string]: { [index: string]: any };
7341
+ }
7151
7342
  type ParserState = Record<string, any> & ParserStateBase;
7152
7343
  declare interface ParserStateBase {
7153
7344
  current: NormalModule;
@@ -7255,7 +7446,7 @@ declare class Profiler {
7255
7446
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
7256
7447
  sendCommand(method?: any, params?: any): Promise<any>;
7257
7448
  destroy(): Promise<void>;
7258
- stopProfiling(): Promise<any>;
7449
+ stopProfiling(): Promise<{ profile: any }>;
7259
7450
  }
7260
7451
  declare class ProfilingPlugin {
7261
7452
  constructor(options?: ProfilingPluginOptions);
@@ -8558,6 +8749,7 @@ declare abstract class RuntimeSpecMap<T> {
8558
8749
  get(runtime: RuntimeSpec): T;
8559
8750
  has(runtime: RuntimeSpec): boolean;
8560
8751
  set(runtime?: any, value?: any): void;
8752
+ provide(runtime?: any, computer?: any): any;
8561
8753
  delete(runtime?: any): void;
8562
8754
  update(runtime?: any, fn?: any): void;
8563
8755
  keys(): RuntimeSpec[];
@@ -9549,6 +9741,11 @@ declare interface StatsOptions {
9549
9741
  */
9550
9742
  chunkModules?: boolean;
9551
9743
 
9744
+ /**
9745
+ * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
9746
+ */
9747
+ chunkModulesSpace?: number;
9748
+
9552
9749
  /**
9553
9750
  * Add the origins of chunks and chunk merging info.
9554
9751
  */
@@ -9942,7 +10139,9 @@ declare class Template {
9942
10139
  ): Source;
9943
10140
  static renderRuntimeModules(
9944
10141
  runtimeModules: RuntimeModule[],
9945
- renderContext: RenderContextModuleTemplate
10142
+ renderContext: RenderContextModuleTemplate & {
10143
+ codeGenerationResults?: CodeGenerationResults;
10144
+ }
9946
10145
  ): Source;
9947
10146
  static renderChunkRuntimeModules(
9948
10147
  runtimeModules: RuntimeModule[],
@@ -10426,7 +10625,7 @@ declare interface WebpackOptionsNormalized {
10426
10625
  /**
10427
10626
  * Options affecting the normal modules (`NormalModuleFactory`).
10428
10627
  */
10429
- module: ModuleOptions;
10628
+ module: ModuleOptionsNormalized;
10430
10629
 
10431
10630
  /**
10432
10631
  * Name of the configuration. Used when loading multiple configurations.