webpack 5.99.7 → 5.99.8

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.
Files changed (132) hide show
  1. package/lib/Compilation.js +12 -7
  2. package/lib/ContextModule.js +1 -1
  3. package/lib/ContextModuleFactory.js +1 -2
  4. package/lib/ContextReplacementPlugin.js +2 -1
  5. package/lib/DefinePlugin.js +2 -2
  6. package/lib/DelegatedModule.js +18 -8
  7. package/lib/DelegatedModuleFactoryPlugin.js +9 -7
  8. package/lib/EvalSourceMapDevToolPlugin.js +1 -1
  9. package/lib/ExportsInfo.js +35 -16
  10. package/lib/ExternalModule.js +6 -5
  11. package/lib/FileSystemInfo.js +2 -2
  12. package/lib/LibManifestPlugin.js +2 -2
  13. package/lib/ModuleFilenameHelpers.js +8 -4
  14. package/lib/NormalModule.js +8 -7
  15. package/lib/SourceMapDevToolPlugin.js +2 -3
  16. package/lib/WebpackOptionsApply.js +1 -4
  17. package/lib/asset/AssetGenerator.js +2 -2
  18. package/lib/config/defaults.js +10 -6
  19. package/lib/config/normalization.js +5 -5
  20. package/lib/css/CssModulesPlugin.js +2 -2
  21. package/lib/debug/ProfilingPlugin.js +18 -21
  22. package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -1
  23. package/lib/dependencies/ContextElementDependency.js +1 -1
  24. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  25. package/lib/dependencies/RequireContextPlugin.js +2 -1
  26. package/lib/dependencies/WorkerPlugin.js +2 -2
  27. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +0 -1
  28. package/lib/index.js +11 -0
  29. package/lib/javascript/JavascriptModulesPlugin.js +2 -2
  30. package/lib/json/JsonModulesPlugin.js +4 -4
  31. package/lib/library/AbstractLibraryPlugin.js +1 -1
  32. package/lib/node/nodeConsole.js +3 -2
  33. package/lib/optimize/AggressiveSplittingPlugin.js +1 -1
  34. package/lib/optimize/ConcatenatedModule.js +3 -1
  35. package/lib/optimize/ModuleConcatenationPlugin.js +2 -2
  36. package/lib/optimize/RuntimeChunkPlugin.js +5 -6
  37. package/lib/optimize/SideEffectsFlagPlugin.js +9 -6
  38. package/lib/optimize/SplitChunksPlugin.js +2 -2
  39. package/lib/rules/BasicEffectRulePlugin.js +1 -2
  40. package/lib/rules/ObjectMatcherRulePlugin.js +2 -1
  41. package/lib/rules/RuleSetCompiler.js +19 -5
  42. package/lib/rules/UseEffectRulePlugin.js +4 -6
  43. package/lib/schemes/HttpUriPlugin.js +154 -149
  44. package/lib/util/createHash.js +3 -3
  45. package/package.json +33 -29
  46. package/schemas/WebpackOptions.check.d.ts +1 -1
  47. package/schemas/WebpackOptions.check.js +2 -2
  48. package/schemas/WebpackOptions.json +243 -24
  49. package/schemas/plugins/BannerPlugin.check.d.ts +1 -1
  50. package/schemas/plugins/BannerPlugin.check.js +1 -1
  51. package/schemas/plugins/DllPlugin.check.d.ts +1 -1
  52. package/schemas/plugins/DllPlugin.check.js +1 -1
  53. package/schemas/plugins/DllReferencePlugin.check.d.ts +1 -1
  54. package/schemas/plugins/DllReferencePlugin.check.js +1 -1
  55. package/schemas/plugins/HashedModuleIdsPlugin.check.d.ts +1 -1
  56. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  57. package/schemas/plugins/IgnorePlugin.check.d.ts +1 -1
  58. package/schemas/plugins/IgnorePlugin.check.js +1 -1
  59. package/schemas/plugins/LoaderOptionsPlugin.check.d.ts +1 -1
  60. package/schemas/plugins/LoaderOptionsPlugin.check.js +1 -1
  61. package/schemas/plugins/ProgressPlugin.check.d.ts +1 -1
  62. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  63. package/schemas/plugins/SourceMapDevToolPlugin.check.d.ts +1 -1
  64. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  65. package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
  66. package/schemas/plugins/WatchIgnorePlugin.check.d.ts +1 -1
  67. package/schemas/plugins/WatchIgnorePlugin.check.js +1 -1
  68. package/schemas/plugins/asset/AssetGeneratorOptions.check.d.ts +1 -1
  69. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  70. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.d.ts +1 -1
  71. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.js +1 -1
  72. package/schemas/plugins/asset/AssetParserOptions.check.d.ts +1 -1
  73. package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
  74. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.d.ts +1 -1
  75. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  76. package/schemas/plugins/container/ContainerPlugin.check.d.ts +1 -1
  77. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  78. package/schemas/plugins/container/ContainerReferencePlugin.check.d.ts +1 -1
  79. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  80. package/schemas/plugins/container/ExternalsType.check.d.ts +1 -1
  81. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  82. package/schemas/plugins/container/ModuleFederationPlugin.check.d.ts +1 -1
  83. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  84. package/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts +1 -1
  85. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +1 -1
  86. package/schemas/plugins/css/CssAutoParserOptions.check.d.ts +1 -1
  87. package/schemas/plugins/css/CssAutoParserOptions.check.js +1 -1
  88. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +1 -1
  89. package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
  90. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts +1 -1
  91. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +1 -1
  92. package/schemas/plugins/css/CssGlobalParserOptions.check.d.ts +1 -1
  93. package/schemas/plugins/css/CssGlobalParserOptions.check.js +1 -1
  94. package/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts +1 -1
  95. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
  96. package/schemas/plugins/css/CssModuleParserOptions.check.d.ts +1 -1
  97. package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
  98. package/schemas/plugins/css/CssParserOptions.check.d.ts +1 -1
  99. package/schemas/plugins/css/CssParserOptions.check.js +1 -1
  100. package/schemas/plugins/debug/ProfilingPlugin.check.d.ts +1 -1
  101. package/schemas/plugins/debug/ProfilingPlugin.check.js +1 -1
  102. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.d.ts +1 -1
  103. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.js +1 -1
  104. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.d.ts +1 -1
  105. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.js +1 -1
  106. package/schemas/plugins/json/JsonModulesPluginGenerator.check.d.ts +7 -0
  107. package/schemas/plugins/{JsonModulesPluginGenerator.check.js → json/JsonModulesPluginGenerator.check.js} +1 -1
  108. package/schemas/plugins/json/JsonModulesPluginGenerator.json +3 -0
  109. package/schemas/plugins/json/JsonModulesPluginParser.check.d.ts +7 -0
  110. package/schemas/plugins/{JsonModulesPluginParser.check.js → json/JsonModulesPluginParser.check.js} +1 -1
  111. package/schemas/plugins/json/JsonModulesPluginParser.json +3 -0
  112. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.d.ts +1 -1
  113. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
  114. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.d.ts +1 -1
  115. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
  116. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.d.ts +1 -1
  117. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.js +1 -1
  118. package/schemas/plugins/optimize/MinChunkSizePlugin.check.d.ts +1 -1
  119. package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
  120. package/schemas/plugins/schemes/HttpUriPlugin.check.d.ts +1 -1
  121. package/schemas/plugins/schemes/HttpUriPlugin.check.js +1 -1
  122. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.d.ts +1 -1
  123. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.js +1 -1
  124. package/schemas/plugins/sharing/ProvideSharedPlugin.check.d.ts +1 -1
  125. package/schemas/plugins/sharing/ProvideSharedPlugin.check.js +1 -1
  126. package/schemas/plugins/sharing/SharePlugin.check.d.ts +1 -1
  127. package/schemas/plugins/sharing/SharePlugin.check.js +1 -1
  128. package/types.d.ts +437 -150
  129. package/schemas/plugins/JsonModulesPluginGenerator.check.d.ts +0 -7
  130. package/schemas/plugins/JsonModulesPluginGenerator.json +0 -11
  131. package/schemas/plugins/JsonModulesPluginParser.check.d.ts +0 -7
  132. package/schemas/plugins/JsonModulesPluginParser.json +0 -16
