webpack 5.99.6 → 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 (219) hide show
  1. package/lib/AutomaticPrefetchPlugin.js +21 -22
  2. package/lib/BannerPlugin.js +31 -35
  3. package/lib/CleanPlugin.js +5 -3
  4. package/lib/Compilation.js +21 -15
  5. package/lib/Compiler.js +2 -1
  6. package/lib/ContextExclusionPlugin.js +4 -2
  7. package/lib/ContextModule.js +1 -1
  8. package/lib/ContextModuleFactory.js +1 -2
  9. package/lib/ContextReplacementPlugin.js +7 -4
  10. package/lib/DefinePlugin.js +2 -2
  11. package/lib/DelegatedModule.js +18 -8
  12. package/lib/DelegatedModuleFactoryPlugin.js +9 -7
  13. package/lib/DelegatedPlugin.js +4 -2
  14. package/lib/DllEntryPlugin.js +4 -2
  15. package/lib/DllPlugin.js +5 -3
  16. package/lib/DllReferencePlugin.js +56 -60
  17. package/lib/DynamicEntryPlugin.js +4 -2
  18. package/lib/EntryOptionPlugin.js +3 -1
  19. package/lib/EntryPlugin.js +4 -2
  20. package/lib/EnvironmentPlugin.js +4 -2
  21. package/lib/EvalDevToolModulePlugin.js +9 -7
  22. package/lib/EvalSourceMapDevToolPlugin.js +138 -139
  23. package/lib/ExportsInfo.js +35 -16
  24. package/lib/ExternalModule.js +6 -5
  25. package/lib/ExternalsPlugin.js +3 -1
  26. package/lib/FileSystemInfo.js +2 -2
  27. package/lib/FlagDependencyExportsPlugin.js +2 -1
  28. package/lib/IgnorePlugin.js +6 -4
  29. package/lib/IgnoreWarningsPlugin.js +4 -2
  30. package/lib/LibManifestPlugin.js +5 -6
  31. package/lib/LoaderOptionsPlugin.js +4 -2
  32. package/lib/LoaderTargetPlugin.js +4 -2
  33. package/lib/Module.js +19 -12
  34. package/lib/ModuleFilenameHelpers.js +8 -4
  35. package/lib/ModuleInfoHeaderPlugin.js +11 -12
  36. package/lib/MultiCompiler.js +5 -3
  37. package/lib/NoEmitOnErrorsPlugin.js +5 -3
  38. package/lib/NormalModule.js +13 -8
  39. package/lib/NormalModuleReplacementPlugin.js +33 -36
  40. package/lib/PlatformPlugin.js +3 -1
  41. package/lib/PrefetchPlugin.js +4 -2
  42. package/lib/ProgressPlugin.js +23 -26
  43. package/lib/RecordIdsPlugin.js +72 -102
  44. package/lib/RuntimePlugin.js +34 -32
  45. package/lib/SourceMapDevToolPlugin.js +9 -8
  46. package/lib/WarnCaseSensitiveModulesPlugin.js +36 -37
  47. package/lib/WarnNoModeSetPlugin.js +3 -1
  48. package/lib/WatchIgnorePlugin.js +3 -1
  49. package/lib/WebpackError.js +11 -3
  50. package/lib/WebpackOptionsApply.js +6 -7
  51. package/lib/asset/AssetGenerator.js +2 -2
  52. package/lib/async-modules/InferAsyncModulesPlugin.js +25 -26
  53. package/lib/cache/IdleFileCachePlugin.js +11 -12
  54. package/lib/cache/MemoryWithGcCachePlugin.js +7 -5
  55. package/lib/cache/ResolverCachePlugin.js +8 -6
  56. package/lib/cli.js +5 -1
  57. package/lib/config/defaults.js +10 -6
  58. package/lib/config/normalization.js +14 -8
  59. package/lib/container/ContainerReferencePlugin.js +24 -26
  60. package/lib/container/ModuleFederationPlugin.js +2 -1
  61. package/lib/css/CssGenerator.js +1 -1
  62. package/lib/css/CssModulesPlugin.js +8 -6
  63. package/lib/debug/ProfilingPlugin.js +18 -21
  64. package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -1
  65. package/lib/dependencies/ContextElementDependency.js +1 -1
  66. package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
  67. package/lib/dependencies/HarmonyDetectionParserPlugin.js +9 -15
  68. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -15
  69. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -2
  70. package/lib/dependencies/LoaderPlugin.js +5 -3
  71. package/lib/dependencies/RequireContextDependencyParserPlugin.js +46 -46
  72. package/lib/dependencies/RequireContextPlugin.js +2 -1
  73. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +94 -100
  74. package/lib/dependencies/WorkerPlugin.js +2 -2
  75. package/lib/esm/ModuleChunkLoadingPlugin.js +72 -73
  76. package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
  77. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +0 -2
  78. package/lib/hmr/LazyCompilationPlugin.js +17 -18
  79. package/lib/ids/ChunkModuleIdRangePlugin.js +6 -6
  80. package/lib/ids/DeterministicModuleIdsPlugin.js +47 -48
  81. package/lib/ids/HashedModuleIdsPlugin.js +4 -2
  82. package/lib/ids/NamedChunkIdsPlugin.js +4 -2
  83. package/lib/ids/NamedModuleIdsPlugin.js +4 -2
  84. package/lib/ids/NaturalChunkIdsPlugin.js +4 -2
  85. package/lib/ids/NaturalModuleIdsPlugin.js +4 -2
  86. package/lib/ids/OccurrenceChunkIdsPlugin.js +4 -2
  87. package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -2
  88. package/lib/index.js +11 -0
  89. package/lib/javascript/JavascriptModulesPlugin.js +2 -2
  90. package/lib/javascript/JavascriptParser.js +634 -656
  91. package/lib/json/JsonModulesPlugin.js +4 -4
  92. package/lib/library/AbstractLibraryPlugin.js +1 -1
  93. package/lib/library/ModuleLibraryPlugin.js +60 -42
  94. package/lib/node/CommonJsChunkLoadingPlugin.js +69 -73
  95. package/lib/node/NodeEnvironmentPlugin.js +3 -1
  96. package/lib/node/nodeConsole.js +3 -2
  97. package/lib/optimize/AggressiveSplittingPlugin.js +224 -232
  98. package/lib/optimize/ConcatenatedModule.js +15 -16
  99. package/lib/optimize/FlagIncludedChunksPlugin.js +92 -97
  100. package/lib/optimize/LimitChunkCountPlugin.js +4 -2
  101. package/lib/optimize/MangleExportsPlugin.js +15 -16
  102. package/lib/optimize/MinChunkSizePlugin.js +4 -2
  103. package/lib/optimize/ModuleConcatenationPlugin.js +6 -4
  104. package/lib/optimize/RealContentHashPlugin.js +4 -2
  105. package/lib/optimize/RemoveEmptyChunksPlugin.js +5 -3
  106. package/lib/optimize/RemoveParentModulesPlugin.js +4 -2
  107. package/lib/optimize/RuntimeChunkPlugin.js +21 -23
  108. package/lib/optimize/SideEffectsFlagPlugin.js +9 -6
  109. package/lib/optimize/SplitChunksPlugin.js +9 -7
  110. package/lib/performance/SizeLimitsPlugin.js +3 -1
  111. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +61 -62
  112. package/lib/rules/BasicEffectRulePlugin.js +1 -2
  113. package/lib/rules/ObjectMatcherRulePlugin.js +2 -1
  114. package/lib/rules/RuleSetCompiler.js +19 -5
  115. package/lib/rules/UseEffectRulePlugin.js +4 -6
  116. package/lib/runtime/StartupChunkDependenciesPlugin.js +39 -42
  117. package/lib/schemes/DataUriPlugin.js +5 -3
  118. package/lib/schemes/FileUriPlugin.js +5 -3
  119. package/lib/schemes/HttpUriPlugin.js +186 -188
  120. package/lib/serialization/AggregateErrorSerializer.js +42 -0
  121. package/lib/serialization/ErrorObjectSerializer.js +7 -2
  122. package/lib/serialization/ObjectMiddleware.js +13 -0
  123. package/lib/sharing/ProvideSharedPlugin.js +6 -4
  124. package/lib/stats/DefaultStatsFactoryPlugin.js +89 -33
  125. package/lib/stats/DefaultStatsPresetPlugin.js +25 -20
  126. package/lib/stats/DefaultStatsPrinterPlugin.js +306 -341
  127. package/lib/util/concatenate.js +4 -2
  128. package/lib/util/createHash.js +3 -3
  129. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +55 -57
  130. package/lib/web/JsonpChunkLoadingPlugin.js +73 -74
  131. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +77 -78
  132. package/package.json +35 -30
  133. package/schemas/WebpackOptions.check.d.ts +1 -1
  134. package/schemas/WebpackOptions.check.js +2 -2
  135. package/schemas/WebpackOptions.json +267 -26
  136. package/schemas/plugins/BannerPlugin.check.d.ts +1 -1
  137. package/schemas/plugins/BannerPlugin.check.js +1 -1
  138. package/schemas/plugins/DllPlugin.check.d.ts +1 -1
  139. package/schemas/plugins/DllPlugin.check.js +1 -1
  140. package/schemas/plugins/DllReferencePlugin.check.d.ts +1 -1
  141. package/schemas/plugins/DllReferencePlugin.check.js +1 -1
  142. package/schemas/plugins/HashedModuleIdsPlugin.check.d.ts +1 -1
  143. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  144. package/schemas/plugins/IgnorePlugin.check.d.ts +1 -1
  145. package/schemas/plugins/IgnorePlugin.check.js +1 -1
  146. package/schemas/plugins/LoaderOptionsPlugin.check.d.ts +1 -1
  147. package/schemas/plugins/LoaderOptionsPlugin.check.js +1 -1
  148. package/schemas/plugins/ProgressPlugin.check.d.ts +1 -1
  149. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  150. package/schemas/plugins/SourceMapDevToolPlugin.check.d.ts +1 -1
  151. package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
  152. package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
  153. package/schemas/plugins/WatchIgnorePlugin.check.d.ts +1 -1
  154. package/schemas/plugins/WatchIgnorePlugin.check.js +1 -1
  155. package/schemas/plugins/asset/AssetGeneratorOptions.check.d.ts +1 -1
  156. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  157. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.d.ts +1 -1
  158. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.js +1 -1
  159. package/schemas/plugins/asset/AssetParserOptions.check.d.ts +1 -1
  160. package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
  161. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.d.ts +1 -1
  162. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  163. package/schemas/plugins/container/ContainerPlugin.check.d.ts +1 -1
  164. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  165. package/schemas/plugins/container/ContainerReferencePlugin.check.d.ts +1 -1
  166. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  167. package/schemas/plugins/container/ExternalsType.check.d.ts +1 -1
  168. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  169. package/schemas/plugins/container/ModuleFederationPlugin.check.d.ts +1 -1
  170. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  171. package/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts +1 -1
  172. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +1 -1
  173. package/schemas/plugins/css/CssAutoParserOptions.check.d.ts +1 -1
  174. package/schemas/plugins/css/CssAutoParserOptions.check.js +1 -1
  175. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +1 -1
  176. package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
  177. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts +1 -1
  178. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +1 -1
  179. package/schemas/plugins/css/CssGlobalParserOptions.check.d.ts +1 -1
  180. package/schemas/plugins/css/CssGlobalParserOptions.check.js +1 -1
  181. package/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts +1 -1
  182. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
  183. package/schemas/plugins/css/CssModuleParserOptions.check.d.ts +1 -1
  184. package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
  185. package/schemas/plugins/css/CssParserOptions.check.d.ts +1 -1
  186. package/schemas/plugins/css/CssParserOptions.check.js +1 -1
  187. package/schemas/plugins/debug/ProfilingPlugin.check.d.ts +1 -1
  188. package/schemas/plugins/debug/ProfilingPlugin.check.js +1 -1
  189. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.d.ts +1 -1
  190. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.js +1 -1
  191. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.d.ts +1 -1
  192. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.js +1 -1
  193. package/schemas/plugins/json/JsonModulesPluginGenerator.check.d.ts +7 -0
  194. package/schemas/plugins/{JsonModulesPluginGenerator.check.js → json/JsonModulesPluginGenerator.check.js} +1 -1
  195. package/schemas/plugins/json/JsonModulesPluginGenerator.json +3 -0
  196. package/schemas/plugins/json/JsonModulesPluginParser.check.d.ts +7 -0
  197. package/schemas/plugins/{JsonModulesPluginParser.check.js → json/JsonModulesPluginParser.check.js} +1 -1
  198. package/schemas/plugins/json/JsonModulesPluginParser.json +3 -0
  199. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.d.ts +1 -1
  200. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
  201. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.d.ts +1 -1
  202. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
  203. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.d.ts +1 -1
  204. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.js +1 -1
  205. package/schemas/plugins/optimize/MinChunkSizePlugin.check.d.ts +1 -1
  206. package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
  207. package/schemas/plugins/schemes/HttpUriPlugin.check.d.ts +1 -1
  208. package/schemas/plugins/schemes/HttpUriPlugin.check.js +1 -1
  209. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.d.ts +1 -1
  210. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.js +1 -1
  211. package/schemas/plugins/sharing/ProvideSharedPlugin.check.d.ts +1 -1
  212. package/schemas/plugins/sharing/ProvideSharedPlugin.check.js +1 -1
  213. package/schemas/plugins/sharing/SharePlugin.check.d.ts +1 -1
  214. package/schemas/plugins/sharing/SharePlugin.check.js +1 -1
  215. package/types.d.ts +587 -207
  216. package/schemas/plugins/JsonModulesPluginGenerator.check.d.ts +0 -7
  217. package/schemas/plugins/JsonModulesPluginGenerator.json +0 -11
  218. package/schemas/plugins/JsonModulesPluginParser.check.d.ts +0 -7
  219. 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,14 +88,15 @@ 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";