package/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * This file was automatically generated.
3
3
  * DO NOT MODIFY BY HAND.
4
- * Run `yarn special-lint-fix` to update
4
+ * Run `yarn fix:special` to update
5
5
  */
6
6
 
7
7
  import { Buffer } from "buffer";
@@ -88,6 +88,10 @@ import {
88
88
  YieldExpression
89
89
  } from "estree";
90
90
  import { IncomingMessage, ServerOptions } from "http";
91
+ import {
92
+ Session as SessionImportInspectorClass_1,
93
+ Session as SessionImportInspectorClass_2
94
+ } from "inspector";
91
95
  import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
92
96
  import { ListenOptions, Server } from "net";
93
97
  import { validate as validateFunction } from "schema-utils";
@@ -224,7 +228,6 @@ declare interface AggressiveSplittingPluginOptions {
224
228
  */
225
229
  minSize?: number;
226
230
  }
227
- type Algorithm = string | typeof Hash;
228
231
  type Alias = string | false | string[];
229
232
  declare interface AliasOption {
230
233
  alias: Alias;
@@ -2640,7 +2643,6 @@ declare interface Configuration {
2640
2643
  externals?:
2641
2644
  | string
2642
2645
  | RegExp
2643
- | ExternalItem[]
2644
2646
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
2645
2647
  | ((
2646
2648
  data: ExternalItemFunctionData,
@@ -2649,7 +2651,8 @@ declare interface Configuration {
2649
2651
  result?: string | boolean | string[] | { [index: string]: any }
2650
2652
  ) => void
2651
2653
  ) => void)
2652
- | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
2654
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
2655
+ | ExternalItem[];
2653
2656
 
2654
2657
  /**
2655
2658
  * Enable presets of externals for specific targets.
@@ -3922,7 +3925,18 @@ declare interface Effect {
3922
3925
  value: any;
3923
3926
  }
3924
3927
  declare interface EffectData {
3925
- [index: string]: any;
3928
+ resource?: string;
3929
+ realResource?: string;
3930
+ resourceQuery?: string;
3931
+ resourceFragment?: string;
3932
+ scheme?: string;
3933
+ assertions?: ImportAttributes;
3934
+ mimetype?: string;
3935
+ dependency: string;
3936
+ descriptionData: Record<string, any>;
3937
+ compiler?: string;
3938
+ issuer: string;
3939
+ issuerLayer: string;
3926
3940
  }
3927
3941
  declare class ElectronTargetPlugin {
3928
3942
  constructor(context?: "main" | "preload" | "renderer");
@@ -4810,6 +4824,15 @@ type ExternalItem =
4810
4824
  ) => void
4811
4825
  ) => void)
4812
4826
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4827
+ type ExternalItemFunction =
4828
+ | ((
4829
+ data: ExternalItemFunctionData,
4830
+ callback: (
4831
+ err?: null | Error,
4832
+ result?: string | boolean | string[] | { [index: string]: any }
4833
+ ) => void
4834
+ ) => void)
4835
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4813
4836
 
4814
4837
  /**
4815
4838
  * Data object passed as argument when a function is set for 'externals'.
@@ -4914,7 +4937,6 @@ declare interface ExternalModuleInfo {
4914
4937
  type Externals =
4915
4938
  | string
4916
4939
  | RegExp
4917
- | ExternalItem[]
4918
4940
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
4919
4941
  | ((
4920
4942
  data: ExternalItemFunctionData,
@@ -4923,7 +4945,8 @@ type Externals =
4923
4945
  result?: string | boolean | string[] | { [index: string]: any }
4924
4946
  ) => void
4925
4947
  ) => void)
4926
- | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4948
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
4949
+ | ExternalItem[];
4927
4950
  declare class ExternalsPlugin {
4928
4951
  constructor(type: undefined | string, externals: Externals);
4929
4952
  type?: string;
@@ -5867,7 +5890,11 @@ declare interface InfrastructureLogging {
5867
5890
  /**
5868
5891
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
5869
5892
  */
5870
- stream?: NodeJS.WritableStream;
5893
+ stream?: NodeJS.WritableStream & {
5894
+ isTTY?: boolean;
5895
+ columns?: number;
5896
+ rows?: number;
5897
+ };
5871
5898
  }
5872
5899
  declare class InitFragment<GenerateContext> {
5873
5900
  constructor(
@@ -5926,6 +5953,9 @@ declare interface InputFileSystem {
5926
5953
  relative?: (from: string, to: string) => string;
5927
5954
  dirname?: (dirname: string) => string;
5928
5955
  }
5956
+ declare interface Inspector {
5957
+ Session: typeof SessionImportInspectorClass_1;
5958
+ }
5929
5959
  type IntermediateFileSystem = InputFileSystem &
5930
5960
  OutputFileSystem &
5931
5961
  IntermediateFileSystemExtras;
@@ -7603,6 +7633,23 @@ type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
7603
7633
  | JsonObjectTypes
7604
7634
  | JsonValueTypes[];
7605
7635
  };
7636
+
7637
+ /**
7638
+ * Parser options for JSON modules.
7639
+ */
7640
+ declare interface JsonParserOptions {
7641
+ /**
7642
+ * The depth of json dependency flagged as `exportInfo`.
7643
+ */
7644
+ exportsDepth?: number;
7645
+
7646
+ /**
7647
+ * Function to parser content and return JSON.
7648
+ */
7649
+ parse?: (
7650
+ input: string
7651
+ ) => null | string | number | boolean | Buffer | JsonObjectFs | JsonValueFs[];
7652
+ }
7606
7653
  type JsonValueFs =
7607
7654
  | null
7608
7655
  | string
@@ -8659,7 +8706,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
8659
8706
  async(): (
8660
8707
  err?: null | Error,
8661
8708
  content?: string | Buffer,
8662
- sourceMap?: string | SourceMap,
8709
+ sourceMap?: null | string | SourceMap,
8663
8710
  additionalData?: AdditionalData
8664
8711
  ) => void;
8665
8712
 
@@ -8673,7 +8720,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
8673
8720
  callback: (
8674
8721
  err?: null | Error,
8675
8722
  content?: string | Buffer,
8676
- sourceMap?: string | SourceMap,
8723
+ sourceMap?: null | string | SourceMap,
8677
8724
  additionalData?: AdditionalData
8678
8725
  ) => void;
8679
8726
 
@@ -9581,7 +9628,11 @@ declare interface ModuleOptions {
9581
9628
  /**
9582
9629
  * Don't parse files matching. It's matched against the full resolved request.
9583
9630
  */
9584
- noParse?: string | Function | RegExp | (string | Function | RegExp)[];
9631
+ noParse?:
9632
+ | string
9633
+ | RegExp
9634
+ | (string | RegExp | ((content: string) => boolean))[]
9635
+ | ((content: string) => boolean);
9585
9636
 
9586
9637
  /**
9587
9638
  * Specify options for each parser.
@@ -9626,7 +9677,7 @@ declare interface ModuleOptions {
9626
9677
  /**
9627
9678
  * Cache the resolving of module requests.
9628
9679
  */
9629
- unsafeCache?: boolean | Function;
9680
+ unsafeCache?: boolean | ((module: Module) => boolean);
9630
9681
 
9631
9682
  /**
9632
9683
  * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
@@ -9661,7 +9712,11 @@ declare interface ModuleOptionsNormalized {
9661
9712
  /**
9662
9713
  * Don't parse files matching. It's matched against the full resolved request.
9663
9714
  */
9664
- noParse?: string | Function | RegExp | (string | Function | RegExp)[];
9715
+ noParse?:
9716
+ | string
9717
+ | RegExp
9718
+ | (string | RegExp | ((content: string) => boolean))[]
9719
+ | ((content: string) => boolean);
9665
9720
 
9666
9721
  /**
9667
9722
  * Specify options for each parser.
@@ -9676,7 +9731,7 @@ declare interface ModuleOptionsNormalized {
9676
9731
  /**
9677
9732
  * Cache the resolving of module requests.
9678
9733
  */
9679
- unsafeCache?: boolean | Function;
9734
+ unsafeCache?: boolean | ((module: Module) => boolean);
9680
9735
  }
9681
9736
  declare interface ModulePathData {
9682
9737
  id: string | number;
@@ -9973,6 +10028,11 @@ declare class NoEmitOnErrorsPlugin {
9973
10028
  */
9974
10029
  apply(compiler: Compiler): void;
9975
10030
  }
10031
+ type NoParse =
10032
+ | string
10033
+ | RegExp
10034
+ | (string | RegExp | ((content: string) => boolean))[]
10035
+ | ((content: string) => boolean);
9976
10036
  type Node = false | NodeOptions;
9977
10037
  declare class NodeEnvironmentPlugin {
9978
10038
  constructor(options: NodeEnvironmentPluginOptions);
@@ -10077,8 +10137,16 @@ declare class NormalModule extends Module {
10077
10137
  associatedObjectForCache?: object
10078
10138
  ): Source;
10079
10139
  markModuleAsErrored(error: WebpackError): void;
10080
- applyNoParseRule(rule: any, content: string): boolean;
10081
- shouldPreventParsing(noParseRule: any, request: string): boolean;
10140
+ applyNoParseRule(rule: Exclude<NoParse, any[]>, content: string): boolean;
10141
+ shouldPreventParsing(
10142
+ noParseRule:
10143
+ | undefined
10144
+ | string
10145
+ | RegExp
10146
+ | (string | RegExp | ((content: string) => boolean))[]
10147
+ | ((content: string) => boolean),
10148
+ request: string
10149
+ ): boolean;
10082
10150
  static getCompilationHooks(
10083
10151
  compilation: Compilation
10084
10152
  ): NormalModuleCompilationHooks;
@@ -10603,7 +10671,154 @@ declare interface Optimization {
10603
10671
  /**
10604
10672
  * The name or name factory for the runtime chunks.
10605
10673
  */
10606
- name?: string | Function;
10674
+ name?: string | ((entrypoint: { name: string }) => string);
10675
+ };
10676
+
10677
+ /**
10678
+ * 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).
10679
+ */
10680
+ sideEffects?: boolean | "flag";
10681
+
10682
+ /**
10683
+ * Optimize duplication and caching by splitting chunks by shared modules and cache group.
10684
+ */
10685
+ splitChunks?: false | OptimizationSplitChunksOptions;
10686
+
10687
+ /**
10688
+ * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, "global": analyse exports globally for all runtimes combined).
10689
+ */
10690
+ usedExports?: boolean | "global";
10691
+ }
10692
+
10693
+ /**
10694
+ * Enables/Disables integrated optimizations.
10695
+ */
10696
+ declare interface OptimizationNormalized {
10697
+ /**
10698
+ * Avoid wrapping the entry module in an IIFE.
10699
+ */
10700
+ avoidEntryIife?: boolean;
10701
+
10702
+ /**
10703
+ * Check for incompatible wasm types when importing/exporting from/to ESM.
10704
+ */
10705
+ checkWasmTypes?: boolean;
10706
+
10707
+ /**
10708
+ * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).
10709
+ */
10710
+ chunkIds?:
10711
+ | false
10712
+ | "natural"
10713
+ | "named"
10714
+ | "deterministic"
10715
+ | "size"
10716
+ | "total-size";
10717
+
10718
+ /**
10719
+ * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
10720
+ */
10721
+ concatenateModules?: boolean;
10722
+
10723
+ /**
10724
+ * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
10725
+ */
10726
+ emitOnErrors?: boolean;
10727
+
10728
+ /**
10729
+ * Also flag chunks as loaded which contain a subset of the modules.
10730
+ */
10731
+ flagIncludedChunks?: boolean;
10732
+
10733
+ /**
10734
+ * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
10735
+ */
10736
+ innerGraph?: boolean;
10737
+
10738
+ /**
10739
+ * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/"deterministic": generate short deterministic names optimized for caching, "size": generate the shortest possible names).
10740
+ */
10741
+ mangleExports?: boolean | "deterministic" | "size";
10742
+
10743
+ /**
10744
+ * Reduce size of WASM by changing imports to shorter strings.
10745
+ */
10746
+ mangleWasmImports?: boolean;
10747
+
10748
+ /**
10749
+ * Merge chunks which contain the same modules.
10750
+ */
10751
+ mergeDuplicateChunks?: boolean;
10752
+
10753
+ /**
10754
+ * Enable minimizing the output. Uses optimization.minimizer.
10755
+ */
10756
+ minimize?: boolean;
10757
+
10758
+ /**
10759
+ * Minimizer(s) to use for minimizing the output.
10760
+ */
10761
+ minimizer?: (
10762
+ | undefined
10763
+ | null
10764
+ | false
10765
+ | ""
10766
+ | 0
10767
+ | ((this: Compiler, compiler: Compiler) => void)
10768
+ | WebpackPluginInstance
10769
+ | "..."
10770
+ )[];
10771
+
10772
+ /**
10773
+ * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).
10774
+ */
10775
+ moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
10776
+
10777
+ /**
10778
+ * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
10779
+ */
10780
+ noEmitOnErrors?: boolean;
10781
+
10782
+ /**
10783
+ * Set process.env.NODE_ENV to a specific value.
10784
+ */
10785
+ nodeEnv?: string | false;
10786
+
10787
+ /**
10788
+ * Generate records with relative paths to be able to move the context folder.
10789
+ */
10790
+ portableRecords?: boolean;
10791
+
10792
+ /**
10793
+ * Figure out which exports are provided by modules to generate more efficient code.
10794
+ */
10795
+ providedExports?: boolean;
10796
+
10797
+ /**
10798
+ * Use real [contenthash] based on final content of the assets.
10799
+ */
10800
+ realContentHash?: boolean;
10801
+
10802
+ /**
10803
+ * Removes modules from chunks when these modules are already included in all parents.
10804
+ */
10805
+ removeAvailableModules?: boolean;
10806
+
10807
+ /**
10808
+ * Remove chunks which are empty.
10809
+ */
10810
+ removeEmptyChunks?: boolean;
10811
+
10812
+ /**
10813
+ * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
10814
+ */
10815
+ runtimeChunk?:
10816
+ | false
10817
+ | {
10818
+ /**
10819
+ * The name factory for the runtime chunks.
10820
+ */
10821
+ name?: (entrypoint: { name: string }) => string;
10607
10822
  };
10608
10823
 
10609
10824
  /**
@@ -10759,8 +10974,13 @@ declare interface OptimizationSplitChunksOptions {
10759
10974
  [index: string]:
10760
10975
  | string
10761
10976
  | false
10762
- | Function
10763
10977
  | RegExp
10978
+ | ((
10979
+ module: Module
10980
+ ) =>
10981
+ | void
10982
+ | OptimizationSplitChunksCacheGroup
10983
+ | OptimizationSplitChunksCacheGroup[])
10764
10984
  | OptimizationSplitChunksCacheGroup;
10765
10985
  };
10766
10986
 
@@ -11587,6 +11807,11 @@ declare interface ParserOptionsByModuleTypeKnown {
11587
11807
  * Parser options for javascript modules.
11588
11808
  */
11589
11809
  "javascript/esm"?: JavascriptParserOptions;
11810
+
11811
+ /**
11812
+ * Parser options for JSON modules.
11813
+ */
11814
+ json?: JsonParserOptions;
11590
11815
  }
11591
11816
 
11592
11817
  /**
@@ -11638,7 +11863,7 @@ declare interface PerformanceOptions {
11638
11863
  /**
11639
11864
  * Filter function to select assets that are checked.
11640
11865
  */
11641
- assetFilter?: Function;
11866
+ assetFilter?: (name: string, source: Source, assetInfo: AssetInfo) => boolean;
11642
11867
 
11643
11868
  /**
11644
11869
  * Sets the format of the hints: warnings, errors or nothing at all.
@@ -11765,12 +11990,12 @@ declare interface ProcessAssetsAdditionalOptions {
11765
11990
  additionalAssets?: any;
11766
11991
  }
11767
11992
  declare class Profiler {
11768
- constructor(inspector?: any);
11769
- session: any;
11770
- inspector: any;
11993
+ constructor(inspector: Inspector);
11994
+ session?: SessionImportInspectorClass_2;
11995
+ inspector: Inspector;
11771
11996
  hasSession(): boolean;
11772
11997
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
11773
- sendCommand(method: string, params?: Record<string, any>): Promise<any>;
11998
+ sendCommand(method: string, params?: object): Promise<any>;
11774
11999
  destroy(): Promise<void>;
11775
12000
  stopProfiling(): Promise<{ profile: any }>;
11776
12001
  }
@@ -13347,12 +13572,19 @@ declare interface ResourceDataWithData {
13347
13572
  data: Record<string, any>;
13348
13573
  }
13349
13574
  declare abstract class RestoreProvidedData {
13350
- exports: any[];
13575
+ exports: RestoreProvidedDataExports[];
13351
13576
  otherProvided?: null | boolean;
13352
13577
  otherCanMangleProvide?: boolean;
13353
13578
  otherTerminalBinding: boolean;
13354
13579
  serialize(__0: ObjectSerializerContext): void;
13355
13580
  }
13581
+ declare interface RestoreProvidedDataExports {
13582
+ name: string;
13583
+ provided?: null | boolean;
13584
+ canMangleProvide?: boolean;
13585
+ terminalBinding: boolean;
13586
+ exportsInfo?: RestoreProvidedData;
13587
+ }
13356
13588
  declare interface RmDirOptions {
13357
13589
  maxRetries?: number;
13358
13590
  recursive?: boolean;
@@ -13661,6 +13893,7 @@ declare interface RuleSetRule {
13661
13893
  | string
13662
13894
  | false
13663
13895
  | 0
13896
+ | RuleSetUseFunction
13664
13897
  | {
13665
13898
  /**
13666
13899
  * Unique loader options identifier.
@@ -13675,32 +13908,8 @@ declare interface RuleSetRule {
13675
13908
  */
13676
13909
  options?: string | { [index: string]: any };
13677
13910
  }
13678
- | ((data: object) =>
13679
- | string
13680
- | {
13681
- /**
13682
- * Unique loader options identifier.
13683
- */
13684
- ident?: string;
13685
- /**
13686
- * Loader name.
13687
- */
13688
- loader?: string;
13689
- /**
13690
- * Loader options.
13691
- */
13692
- options?: string | { [index: string]: any };
13693
- }
13694
- | __TypeWebpackOptions
13695
- | __Type_2[])
13696
13911
  )[]
13697
- | ((data: {
13698
- resource: string;
13699
- realResource: string;
13700
- resourceQuery: string;
13701
- issuer: string;
13702
- compiler: string;
13703
- }) => __Type_2[])
13912
+ | RuleSetUseFunction
13704
13913
  | {
13705
13914
  /**
13706
13915
  * Unique loader options identifier.
@@ -13714,8 +13923,7 @@ declare interface RuleSetRule {
13714
13923
  * Loader options.
13715
13924
  */
13716
13925
  options?: string | { [index: string]: any };
13717
- }
13718
- | __TypeWebpackOptions;
13926
+ };
13719
13927
 