94
98
  import { default as ValidationError } from "schema-utils/declarations/ValidationError";
95
- import {
96
- Extend,
97
- ValidationErrorConfiguration
98
- } from "schema-utils/declarations/validate";
99
+ import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
99
100
  import {
100
101
  AsArray,
101
102
  AsyncParallelHook,
@@ -227,7 +228,6 @@ declare interface AggressiveSplittingPluginOptions {
227
228
  */
228
229
  minSize?: number;
229
230
  }
230
- type Algorithm = string | typeof Hash;
231
231
  type Alias = string | false | string[];
232
232
  declare interface AliasOption {
233
233
  alias: Alias;
@@ -1962,8 +1962,8 @@ declare class Compilation {
1962
1962
  needAdditionalPass: SyncBailHook<[], boolean | void>;
1963
1963
  childCompiler: SyncHook<[Compiler, string, number]>;
1964
1964
  log: SyncBailHook<[string, LogEntry], boolean | void>;
1965
- processWarnings: SyncWaterfallHook<[WebpackError[]]>;
1966
- processErrors: SyncWaterfallHook<[WebpackError[]]>;
1965
+ processWarnings: SyncWaterfallHook<[Error[]]>;
1966
+ processErrors: SyncWaterfallHook<[Error[]]>;
1967
1967
  statsPreset: HookMap<
1968
1968
  SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
1969
1969
  >;
@@ -2030,8 +2030,8 @@ declare class Compilation {
2030
2030
  additionalChunkAssets: string[];
2031
2031
  assets: CompilationAssets;
2032
2032
  assetsInfo: Map<string, AssetInfo>;
2033
- errors: WebpackError[];
2034
- warnings: WebpackError[];
2033
+ errors: Error[];
2034
+ warnings: Error[];
2035
2035
  children: Compilation[];
2036
2036
  logging: Map<string, LogEntry[]>;
2037
2037
  dependencyFactories: Map<DepConstructor, ModuleFactory>;
@@ -2230,8 +2230,8 @@ declare class Compilation {
2230
2230
  filename: TemplatePath,
2231
2231
  data: PathData
2232
2232
  ): InterpolatedPathAndAssetInfo;
2233
- getWarnings(): WebpackError[];
2234
- getErrors(): WebpackError[];
2233
+ getWarnings(): Error[];
2234
+ getErrors(): Error[];
2235
2235
 
2236
2236
  /**
2237
2237
  * This function allows you to run another instance of webpack inside of webpack however as
@@ -2643,7 +2643,6 @@ declare interface Configuration {
2643
2643
  externals?:
2644
2644
  | string
2645
2645
  | RegExp
2646
- | ExternalItem[]
2647
2646
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
2648
2647
  | ((
2649
2648
  data: ExternalItemFunctionData,
@@ -2652,7 +2651,8 @@ declare interface Configuration {
2652
2651
  result?: string | boolean | string[] | { [index: string]: any }
2653
2652
  ) => void
2654
2653
  ) => void)
2655
- | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
2654
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
2655
+ | ExternalItem[];
2656
2656
 
2657
2657
  /**
2658
2658
  * Enable presets of externals for specific targets.
@@ -2705,7 +2705,7 @@ declare interface Configuration {
2705
2705
  */
2706
2706
  module?: RegExp;
2707
2707
  }
2708
- | ((warning: WebpackError, compilation: Compilation) => boolean)
2708
+ | ((warning: Error, compilation: Compilation) => boolean)
2709
2709
  )[];
2710
2710
 
2711
2711
  /**
@@ -3175,6 +3175,17 @@ declare interface CssAutoParserOptions {
3175
3175
  */
3176
3176
  url?: boolean;
3177
3177
  }
3178
+ declare interface CssData {
3179
+ /**
3180
+ * whether export __esModule
3181
+ */
3182
+ esModule: boolean;
3183
+
3184
+ /**
3185
+ * the css exports
3186
+ */
3187
+ exports: Map<string, string>;
3188
+ }
3178
3189
 
3179
3190
  /**
3180
3191
  * Generator options for css modules.
@@ -3914,7 +3925,18 @@ declare interface Effect {
3914
3925
  value: any;
3915
3926
  }
3916
3927
  declare interface EffectData {
3917
- [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;
3918
3940
  }
3919
3941
  declare class ElectronTargetPlugin {
3920
3942
  constructor(context?: "main" | "preload" | "renderer");
@@ -4802,6 +4824,15 @@ type ExternalItem =
4802
4824
  ) => void
4803
4825
  ) => void)
4804
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>);
4805
4836
 
4806
4837
  /**
4807
4838
  * Data object passed as argument when a function is set for 'externals'.
@@ -4906,7 +4937,6 @@ declare interface ExternalModuleInfo {
4906
4937
  type Externals =
4907
4938
  | string
4908
4939
  | RegExp
4909
- | ExternalItem[]
4910
4940
  | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
4911
4941
  | ((
4912
4942
  data: ExternalItemFunctionData,
@@ -4915,7 +4945,8 @@ type Externals =
4915
4945
  result?: string | boolean | string[] | { [index: string]: any }
4916
4946
  ) => void
4917
4947
  ) => void)
4918
- | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4948
+ | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
4949
+ | ExternalItem[];
4919
4950
  declare class ExternalsPlugin {
4920
4951
  constructor(type: undefined | string, externals: Externals);
4921
4952
  type?: string;
@@ -5859,7 +5890,11 @@ declare interface InfrastructureLogging {
5859
5890
  /**
5860
5891
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
5861
5892
  */
5862
- stream?: NodeJS.WritableStream;
5893
+ stream?: NodeJS.WritableStream & {
5894
+ isTTY?: boolean;
5895
+ columns?: number;
5896
+ rows?: number;
5897
+ };
5863
5898
  }