13720
13928
  /**
13721
13929
  * Match on import attributes of the dependency.
@@ -13730,6 +13938,7 @@ type RuleSetUse =
13730
13938
  | string
13731
13939
  | false
13732
13940
  | 0
13941
+ | RuleSetUseFunction
13733
13942
  | {
13734
13943
  /**
13735
13944
  * Unique loader options identifier.
@@ -13744,32 +13953,25 @@ type RuleSetUse =
13744
13953
  */
13745
13954
  options?: string | { [index: string]: any };
13746
13955
  }
13747
- | ((data: object) =>
13748
- | string
13749
- | {
13750
- /**
13751
- * Unique loader options identifier.
13752
- */
13753
- ident?: string;
13754
- /**
13755
- * Loader name.
13756
- */
13757
- loader?: string;
13758
- /**
13759
- * Loader options.
13760
- */
13761
- options?: string | { [index: string]: any };
13762
- }
13763
- | __TypeWebpackOptions
13764
- | __Type_2[])
13765
13956
  )[]
13766
- | ((data: {
13767
- resource: string;
13768
- realResource: string;
13769
- resourceQuery: string;
13770
- issuer: string;
13771
- compiler: string;
13772
- }) => __Type_2[])
13957
+ | RuleSetUseFunction
13958
+ | {
13959
+ /**
13960
+ * Unique loader options identifier.
13961
+ */
13962
+ ident?: string;
13963
+ /**
13964
+ * Loader name.
13965
+ */
13966
+ loader?: string;
13967
+ /**
13968
+ * Loader options.
13969
+ */
13970
+ options?: string | { [index: string]: any };
13971
+ };
13972
+ type RuleSetUseFunction = (data: EffectData) =>
13973
+ | string
13974
+ | RuleSetUseFunction
13773
13975
  | {
13774
13976
  /**
13775
13977
  * Unique loader options identifier.
@@ -13784,9 +13986,31 @@ type RuleSetUse =
13784
13986
  */
13785
13987
  options?: string | { [index: string]: any };
13786
13988
  }