5864
5899
  declare class InitFragment<GenerateContext> {
5865
5900
  constructor(
@@ -5918,6 +5953,9 @@ declare interface InputFileSystem {
5918
5953
  relative?: (from: string, to: string) => string;
5919
5954
  dirname?: (dirname: string) => string;
5920
5955
  }
5956
+ declare interface Inspector {
5957
+ Session: typeof SessionImportInspectorClass_1;
5958
+ }
5921
5959
  type IntermediateFileSystem = InputFileSystem &
5922
5960
  OutputFileSystem &
5923
5961
  IntermediateFileSystemExtras;
@@ -7595,6 +7633,23 @@ type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
7595
7633
  | JsonObjectTypes
7596
7634
  | JsonValueTypes[];
7597
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
+ }
7598
7653
  type JsonValueFs =
7599
7654
  | null
7600
7655
  | string
@@ -7714,19 +7769,97 @@ declare interface KnownAssetInfo {
7714
7769
  declare interface KnownBuildInfo {
7715
7770
  cacheable?: boolean;
7716
7771
  parsed?: boolean;
7772
+ strict?: boolean;
7773
+
7774
+ /**
7775
+ * using in AMD
7776
+ */
7717
7777
  moduleArgument?: string;
7778
+
7779
+ /**
7780
+ * using in AMD
7781
+ */
7718
7782
  exportsArgument?: string;
7719
- strict?: boolean;
7783
+
7784
+ /**
7785
+ * using in CommonJs
7786
+ */
7720
7787
  moduleConcatenationBailout?: string;
7788
+
7789
+ /**
7790
+ * using in APIPlugin
7791
+ */
7792
+ needCreateRequire?: boolean;
7793
+
7794
+ /**
7795
+ * using in HttpUriPlugin
7796
+ */
7797
+ resourceIntegrity?: string;
7798
+
7799
+ /**
7800
+ * using in NormalModule
7801
+ */
7721
7802
  fileDependencies?: LazySet<string>;
7803
+
7804
+ /**
7805
+ * using in NormalModule
7806
+ */
7722
7807
  contextDependencies?: LazySet<string>;
7808
+
7809
+ /**
7810
+ * using in NormalModule
7811
+ */
7723
7812
  missingDependencies?: LazySet<string>;
7813
+
7814
+ /**
7815
+ * using in NormalModule
7816
+ */
7724
7817
  buildDependencies?: LazySet<string>;
7818
+
7819
+ /**
7820
+ * using in NormalModule
7821
+ */
7725
7822
  valueDependencies?: Map<string, string | Set<string>>;
7726
- hash?: any;
7823
+
7824
+ /**
7825
+ * using in NormalModule
7826
+ */
7727
7827
  assets?: Record<string, Source>;
7728
- assetsInfo?: Map<string, undefined | AssetInfo>;
7828
+
7829
+ /**
7830
+ * using in NormalModule
7831
+ */
7832
+ hash?: string;
7833
+
7834
+ /**
7835
+ * using in ContextModule
7836
+ */
7729
7837
  snapshot?: null | Snapshot;
7838
+
7839
+ /**
7840
+ * for assets modules
7841
+ */
7842
+ fullContentHash?: string;
7843
+
7844
+ /**
7845
+ * for assets modules
7846
+ */
7847
+ filename?: string;
7848
+
7849
+ /**
7850
+ * for assets modules
7851
+ */
7852
+ assetsInfo?: Map<string, undefined | AssetInfo>;
7853
+
7854
+ /**
7855
+ * for assets modules
7856
+ */
7857
+ dataUrl?: boolean;
7858
+
7859
+ /**
7860
+ * for css modules
7861
+ */
7862
+ cssData?: CssData;
7730
7863
  }
7731
7864
  declare interface KnownBuildMeta {
7732
7865
  exportsType?: "namespace" | "dynamic" | "default" | "flagged";
@@ -7903,6 +8036,8 @@ declare interface KnownStatsError {
7903
8036
  moduleTrace?: StatsModuleTraceItem[];
7904
8037
  details?: string;
7905
8038
  stack?: string;
8039
+ cause?: KnownStatsError;
8040
+ errors?: KnownStatsError[];
7906
8041
  compilerPath?: string;
7907
8042
  }
7908
8043
  declare interface KnownStatsFactoryContext {
@@ -8571,7 +8706,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
8571
8706
  async(): (
8572
8707
  err?: null | Error,
8573
8708
  content?: string | Buffer,
8574
- sourceMap?: string | SourceMap,
8709
+ sourceMap?: null | string | SourceMap,
8575
8710
  additionalData?: AdditionalData
8576
8711
  ) => void;
8577
8712
 
@@ -8585,7 +8720,7 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
8585
8720
  callback: (
8586
8721
  err?: null | Error,
8587
8722
  content?: string | Buffer,
8588
- sourceMap?: string | SourceMap,
8723
+ sourceMap?: null | string | SourceMap,
8589
8724
  additionalData?: AdditionalData
8590
8725
  ) => void;
8591
8726
 
@@ -9493,7 +9628,11 @@ declare interface ModuleOptions {
9493
9628
  /**
9494
9629
  * Don't parse files matching. It's matched against the full resolved request.
9495
9630
  */
9496
- noParse?: string | Function | RegExp | (string | Function | RegExp)[];
9631
+ noParse?:
9632
+ | string
9633
+ | RegExp
9634
+ | (string | RegExp | ((content: string) => boolean))[]
9635
+ | ((content: string) => boolean);
9497
9636
 
9498
9637
  /**
9499
9638
  * Specify options for each parser.
@@ -9538,7 +9677,7 @@ declare interface ModuleOptions {
9538
9677
  /**
9539
9678
  * Cache the resolving of module requests.
9540
9679
  */
9541
- unsafeCache?: boolean | Function;
9680
+ unsafeCache?: boolean | ((module: Module) => boolean);
9542
9681
 
9543
9682
  /**
9544
9683
  * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
@@ -9573,7 +9712,11 @@ declare interface ModuleOptionsNormalized {
9573
9712
  /**
9574
9713
  * Don't parse files matching. It's matched against the full resolved request.
9575
9714
  */
9576
- noParse?: string | Function | RegExp | (string | Function | RegExp)[];
9715
+ noParse?:
9716
+ | string
9717
+ | RegExp
9718
+ | (string | RegExp | ((content: string) => boolean))[]
9719
+ | ((content: string) => boolean);
9577
9720
 
9578
9721
  /**
9579
9722
  * Specify options for each parser.
@@ -9588,7 +9731,7 @@ declare interface ModuleOptionsNormalized {
9588
9731
  /**
9589
9732
  * Cache the resolving of module requests.
9590
9733
  */
9591
- unsafeCache?: boolean | Function;
9734
+ unsafeCache?: boolean | ((module: Module) => boolean);
9592
9735
  }
9593
9736
  declare interface ModulePathData {
9594
9737
  id: string | number;
@@ -9885,6 +10028,11 @@ declare class NoEmitOnErrorsPlugin {
9885
10028
  */
9886
10029
  apply(compiler: Compiler): void;
9887
10030
  }
10031
+ type NoParse =
10032
+ | string
10033
+ | RegExp
10034
+ | (string | RegExp | ((content: string) => boolean))[]
10035
+ | ((content: string) => boolean);
9888
10036
  type Node = false | NodeOptions;
9889
10037
  declare class NodeEnvironmentPlugin {
9890
10038
  constructor(options: NodeEnvironmentPluginOptions);
@@ -9989,8 +10137,16 @@ declare class NormalModule extends Module {
9989
10137
  associatedObjectForCache?: object
9990
10138
  ): Source;
9991
10139
  markModuleAsErrored(error: WebpackError): void;
9992
- applyNoParseRule(rule: any, content: string): boolean;
9993
- 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;
9994
10150
  static getCompilationHooks(
9995
10151
  compilation: Compilation
9996
10152
  ): NormalModuleCompilationHooks;
@@ -10515,7 +10671,154 @@ declare interface Optimization {
10515
10671
  /**
10516
10672
  * The name or name factory for the runtime chunks.
10517
10673
  */
10518
- 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;
10519
10822
  };
10520
10823
 
10521
10824
  /**
@@ -10671,8 +10974,13 @@ declare interface OptimizationSplitChunksOptions {
10671
10974
  [index: string]:
10672
10975
  | string
10673
10976
  | false
10674
- | Function
10675
10977
  | RegExp
10978
+ | ((
10979
+ module: Module
10980
+ ) =>
10981
+ | void
10982
+ | OptimizationSplitChunksCacheGroup
10983
+ | OptimizationSplitChunksCacheGroup[])
10676
10984
  | OptimizationSplitChunksCacheGroup;
10677
10985
  };
10678
10986
 
@@ -11499,6 +11807,11 @@ declare interface ParserOptionsByModuleTypeKnown {
11499
11807
  * Parser options for javascript modules.
11500
11808
  */
11501
11809
  "javascript/esm"?: JavascriptParserOptions;
11810
+
11811
+ /**
11812
+ * Parser options for JSON modules.
11813
+ */
11814
+ json?: JsonParserOptions;
11502
11815
  }
11503
11816
 
11504
11817
  /**
@@ -11550,7 +11863,7 @@ declare interface PerformanceOptions {
11550
11863
  /**
11551
11864
  * Filter function to select assets that are checked.
11552
11865
  */
11553
- assetFilter?: Function;
11866
+ assetFilter?: (name: string, source: Source, assetInfo: AssetInfo) => boolean;
11554
11867
 
11555
11868
  /**
11556
11869
  * Sets the format of the hints: warnings, errors or nothing at all.
@@ -11677,12 +11990,12 @@ declare interface ProcessAssetsAdditionalOptions {
11677
11990
  additionalAssets?: any;
11678
11991
  }
11679
11992
  declare class Profiler {
11680
- constructor(inspector?: any);
11681
- session: any;
11682
- inspector: any;
11993
+ constructor(inspector: Inspector);
11994
+ session?: SessionImportInspectorClass_2;
11995
+ inspector: Inspector;
11683
11996
  hasSession(): boolean;
11684
11997
  startProfiling(): Promise<void> | Promise<[any, any, any]>;
11685
- sendCommand(method: string, params?: Record<string, any>): Promise<any>;
11998
+ sendCommand(method: string, params?: object): Promise<any>;
11686
11999
  destroy(): Promise<void>;
11687
12000
  stopProfiling(): Promise<{ profile: any }>;
11688
12001
  }
@@ -13259,12 +13572,19 @@ declare interface ResourceDataWithData {
13259
13572
  data: Record<string, any>;
13260
13573
  }
13261
13574
  declare abstract class RestoreProvidedData {
13262
- exports: any[];
13575
+ exports: RestoreProvidedDataExports[];
13263
13576
  otherProvided?: null | boolean;
13264
13577
  otherCanMangleProvide?: boolean;
13265
13578
  otherTerminalBinding: boolean;
13266
13579
  serialize(__0: ObjectSerializerContext): void;
13267
13580
  }
13581
+ declare interface RestoreProvidedDataExports {
13582
+ name: string;
13583
+ provided?: null | boolean;
13584
+ canMangleProvide?: boolean;
13585
+ terminalBinding: boolean;
13586
+ exportsInfo?: RestoreProvidedData;
13587
+ }
13268
13588
  declare interface RmDirOptions {
13269
13589
  maxRetries?: number;
13270
13590
  recursive?: boolean;
@@ -13573,6 +13893,7 @@ declare interface RuleSetRule {
13573
13893
  | string
13574
13894
  | false
13575
13895
  | 0
13896
+ | RuleSetUseFunction
13576
13897
  | {
13577
13898
  /**
13578
13899
  * Unique loader options identifier.
@@ -13587,32 +13908,8 @@ declare interface RuleSetRule {
13587
13908
  */
13588
13909
  options?: string | { [index: string]: any };
13589
13910
  }
13590
- | ((data: object) =>
13591
- | string
13592
- | {
13593
- /**
13594
- * Unique loader options identifier.
13595
- */
13596
- ident?: string;
13597
- /**
13598
- * Loader name.
13599
- */
13600
- loader?: string;
13601
- /**
13602
- * Loader options.
13603
- */
13604
- options?: string | { [index: string]: any };
13605
- }
13606
- | __TypeWebpackOptions
13607
- | __Type_2[])
13608
13911
  )[]
13609
- | ((data: {
13610
- resource: string;
13611
- realResource: string;
13612
- resourceQuery: string;
13613
- issuer: string;
13614
- compiler: string;
13615
- }) => __Type_2[])
13912
+ | RuleSetUseFunction
13616
13913
  | {
13617
13914
  /**
13618
13915
  * Unique loader options identifier.
@@ -13626,8 +13923,7 @@ declare interface RuleSetRule {
13626
13923
  * Loader options.
13627
13924
  */
13628
13925
  options?: string | { [index: string]: any };
13629
- }
13630
- | __TypeWebpackOptions;
13926
+ };
13631
13927
 
13632
13928
  /**
13633
13929
  * Match on import attributes of the dependency.
@@ -13642,6 +13938,7 @@ type RuleSetUse =
13642
13938
  | string
13643
13939
  | false
13644
13940
  | 0
13941
+ | RuleSetUseFunction
13645
13942
  | {
13646
13943
  /**
13647
13944
  * Unique loader options identifier.
@@ -13656,32 +13953,25 @@ type RuleSetUse =
13656
13953
  */
13657
13954
  options?: string | { [index: string]: any };
13658
13955
  }
13659
- | ((data: object) =>
13660
- | string
13661
- | {
13662
- /**
13663
- * Unique loader options identifier.
13664
- */
13665
- ident?: string;
13666
- /**
13667
- * Loader name.
13668
- */
13669
- loader?: string;
13670
- /**
13671
- * Loader options.
13672
- */
13673
- options?: string | { [index: string]: any };
13674
- }
13675
- | __TypeWebpackOptions
13676
- | __Type_2[])
13677
13956
  )[]
13678
- | ((data: {
13679
- resource: string;
13680
- realResource: string;
13681
- resourceQuery: string;
13682
- issuer: string;
13683
- compiler: string;
13684
- }) => __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
13685
13975
  | {
13686
13976
  /**
13687
13977
  * Unique loader options identifier.
@@ -13696,9 +13986,31 @@ type RuleSetUse =
13696
13986
  */
13697
13987
  options?: string | { [index: string]: any };
13698
13988
  }
13699
- | __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
+ )[];
13700
14011
  type RuleSetUseItem =
13701
14012
  | string
14013
+ | RuleSetUseFunction
13702
14014
  | {
13703
14015
  /**
13704
14016
  * Unique loader options identifier.
@@ -13712,18 +14024,18 @@ type RuleSetUseItem =
13712
14024
  * Loader options.
13713
14025
  */
13714
14026
  options?: string | { [index: string]: any };
13715
- }
13716
- | __TypeWebpackOptions;
14027
+ };
13717
14028
  declare interface RunCallback<T> {
13718
14029
  (err: null | Error, result?: T): any;
13719
14030
  }
13720
14031
  declare class RuntimeChunkPlugin {
13721
- constructor(options: { name?: (entrypoint: { name: string }) => string });
13722
- options: {
13723
- name:
13724
- | ((entrypoint: { name: string }) => string)
13725
- | ((entrypoint: Entrypoint) => string);
13726
- };
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 };
13727
14039
 