13787
- | __TypeWebpackOptions;
13989
+ | (
13990
+ | undefined
13991
+ | null
13992
+ | string
13993
+ | false
13994
+ | 0
13995
+ | RuleSetUseFunction
13996
+ | {
13997
+ /**
13998
+ * Unique loader options identifier.
13999
+ */
14000
+ ident?: string;
14001
+ /**
14002
+ * Loader name.
14003
+ */
14004
+ loader?: string;
14005
+ /**
14006
+ * Loader options.
14007
+ */
14008
+ options?: string | { [index: string]: any };
14009
+ }
14010
+ )[];
13788
14011
  type RuleSetUseItem =
13789
14012
  | string
14013
+ | RuleSetUseFunction
13790
14014
  | {
13791
14015
  /**
13792
14016
  * Unique loader options identifier.
@@ -13800,18 +14024,18 @@ type RuleSetUseItem =
13800
14024
  * Loader options.
13801
14025
  */
13802
14026
  options?: string | { [index: string]: any };
13803
- }
13804
- | __TypeWebpackOptions;
14027
+ };
13805
14028
  declare interface RunCallback<T> {
13806
14029
  (err: null | Error, result?: T): any;
13807
14030
  }
13808
14031
  declare class RuntimeChunkPlugin {
13809
- constructor(options: { name?: (entrypoint: { name: string }) => string });
13810
- options: {
13811
- name:
13812
- | ((entrypoint: { name: string }) => string)
13813
- | ((entrypoint: Entrypoint) => string);
13814
- };
14032
+ constructor(options?: {
14033
+ /**
14034
+ * The name factory for the runtime chunks.
14035
+ */
14036
+ name?: (entrypoint: { name: string }) => string;
14037
+ });
14038
+ options: { name: (entrypoint: { name: string }) => string };
13815
14039
 
13816
14040
  /**
13817
14041
  * Apply the plugin
@@ -15889,20 +16113,56 @@ declare class WebpackError extends Error {
15889
16113
  cause: any;
15890
16114
 
15891
16115
  /**
15892
- * Create .stack property on a target object
16116
+ * Creates a `.stack` property on `targetObject`, which when accessed returns
16117
+ * a string representing the location in the code at which
16118
+ * `Error.captureStackTrace()` was called.
16119
+ * ```js
16120
+ * const myObject = {};
16121
+ * Error.captureStackTrace(myObject);
16122
+ * myObject.stack; // Similar to `new Error().stack`
16123
+ * ```
16124
+ * The first line of the trace will be prefixed with
16125
+ * `${myObject.name}: ${myObject.message}`.
16126
+ * The optional `constructorOpt` argument accepts a function. If given, all frames
16127
+ * above `constructorOpt`, including `constructorOpt`, will be omitted from the
16128
+ * generated stack trace.
16129
+ * The `constructorOpt` argument is useful for hiding implementation
16130
+ * details of error generation from the user. For instance:
16131
+ * ```js
16132
+ * function a() {
16133
+ * b();
16134
+ * }
16135
+ * function b() {
16136
+ * c();
16137
+ * }
16138
+ * function c() {
16139
+ * // Create an error without stack trace to avoid calculating the stack trace twice.
16140
+ * const { stackTraceLimit } = Error;
16141
+ * Error.stackTraceLimit = 0;
16142
+ * const error = new Error();
16143
+ * Error.stackTraceLimit = stackTraceLimit;
16144
+ * // Capture the stack trace above function b
16145
+ * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
16146
+ * throw error;
16147
+ * }
16148
+ * a();
16149
+ * ```
15893
16150
  */
15894
16151
  static captureStackTrace(
15895
16152
  targetObject: object,
15896
16153
  constructorOpt?: Function
15897
16154
  ): void;
16155
+ static prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
15898
16156
 
15899
16157
  /**
15900
- * Optional override for formatting stack traces
16158
+ * The `Error.stackTraceLimit` property specifies the number of stack frames
16159
+ * collected by a stack trace (whether generated by `new Error().stack` or
16160
+ * `Error.captureStackTrace(obj)`).
16161
+ * The default value is `10` but may be set to any valid JavaScript number. Changes
16162
+ * will affect any stack trace captured _after_ the value has been changed.
16163
+ * If set to a non-number value, or set to a negative number, stack traces will
16164
+ * not capture any frames.
15901
16165
  */
15902
- static prepareStackTrace?: (
15903
- err: Error,
15904
- stackTraces: NodeJS.CallSite[]
15905
- ) => any;
15906
16166
  static stackTraceLimit: number;
15907
16167
  }