13728
14040
  /**
13729
14041
  * Apply the plugin
@@ -15096,11 +15408,21 @@ declare interface StatsOptions {
15096
15408
  */
15097
15409
  env?: boolean;
15098
15410
 
15411
+ /**
15412
+ * Add cause to errors.
15413
+ */
15414
+ errorCause?: boolean | "auto";
15415
+
15099
15416
  /**
15100
15417
  * Add details to errors (like resolving log).
15101
15418
  */
15102
15419
  errorDetails?: boolean | "auto";
15103
15420
 
15421
+ /**
15422
+ * Add nested errors to errors (like in AggregateError).
15423
+ */
15424
+ errorErrors?: boolean | "auto";
15425
+
15104
15426
  /**
15105
15427
  * Add internal stack trace to errors.
15106
15428
  */
@@ -15778,7 +16100,7 @@ declare class WebpackError extends Error {
15778
16100
  /**
15779
16101
  * Creates an instance of WebpackError.
15780
16102
  */
15781
- constructor(message?: string);
16103
+ constructor(message?: string, options?: { cause?: unknown });
15782
16104
  [index: number]: () => string;
15783
16105
  details?: string;
15784
16106
  module?: null | Module;
@@ -15788,22 +16110,59 @@ declare class WebpackError extends Error {
15788
16110
  file?: string;
15789
16111
  serialize(__0: ObjectSerializerContext): void;
15790
16112
  deserialize(__0: ObjectDeserializerContext): void;
15791
-
15792
- /**
15793
- * Create .stack property on a target object
16113
+ cause: any;
16114
+
16115
+ /**
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
+ * ```
15794
16150
  */
15795
16151
  static captureStackTrace(
15796
16152
  targetObject: object,
15797
16153
  constructorOpt?: Function
15798
16154
  ): void;
16155
+ static prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
15799
16156
 
15800
16157
  /**
15801
- * 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.
15802
16165
  */
15803
- static prepareStackTrace?: (
15804
- err: Error,
15805
- stackTraces: NodeJS.CallSite[]
15806
- ) => any;
15807
16166
  static stackTraceLimit: number;
15808
16167
  }
15809
16168
  declare abstract class WebpackLogger {
@@ -15925,10 +16284,7 @@ declare interface WebpackOptionsNormalized {
15925
16284
  /**
15926
16285
  * Ignore specific warnings.
15927
16286
  */
15928
- ignoreWarnings?: ((
15929
- warning: WebpackError,
15930
- compilation: Compilation
15931
- ) => boolean)[];
16287
+ ignoreWarnings?: ((warning: Error, compilation: Compilation) => boolean)[];
15932
16288
 
15933
16289
  /**
15934
16290
  * Options for infrastructure level logging.
@@ -15963,7 +16319,7 @@ declare interface WebpackOptionsNormalized {
15963
16319
  /**
15964
16320
  * Enables/Disables integrated optimizations.
15965
16321
  */
15966
- optimization: Optimization;
16322
+ optimization: OptimizationNormalized;
15967
16323
 
15968
16324
  /**
15969
16325
  * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
@@ -16154,62 +16510,6 @@ declare interface WriteStreamOptions {
16154
16510
  signal?: null | AbortSignal;
16155
16511
  fs?: null | CreateWriteStreamFSImplementation;
16156
16512
  }
16157
- type __TypeWebpackOptions = (data: object) =>
16158
- | string
16159
- | {
16160
- /**
16161
- * Unique loader options identifier.
16162
- */
16163
- ident?: string;
16164
- /**
16165
- * Loader name.
16166
- */
16167
- loader?: string;
16168
- /**
16169
- * Loader options.
16170
- */
16171
- options?: string | { [index: string]: any };
16172
- }
16173
- | __TypeWebpackOptions
16174
- | __Type_2[];
16175
- type __Type_2 =
16176
- | undefined
16177
- | null
16178
- | string
16179
- | false
16180
- | 0
16181
- | {
16182
- /**
16183
- * Unique loader options identifier.
16184
- */
16185
- ident?: string;
16186
- /**
16187
- * Loader name.
16188
- */
16189
- loader?: string;
16190
- /**
16191
- * Loader options.
16192
- */
16193
- options?: string | { [index: string]: any };
16194
- }
16195
- | ((data: object) =>
16196
- | string
16197
- | {
16198
- /**
16199
- * Unique loader options identifier.
16200
- */
16201
- ident?: string;
16202
- /**
16203
- * Loader name.
16204
- */
16205
- loader?: string;
16206
- /**
16207
- * Loader options.
16208
- */
16209
- options?: string | { [index: string]: any };
16210
- }
16211
- | __TypeWebpackOptions
16212
- | __Type_2[]);
16213
16513
  declare function exports(
16214
16514
  options: Configuration,
16215
16515
  callback?: CallbackWebpack<Stats>
@@ -16238,42 +16538,39 @@ declare namespace exports {
16238
16538
  export namespace cli {
16239
16539
  export let getArguments: (
16240
16540
  schema?:
16241
- | (JSONSchema4 &
16242
- Extend & {
16243
- absolutePath: boolean;
16244
- instanceof: string;
16245
- cli: {
16246
- helper?: boolean;
16247
- exclude?: boolean;
16248
- description?: string;
16249
- negatedDescription?: string;
16250
- resetDescription?: string;
16251
- };
16252
- })
16253
- | (JSONSchema6 &
16254
- Extend & {
16255
- absolutePath: boolean;
16256
- instanceof: string;
16257
- cli: {
16258
- helper?: boolean;
16259
- exclude?: boolean;
16260
- description?: string;
16261
- negatedDescription?: string;
16262
- resetDescription?: string;
16263
- };
16264
- })
16265
- | (JSONSchema7 &
16266
- Extend & {
16267
- absolutePath: boolean;
16268
- instanceof: string;
16269
- cli: {
16270
- helper?: boolean;
16271
- exclude?: boolean;
16272
- description?: string;
16273
- negatedDescription?: string;
16274
- resetDescription?: string;
16275
- };
16276
- })
16541
+ | (JSONSchema4 & {
16542
+ absolutePath: boolean;
16543
+ instanceof: string;
16544
+ cli: {
16545
+ helper?: boolean;
16546
+ exclude?: boolean;
16547
+ description?: string;
16548
+ negatedDescription?: string;
16549
+ resetDescription?: string;
16550
+ };
16551
+ })
16552
+ | (JSONSchema6 & {
16553
+ absolutePath: boolean;
16554
+ instanceof: string;
16555
+ cli: {
16556
+ helper?: boolean;
16557
+ exclude?: boolean;
16558
+ description?: string;
16559
+ negatedDescription?: string;
16560
+ resetDescription?: string;
16561
+ };
16562
+ })
16563
+ | (JSONSchema7 & {
16564
+ absolutePath: boolean;
16565
+ instanceof: string;
16566
+ cli: {
16567
+ helper?: boolean;
16568
+ exclude?: boolean;
16569
+ description?: string;
16570
+ negatedDescription?: string;
16571
+ resetDescription?: string;
16572
+ };
16573
+ })
16277
16574
  ) => Flags;
16278
16575
  export let processArguments: (
16279
16576
  args: Flags,
@@ -16306,7 +16603,10 @@ declare namespace exports {
16306
16603
  export let REGEXP_NAMESPACE: RegExp;
16307
16604
  export let createFilename: (
16308
16605
  module: string | Module,
16309
- options: { namespace?: string; moduleFilenameTemplate?: any },
16606
+ options: {
16607
+ namespace?: string;
16608
+ moduleFilenameTemplate?: string | ((context?: any) => string);
16609
+ },
16310
16610
  __2: {
16311
16611
  requestShortener: RequestShortener;
16312
16612
  chunkGraph: ChunkGraph;
@@ -16577,7 +16877,7 @@ declare namespace exports {
16577
16877
  export { ProfilingPlugin };
16578
16878
  }
16579
16879
  export namespace util {
16580
- export const createHash: (algorithm: Algorithm) => Hash;
16880
+ export const createHash: (algorithm: HashFunction) => Hash;
16581
16881
  export namespace comparators {
16582
16882
  export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
16583
16883
  export let compareModulesByIdentifier: (
@@ -16744,6 +17044,81 @@ declare namespace exports {
16744
17044
  export { SyncModuleIdsPlugin };
16745
17045
  }
16746
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
+ )[];
16747
17122
  export type WebpackPluginFunction = (
16748
17123
  this: Compiler,
16749
17124
  compiler: Compiler
@@ -16810,15 +17185,19 @@ declare namespace exports {
16810
17185
  Entry,
16811
17186
  EntryNormalized,
16812
17187
  EntryObject,
17188
+ ExternalItem,
17189
+ ExternalItemFunction,
16813
17190
  ExternalItemFunctionData,
16814
17191
  ExternalItemObjectKnown,
16815
17192
  ExternalItemObjectUnknown,
16816
17193
  ExternalItemValue,
16817
17194
  Externals,
16818
17195
  FileCacheOptions,
17196
+ GeneratorOptionsByModuleTypeKnown,
16819
17197
  LibraryOptions,
16820
17198
  MemoryCacheOptions,
16821
17199
  ModuleOptions,
17200
+ ParserOptionsByModuleTypeKnown,
16822
17201
  ResolveOptions,
16823
17202
  RuleSetCondition,
16824
17203
  RuleSetConditionAbsolute,
@@ -16835,6 +17214,7 @@ declare namespace exports {
16835
17214
  EntryOptions,
16836
17215
  PathData,
16837
17216
  AssetEmittedInfo,
17217
+ Entrypoint,
16838
17218
  MultiCompilerOptions,
16839
17219
  MultiStats,
16840
17220
  ResolveData,