15908
16168
  declare abstract class WebpackLogger {
@@ -16059,7 +16319,7 @@ declare interface WebpackOptionsNormalized {
16059
16319
  /**
16060
16320
  * Enables/Disables integrated optimizations.
16061
16321
  */
16062
- optimization: Optimization;
16322
+ optimization: OptimizationNormalized;
16063
16323
 
16064
16324
  /**
16065
16325
  * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
@@ -16250,62 +16510,6 @@ declare interface WriteStreamOptions {
16250
16510
  signal?: null | AbortSignal;
16251
16511
  fs?: null | CreateWriteStreamFSImplementation;
16252
16512
  }
16253
- type __TypeWebpackOptions = (data: object) =>
16254
- | string
16255
- | {
16256
- /**
16257
- * Unique loader options identifier.
16258
- */
16259
- ident?: string;
16260
- /**
16261
- * Loader name.
16262
- */
16263
- loader?: string;
16264
- /**
16265
- * Loader options.
16266
- */
16267
- options?: string | { [index: string]: any };
16268
- }
16269
- | __TypeWebpackOptions
16270
- | __Type_2[];
16271
- type __Type_2 =
16272
- | undefined
16273
- | null
16274
- | string
16275
- | false
16276
- | 0
16277
- | {
16278
- /**
16279
- * Unique loader options identifier.
16280
- */
16281
- ident?: string;
16282
- /**
16283
- * Loader name.
16284
- */
16285
- loader?: string;
16286
- /**
16287
- * Loader options.
16288
- */
16289
- options?: string | { [index: string]: any };
16290
- }
16291
- | ((data: object) =>
16292
- | string
16293
- | {
16294
- /**
16295
- * Unique loader options identifier.
16296
- */
16297
- ident?: string;
16298
- /**
16299
- * Loader name.
16300
- */
16301
- loader?: string;
16302
- /**
16303
- * Loader options.
16304
- */
16305
- options?: string | { [index: string]: any };
16306
- }
16307
- | __TypeWebpackOptions
16308
- | __Type_2[]);
16309
16513
  declare function exports(
16310
16514
  options: Configuration,
16311
16515
  callback?: CallbackWebpack<Stats>
@@ -16399,7 +16603,10 @@ declare namespace exports {
16399
16603
  export let REGEXP_NAMESPACE: RegExp;
16400
16604
  export let createFilename: (
16401
16605
  module: string | Module,
16402
- options: { namespace?: string; moduleFilenameTemplate?: any },
16606
+ options: {
16607
+ namespace?: string;
16608
+ moduleFilenameTemplate?: string | ((context?: any) => string);
16609
+ },
16403
16610
  __2: {
16404
16611
  requestShortener: RequestShortener;
16405
16612
  chunkGraph: ChunkGraph;
@@ -16670,7 +16877,7 @@ declare namespace exports {
16670
16877
  export { ProfilingPlugin };
16671
16878
  }
16672
16879
  export namespace util {
16673
- export const createHash: (algorithm: Algorithm) => Hash;
16880
+ export const createHash: (algorithm: HashFunction) => Hash;
16674
16881
  export namespace comparators {
16675
16882
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
16676
16883
  export let compareModulesByIdentifier: (
@@ -16837,6 +17044,81 @@ declare namespace exports {
16837
17044
  export { SyncModuleIdsPlugin };
16838
17045
  }
16839
17046
  }
17047
+ export type ExternalItemFunctionCallback = (
17048
+ data: ExternalItemFunctionData,
17049
+ callback: (
17050
+ err?: null | Error,
17051
+ result?: string | boolean | string[] | { [index: string]: any }
17052
+ ) => void
17053
+ ) => void;
17054
+ export type ExternalItemFunctionDataGetResolve = (
17055
+ options?: ResolveOptions
17056
+ ) =>
17057
+ | ((
17058
+ context: string,
17059
+ request: string,
17060
+ callback: (
17061
+ err?: null | Error,
17062
+ result?: string | false,
17063
+ resolveRequest?: ResolveRequest
17064
+ ) => void
17065
+ ) => void)
17066
+ | ((context: string, request: string) => Promise<string>);
17067
+ export type ExternalItemFunctionDataGetResolveCallbackResult = (
17068
+ context: string,
17069
+ request: string,
17070
+ callback: (
17071
+ err?: null | Error,
17072
+ result?: string | false,
17073
+ resolveRequest?: ResolveRequest
17074
+ ) => void
17075
+ ) => void;
17076
+ export type ExternalItemFunctionDataGetResolveResult = (
17077
+ context: string,
17078
+ request: string
17079
+ ) => Promise<string>;
17080
+ export type ExternalItemFunctionPromise = (
17081
+ data: ExternalItemFunctionData
17082
+ ) => Promise<ExternalItemValue>;
17083
+ export type RuleSetUseFunction = (data: EffectData) =>
17084
+ | string
17085
+ | RuleSetUseFunction
17086
+ | {
17087
+ /**
17088
+ * Unique loader options identifier.
17089
+ */
17090
+ ident?: string;
17091
+ /**
17092
+ * Loader name.
17093
+ */
17094
+ loader?: string;
17095
+ /**
17096
+ * Loader options.
17097
+ */
17098
+ options?: string | { [index: string]: any };
17099
+ }
17100
+ | (
17101
+ | undefined
17102
+ | null
17103
+ | string
17104
+ | false
17105
+ | 0
17106
+ | RuleSetUseFunction
17107
+ | {
17108
+ /**
17109
+ * Unique loader options identifier.
17110
+ */
17111
+ ident?: string;
17112
+ /**
17113
+ * Loader name.
17114
+ */
17115
+ loader?: string;
17116
+ /**
17117
+ * Loader options.
17118
+ */
17119
+ options?: string | { [index: string]: any };
17120
+ }
17121
+ )[];
16840
17122
  export type WebpackPluginFunction = (
16841
17123
  this: Compiler,
16842
17124
  compiler: Compiler
@@ -16903,15 +17185,19 @@ declare namespace exports {
16903
17185
  Entry,
16904
17186
  EntryNormalized,
16905
17187
  EntryObject,
17188
+ ExternalItem,
17189
+ ExternalItemFunction,
16906
17190
  ExternalItemFunctionData,
16907
17191
  ExternalItemObjectKnown,
16908
17192
  ExternalItemObjectUnknown,
16909
17193
  ExternalItemValue,
16910
17194
  Externals,
16911
17195
  FileCacheOptions,
17196
+ GeneratorOptionsByModuleTypeKnown,
16912
17197
  LibraryOptions,
16913
17198
  MemoryCacheOptions,
16914
17199
  ModuleOptions,
17200
+ ParserOptionsByModuleTypeKnown,
16915
17201
  ResolveOptions,
16916
17202
  RuleSetCondition,
16917
17203
  RuleSetConditionAbsolute,
@@ -16928,6 +17214,7 @@ declare namespace exports {
16928
17214
  EntryOptions,
16929
17215
  PathData,
16930
17216
  AssetEmittedInfo,
17217
+ Entrypoint,
16931
17218
  MultiCompilerOptions,
16932
17219
  MultiStats,
16933
17220
  ResolveData,