webpack 5.108.4 → 5.109.1

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 (200) hide show
  1. package/bin/webpack.js +12 -0
  2. package/lib/APIPlugin.js +48 -29
  3. package/lib/CacheFacade.js +8 -0
  4. package/lib/ChunkGraph.js +17 -15
  5. package/lib/ChunkGroup.js +1 -0
  6. package/lib/CompatibilityPlugin.js +62 -29
  7. package/lib/Compilation.js +58 -6
  8. package/lib/ConstPlugin.js +11 -11
  9. package/lib/ContextModule.js +239 -6
  10. package/lib/ContextModuleFactory.js +139 -14
  11. package/lib/DefinePlugin.js +433 -112
  12. package/lib/Entrypoint.js +1 -1
  13. package/lib/ExportsInfo.js +22 -5
  14. package/lib/ExportsInfoApiPlugin.js +2 -2
  15. package/lib/ExternalModule.js +107 -5
  16. package/lib/ExternalModuleFactoryPlugin.js +20 -1
  17. package/lib/FileSystemInfo.js +256 -100
  18. package/lib/FlagDependencyUsagePlugin.js +33 -12
  19. package/lib/HotModuleReplacementPlugin.js +18 -15
  20. package/lib/InitFragment.js +20 -32
  21. package/lib/Module.js +3 -0
  22. package/lib/ModuleFilenameHelpers.js +2 -2
  23. package/lib/ModuleTypeConstants.js +8 -1
  24. package/lib/MultiCompiler.js +13 -2
  25. package/lib/MultiWatching.js +1 -0
  26. package/lib/NodeStuffPlugin.js +51 -33
  27. package/lib/NormalModule.js +175 -401
  28. package/lib/NormalModuleFactory.js +76 -2
  29. package/lib/ProgressPlugin.js +211 -119
  30. package/lib/ProvidePlugin.js +2 -2
  31. package/lib/RuntimeGlobals.js +47 -0
  32. package/lib/RuntimePlugin.js +67 -107
  33. package/lib/RuntimeTemplate.js +304 -16
  34. package/lib/Template.js +23 -3
  35. package/lib/UseStrictPlugin.js +1 -1
  36. package/lib/WebpackIsIncludedPlugin.js +1 -1
  37. package/lib/WebpackOptionsApply.js +24 -19
  38. package/lib/asset/AssetGenerator.js +110 -28
  39. package/lib/asset/AssetModulesPlugin.js +92 -2
  40. package/lib/asset/WebManifestGenerator.js +164 -0
  41. package/lib/asset/WebManifestParser.js +130 -0
  42. package/lib/async-modules/AwaitDependenciesInitFragment.js +14 -4
  43. package/lib/async-modules/isGeneratorLowered.js +26 -0
  44. package/lib/cache/PackFileCacheStrategy.js +9 -3
  45. package/lib/config/browserslistTargetHandler.js +40 -0
  46. package/lib/config/defaults.js +219 -29
  47. package/lib/config/normalization.js +26 -0
  48. package/lib/config/target.js +9 -1
  49. package/lib/container/HoistContainerReferencesPlugin.js +47 -55
  50. package/lib/css/CssGenerator.js +40 -31
  51. package/lib/css/CssLoadingRuntimeModule.js +5 -1
  52. package/lib/css/CssModulesPlugin.js +13 -0
  53. package/lib/css/CssParser.js +729 -313
  54. package/lib/css/syntax.js +1371 -861
  55. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +6 -6
  56. package/lib/dependencies/AMDPlugin.js +2 -2
  57. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +13 -13
  58. package/lib/dependencies/CommonJsDependencyHelpers.js +39 -0
  59. package/lib/dependencies/CommonJsExportRequireDependency.js +19 -0
  60. package/lib/dependencies/CommonJsExportsDependency.js +47 -2
  61. package/lib/dependencies/CommonJsExportsParserPlugin.js +10 -10
  62. package/lib/dependencies/CommonJsImportsParserPlugin.js +18 -18
  63. package/lib/dependencies/CommonJsPlugin.js +2 -2
  64. package/lib/dependencies/CommonJsRequireDependency.js +26 -1
  65. package/lib/dependencies/CommonJsSelfReferenceDependency.js +32 -1
  66. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  67. package/lib/dependencies/CreateRequireParserPlugin.js +6 -6
  68. package/lib/dependencies/CssIcssExportDependency.js +162 -71
  69. package/lib/dependencies/CssUrlDependency.js +35 -4
  70. package/lib/dependencies/ExternalModuleInitFragmentDependency.js +2 -2
  71. package/lib/dependencies/HarmonyCompatibilityDependency.js +32 -14
  72. package/lib/dependencies/HarmonyDetectionParserPlugin.js +43 -13
  73. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +2 -1
  74. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +7 -19
  75. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +17 -9
  76. package/lib/dependencies/HarmonyImportDependency.js +13 -2
  77. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +11 -11
  78. package/lib/dependencies/HarmonyImportSpecifierDependency.js +10 -7
  79. package/lib/dependencies/HarmonyModulesPlugin.js +6 -0
  80. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
  81. package/lib/dependencies/HtmlEntryDependency.js +797 -172
  82. package/lib/dependencies/HtmlSourceDependency.js +26 -0
  83. package/lib/dependencies/ImportDependency.js +43 -1
  84. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +31 -18
  85. package/lib/dependencies/ImportMetaContextPlugin.js +38 -7
  86. package/lib/dependencies/ImportMetaGlobDependency.js +81 -0
  87. package/lib/dependencies/ImportMetaGlobDependencyParserPlugin.js +78 -0
  88. package/lib/dependencies/ImportMetaGlobHelpers.js +660 -0
  89. package/lib/dependencies/ImportMetaPlugin.js +532 -180
  90. package/lib/dependencies/ImportMetaResolveDependency.js +90 -0
  91. package/lib/dependencies/ImportParserPlugin.js +80 -17
  92. package/lib/dependencies/ImportPhase.js +10 -8
  93. package/lib/dependencies/LoaderPlugin.js +5 -1
  94. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  95. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +3 -6
  96. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +4 -11
  97. package/lib/dependencies/SystemPlugin.js +2 -4
  98. package/lib/dependencies/TopLevelAwaitDependency.js +93 -0
  99. package/lib/dependencies/URLDependency.js +141 -21
  100. package/lib/dependencies/{WorkerPlugin.js → WorkerAndWorkletPlugin.js} +324 -112
  101. package/lib/dependencies/WorkerDependency.js +86 -18
  102. package/lib/dependencies/WorkletDependency.js +278 -0
  103. package/lib/dll/DelegatedModuleFactoryPlugin.js +19 -0
  104. package/lib/errors/EnvironmentNotSupportAsyncWarning.js +1 -1
  105. package/lib/errors/LoaderLoadingError.js +20 -0
  106. package/lib/errors/ModuleParseError.js +39 -22
  107. package/lib/errors/NodeStuffInWebError.js +1 -1
  108. package/lib/esm/ModuleChunkFormatPlugin.js +47 -14
  109. package/lib/esm/ModuleChunkLoadingPlugin.js +8 -1
  110. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +29 -1
  111. package/lib/hmr/lazyCompilationBackend.js +51 -12
  112. package/lib/html/HtmlGenerator.js +907 -15
  113. package/lib/html/HtmlModule.js +2 -2
  114. package/lib/html/HtmlModulesPlugin.js +610 -166
  115. package/lib/html/HtmlParser.js +603 -247
  116. package/lib/html/favicon.svg +1 -0
  117. package/lib/html/syntax.js +3451 -2762
  118. package/lib/ids/IdHelpers.js +25 -11
  119. package/lib/index.js +6 -0
  120. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -5
  121. package/lib/javascript/BasicEvaluatedExpression.js +366 -48
  122. package/lib/javascript/JavascriptGenerator.js +197 -49
  123. package/lib/javascript/JavascriptModulesPlugin.js +178 -24
  124. package/lib/javascript/JavascriptParser.js +704 -355
  125. package/lib/javascript/JavascriptParserHelpers.js +3 -6
  126. package/lib/javascript/syntax.js +5037 -0
  127. package/lib/library/ModuleLibraryPlugin.js +38 -1
  128. package/lib/loaders/LoaderRunner.js +714 -0
  129. package/lib/loaders/loadLoader.js +100 -0
  130. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +29 -2
  131. package/lib/node/ReadFileCompileWasmPlugin.js +24 -2
  132. package/lib/optimize/AggressiveMergingPlugin.js +19 -15
  133. package/lib/optimize/ConcatenatedModule.js +139 -31
  134. package/lib/optimize/FlagIncludedChunksPlugin.js +13 -3
  135. package/lib/optimize/InnerGraphPlugin.js +50 -30
  136. package/lib/optimize/ModuleConcatenationPlugin.js +139 -24
  137. package/lib/optimize/SideEffectsFlagPlugin.js +86 -43
  138. package/lib/optimize/SplitChunksPlugin.js +146 -44
  139. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +15 -0
  140. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +24 -13
  141. package/lib/prefetch/ResourceHintPlugin.js +687 -0
  142. package/lib/prefetch/ResourceHintRuntimeModule.js +149 -0
  143. package/lib/prefetch/StartupAssetHintRuntimeModule.js +210 -0
  144. package/lib/prefetch/parseResourceHintOptions.js +103 -0
  145. package/lib/rules/RuleSetCompiler.js +114 -0
  146. package/lib/runtime/AsyncModuleGeneratorRuntimeModule.js +56 -0
  147. package/lib/runtime/AsyncModuleRuntimeModule.js +24 -8
  148. package/lib/runtime/AutoPublicPathRuntimeModule.js +7 -1
  149. package/lib/runtime/CommonJsWrapRuntimeModule.js +37 -0
  150. package/lib/runtime/GetWorkletBootstrapRuntimeModule.js +59 -0
  151. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +204 -8
  152. package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +4 -1
  153. package/lib/schemes/HttpUriPlugin.js +40 -1
  154. package/lib/schemes/VirtualUrlPlugin.js +1 -2
  155. package/lib/serialization/BinaryMiddleware.js +270 -938
  156. package/lib/serialization/FileMiddleware.js +29 -3
  157. package/lib/stats/DefaultStatsFactoryPlugin.js +229 -194
  158. package/lib/stats/DefaultStatsPresetPlugin.js +2 -0
  159. package/lib/stats/DefaultStatsPrinterPlugin.js +36 -168
  160. package/lib/stats/StatsFactory.js +46 -17
  161. package/lib/url/URLParserPlugin.js +66 -13
  162. package/lib/util/AsyncQueue.js +122 -72
  163. package/lib/util/SetHelpers.js +1 -1
  164. package/lib/util/StackedMap.js +122 -48
  165. package/lib/util/binarySearchBounds.js +2 -2
  166. package/lib/util/concatenate.js +40 -14
  167. package/lib/util/createHooksRegistry.js +13 -5
  168. package/lib/util/dataURL.js +2 -2
  169. package/lib/util/deterministicGrouping.js +7 -5
  170. package/lib/util/formatSize.js +6 -2
  171. package/lib/util/globUtils.js +710 -0
  172. package/lib/util/identifier.js +23 -6
  173. package/lib/util/implicitTypeLoaderFallback.js +62 -0
  174. package/lib/util/internalSerializables.js +88 -71
  175. package/lib/util/magicComment.js +121 -25
  176. package/lib/util/numberHash.js +2 -2
  177. package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +24 -18
  178. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +33 -22
  179. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +79 -16
  180. package/lib/web/FetchCompileAsyncWasmPlugin.js +19 -0
  181. package/lib/web/FetchCompileWasmPlugin.js +14 -0
  182. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -0
  183. package/lib/webpack.js +65 -0
  184. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -0
  185. package/module.d.ts +21 -0
  186. package/package.json +12 -11
  187. package/schemas/WebpackOptions.check.js +1 -1
  188. package/schemas/WebpackOptions.json +759 -36
  189. package/schemas/plugins/HtmlParserOptions.check.js +1 -1
  190. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  191. package/schemas/plugins/ProgressPlugin.json +17 -1
  192. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  193. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  194. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  195. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  196. package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
  197. package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +1 -1
  198. package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
  199. package/schemas/plugins/css/CssParserOptions.check.js +1 -1
  200. package/types.d.ts +1212 -99
package/types.d.ts CHANGED
@@ -851,31 +851,14 @@ declare interface BasenameCacheEntry {
851
851
  */
852
852
  cache: Map<string, Map<undefined | string, undefined | string>>;
853
853
  }
854
+
855
+ /**
856
+ * An instance is allocated for a large share of walked expressions, so the
857
+ * boolean facts live in one packed flags slot and the scalar/identifier
858
+ * fields in five slots shared by type, with accessors keeping every public
859
+ * field readable. This shrinks instances from 224 to 144 bytes on V8.
860
+ */
854
861
  declare abstract class BasicEvaluatedExpression {
855
- type: number;
856
- range?: [number, number];
857
- falsy: boolean;
858
- truthy: boolean;
859
- nullish?: boolean;
860
- sideEffects: boolean;
861
- bool?: boolean;
862
- number?: number;
863
- bigint?: bigint;
864
- regExp?: RegExp;
865
- string?: string;
866
- quasis?: BasicEvaluatedExpression[];
867
- parts?: BasicEvaluatedExpression[];
868
- array?: any[];
869
- items?: BasicEvaluatedExpression[];
870
- options?: BasicEvaluatedExpression[];
871
- prefix?: null | BasicEvaluatedExpression;
872
- postfix?: null | BasicEvaluatedExpression;
873
- wrappedInnerExpressions?: BasicEvaluatedExpression[];
874
- identifier?: string | VariableInfo;
875
- rootInfo?: string | VariableInfo;
876
- getMembers?: () => string[];
877
- getMembersOptionals?: () => boolean[];
878
- getMemberRanges?: () => [number, number][];
879
862
  expression?:
880
863
  | Program
881
864
  | ImportDeclaration
@@ -951,6 +934,38 @@ declare abstract class BasicEvaluatedExpression {
951
934
  | AssignmentPattern
952
935
  | SwitchCase
953
936
  | TemplateElement;
937
+ quasis?: BasicEvaluatedExpression[];
938
+ parts?: BasicEvaluatedExpression[];
939
+ items?: BasicEvaluatedExpression[];
940
+ options?: BasicEvaluatedExpression[];
941
+ prefix?: null | BasicEvaluatedExpression;
942
+ postfix?: null | BasicEvaluatedExpression;
943
+ wrappedInnerExpressions?: BasicEvaluatedExpression[];
944
+
945
+ /**
946
+ * Served lazily from the attached expression when not set explicitly:
947
+ * `evaluateExpression`'s plain results share the expression's range, and
948
+ * most evaluations never read it, so the node's range array is only
949
+ * materialized on demand.
950
+ */
951
+ range?: [number, number];
952
+ type: number;
953
+ truthy: boolean;
954
+ falsy: boolean;
955
+ nullish?: boolean;
956
+ sideEffects: boolean;
957
+ bool?: boolean;
958
+ number?: number;
959
+ bigint?: bigint;
960
+ regExp?: RegExp;
961
+ string?: string;
962
+ templateStringKind?: "cooked" | "raw";
963
+ array?: any[];
964
+ identifier?: string | VariableInfo;
965
+ rootInfo?: string | VariableInfo;
966
+ getMembers?: () => string[];
967
+ getMembersOptionals?: () => boolean[];
968
+ getMemberRanges?: () => [number, number][];
954
969
  isUnknown(): boolean;
955
970
  isNull(): boolean;
956
971
  isUndefined(): boolean;
@@ -1081,7 +1096,6 @@ declare abstract class BasicEvaluatedExpression {
1081
1096
  parts: BasicEvaluatedExpression[],
1082
1097
  kind: "cooked" | "raw"
1083
1098
  ): BasicEvaluatedExpression;
1084
- templateStringKind?: "cooked" | "raw";
1085
1099
  setTruthy(): BasicEvaluatedExpression;
1086
1100
  setFalsy(): BasicEvaluatedExpression;
1087
1101
 
@@ -1325,6 +1339,11 @@ declare class CacheClass {
1325
1339
  static STAGE_NETWORK: number;
1326
1340
  }
1327
1341
  declare abstract class CacheFacade {
1342
+ /**
1343
+ * Returns whether a cache backend is active.
1344
+ */
1345
+ isEnabled(): boolean;
1346
+
1328
1347
  /**
1329
1348
  * Returns child cache.
1330
1349
  */
@@ -2787,6 +2806,16 @@ declare interface ChunkRenderContextJavascriptModulesPlugin {
2787
2806
  * rendering in strict context
2788
2807
  */
2789
2808
  strictMode?: boolean;
2809
+
2810
+ /**
2811
+ * entry module inlined at the chunk top level instead of the registry
2812
+ */
2813
+ inlinedEntryModule?: Module;
2814
+
2815
+ /**
2816
+ * rendered body of the inlined entry module
2817
+ */
2818
+ inlinedEntrySource?: Source;
2790
2819
  }
2791
2820
  declare interface ChunkRuntime {
2792
2821
  [index: number]: string;
@@ -3161,7 +3190,7 @@ declare interface ColorsOptions {
3161
3190
  type CommentJavascriptParser = CommentImport & {
3162
3191
  start: number;
3163
3192
  end: number;
3164
- loc: SourceLocation;
3193
+ loc?: null | SourceLocation;
3165
3194
  };
3166
3195
  declare interface CommonJsImportSettings {
3167
3196
  name?: string;
@@ -4320,6 +4349,16 @@ declare class ConcatSource extends Source {
4320
4349
  ): GeneratedSourceInfo;
4321
4350
  }
4322
4351
  type ConcatSourceChild = string | Source | SourceLike;
4352
+
4353
+ /**
4354
+ * Advanced options for module concatenation.
4355
+ */
4356
+ declare interface ConcatenateModulesOptions {
4357
+ /**
4358
+ * Also concatenate CommonJS modules with statically analyzable exports. Defaults to 'true'.
4359
+ */
4360
+ commonjs?: boolean;
4361
+ }
4323
4362
  type ConcatenatedModuleBuildInfo = KnownBuildInfo &
4324
4363
  Record<string, any> &
4325
4364
  KnownConcatenatedModuleBuildInfo;
@@ -4327,6 +4366,11 @@ declare interface ConcatenatedModuleInfo {
4327
4366
  type: "concatenated";
4328
4367
  module: Module;
4329
4368
  index: number;
4369
+
4370
+ /**
4371
+ * a "weird" CommonJS module executed via the CJS wrapper runtime helper with real module/exports objects
4372
+ */
4373
+ cjsWrapped?: boolean;
4330
4374
  ast?: Program;
4331
4375
  internalSource?: Source;
4332
4376
  source?: ReplaceSource;
@@ -4398,6 +4442,11 @@ declare interface ConcatenationBailoutReasonContext {
4398
4442
  * the chunk graph
4399
4443
  */
4400
4444
  chunkGraph: ChunkGraph;
4445
+
4446
+ /**
4447
+ * whether eligible CommonJS modules may be concatenated
4448
+ */
4449
+ concatenateCommonJsModules?: boolean;
4401
4450
  }
4402
4451
 
4403
4452
  /**
@@ -4556,7 +4605,11 @@ declare interface Configuration {
4556
4605
  data: ExternalItemFunctionData,
4557
4606
  callback: (
4558
4607
  err?: null | Error,
4559
- result?: string | boolean | string[] | { [index: string]: any }
4608
+ result?:
4609
+ | string
4610
+ | boolean
4611
+ | string[]
4612
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown)
4560
4613
  ) => void
4561
4614
  ) => void)
4562
4615
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
@@ -4589,6 +4642,7 @@ declare interface Configuration {
4589
4642
  | "umd2"
4590
4643
  | "jsonp"
4591
4644
  | "system"
4645
+ | "amd-async"
4592
4646
  | "promise"
4593
4647
  | "module-import"
4594
4648
  | "script"
@@ -5070,6 +5124,31 @@ declare interface ContextOptions {
5070
5124
  layer?: null | string;
5071
5125
  attributes?: ImportAttributes;
5072
5126
  phase?: 0 | 1 | 2;
5127
+
5128
+ /**
5129
+ * glob patterns for import.meta.glob
5130
+ */
5131
+ patterns?: string[];
5132
+
5133
+ /**
5134
+ * importer context for import.meta.glob
5135
+ */
5136
+ requestContext?: string;
5137
+
5138
+ /**
5139
+ * import selection for import.meta.glob
5140
+ */
5141
+ importName?: string;
5142
+
5143
+ /**
5144
+ * exhaustive mode for import.meta.glob
5145
+ */
5146
+ exhaustive?: boolean;
5147
+
5148
+ /**
5149
+ * case-sensitive matching for import.meta.glob
5150
+ */
5151
+ caseSensitive?: boolean;
5073
5152
  }
5074
5153
  declare class ContextReplacementPlugin {
5075
5154
  /**
@@ -5253,6 +5332,16 @@ declare interface CssAutoOrModuleParserOptions {
5253
5332
  */
5254
5333
  customIdents?: boolean;
5255
5334
 
5335
+ /**
5336
+ * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution).
5337
+ */
5338
+ customMedia?: boolean;
5339
+
5340
+ /**
5341
+ * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`).
5342
+ */
5343
+ customSelectors?: boolean;
5344
+
5256
5345
  /**
5257
5346
  * Enable/disable renaming of dashed identifiers, e. g. custom properties.
5258
5347
  */
@@ -5263,6 +5352,11 @@ declare interface CssAutoOrModuleParserOptions {
5263
5352
  */
5264
5353
  exportType?: "link" | "text" | "css-style-sheet" | "style";
5265
5354
 
5355
+ /**
5356
+ * Auto-emit `<link rel="preload" as="font">` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch.
5357
+ */
5358
+ fontPreload?: boolean;
5359
+
5266
5360
  /**
5267
5361
  * Enable/disable renaming of `@function` names.
5268
5362
  */
@@ -5292,6 +5386,11 @@ declare interface CssAutoOrModuleParserOptions {
5292
5386
  * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
5293
5387
  */
5294
5388
  url?: boolean;
5389
+
5390
+ /**
5391
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
5392
+ */
5393
+ urlHints?: UrlHintRule[];
5295
5394
  }
5296
5395
  declare interface CssData {
5297
5396
  /**
@@ -5497,6 +5596,16 @@ declare interface CssModuleParserOptions {
5497
5596
  */
5498
5597
  customIdents?: boolean;
5499
5598
 
5599
+ /**
5600
+ * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution).
5601
+ */
5602
+ customMedia?: boolean;
5603
+
5604
+ /**
5605
+ * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`).
5606
+ */
5607
+ customSelectors?: boolean;
5608
+
5500
5609
  /**
5501
5610
  * Enable/disable renaming of dashed identifiers, e. g. custom properties.
5502
5611
  */
@@ -5507,6 +5616,11 @@ declare interface CssModuleParserOptions {
5507
5616
  */
5508
5617
  exportType?: "link" | "text" | "css-style-sheet" | "style";
5509
5618
 
5619
+ /**
5620
+ * Auto-emit `<link rel="preload" as="font">` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch.
5621
+ */
5622
+ fontPreload?: boolean;
5623
+
5510
5624
  /**
5511
5625
  * Enable/disable renaming of `@function` names.
5512
5626
  */
@@ -5531,6 +5645,11 @@ declare interface CssModuleParserOptions {
5531
5645
  * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
5532
5646
  */
5533
5647
  url?: boolean;
5648
+
5649
+ /**
5650
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
5651
+ */
5652
+ urlHints?: UrlHintRule[];
5534
5653
  }
5535
5654
  declare class CssModulesPlugin {
5536
5655
  constructor();
@@ -5610,6 +5729,14 @@ declare abstract class CssParser extends ParserClass {
5610
5729
  * Enable/disable renaming of custom identifiers.
5611
5730
  */
5612
5731
  customIdents: boolean;
5732
+ /**
5733
+ * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution).
5734
+ */
5735
+ customMedia: boolean;
5736
+ /**
5737
+ * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`).
5738
+ */
5739
+ customSelectors: boolean;
5613
5740
  /**
5614
5741
  * Enable/disable renaming of dashed identifiers, e. g. custom properties.
5615
5742
  */
@@ -5618,6 +5745,10 @@ declare abstract class CssParser extends ParserClass {
5618
5745
  * Configure how CSS content is exported as default.
5619
5746
  */
5620
5747
  exportType?: "link" | "text" | "css-style-sheet" | "style";
5748
+ /**
5749
+ * Auto-emit `<link rel="preload" as="font">` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch.
5750
+ */
5751
+ fontPreload?: boolean;
5621
5752
  /**
5622
5753
  * Enable/disable renaming of `@function` names.
5623
5754
  */
@@ -5642,6 +5773,10 @@ declare abstract class CssParser extends ParserClass {
5642
5773
  * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
5643
5774
  */
5644
5775
  url: boolean;
5776
+ /**
5777
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
5778
+ */
5779
+ urlHints?: UrlHintRule[];
5645
5780
  /**
5646
5781
  * default mode
5647
5782
  */
@@ -5659,11 +5794,26 @@ declare interface CssParserOptions {
5659
5794
  */
5660
5795
  as?: "stylesheet" | "block-contents";
5661
5796
 
5797
+ /**
5798
+ * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution).
5799
+ */
5800
+ customMedia?: boolean;
5801
+
5802
+ /**
5803
+ * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`).
5804
+ */
5805
+ customSelectors?: boolean;
5806
+
5662
5807
  /**
5663
5808
  * Configure how CSS content is exported as default.
5664
5809
  */
5665
5810
  exportType?: "link" | "text" | "css-style-sheet" | "style";
5666
5811
 
5812
+ /**
5813
+ * Auto-emit `<link rel="preload" as="font">` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch.
5814
+ */
5815
+ fontPreload?: boolean;
5816
+
5667
5817
  /**
5668
5818
  * Enable/disable `@import` at-rules handling.
5669
5819
  */
@@ -5678,8 +5828,33 @@ declare interface CssParserOptions {
5678
5828
  * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
5679
5829
  */
5680
5830
  url?: boolean;
5831
+
5832
+ /**
5833
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
5834
+ */
5835
+ urlHints?: UrlHintRule[];
5681
5836
  }
5682
5837
  type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
5838
+ declare interface DefaultHandlerOptions {
5839
+ progressBar?:
5840
+ | false
5841
+ | Required<{
5842
+ /**
5843
+ * Color used for the filled portion of the bar.
5844
+ */
5845
+ color?: string;
5846
+ /**
5847
+ * Name shown before the progress bar.
5848
+ */
5849
+ name?: string;
5850
+ /**
5851
+ * Width of the progress bar in characters. Default: 25.
5852
+ */
5853
+ width?: number;
5854
+ }>;
5855
+ estimatedTime?: boolean;
5856
+ phaseTimings?: boolean;
5857
+ }
5683
5858
  type DefineConfigInput =
5684
5859
  | Configuration
5685
5860
  | MultiConfiguration
@@ -5727,6 +5902,21 @@ declare class DefinePlugin {
5727
5902
  options?: true | string[] | RuntimeValueOptions
5728
5903
  ): RuntimeValue;
5729
5904
  static getCompilationHooks: (compilation: Compilation) => DefinePluginHooks;
5905
+ static VALUE_DEP_MAIN: "webpack/DefinePlugin_hash";
5906
+ static VALUE_DEP_PREFIX: "webpack/DefinePlugin ";
5907
+ static getMergedDefinitionNode: (
5908
+ compilation: Compilation,
5909
+ key: string
5910
+ ) => MergedDefinitionNode;
5911
+ static getRuntimeRequirements: (code: string) => undefined | string[];
5912
+ static stringifyMergedDefinition: (
5913
+ compilation: Compilation,
5914
+ parser: JavascriptParser,
5915
+ node: MergedDefinitionNode,
5916
+ key: string,
5917
+ objKeys?: null | Set<string>
5918
+ ) => string;
5919
+ static toPropertyKey: (key: string) => string;
5730
5920
  }
5731
5921
  declare interface DefinePluginHooks {
5732
5922
  definitions: SyncWaterfallHook<
@@ -6108,7 +6298,6 @@ declare abstract class DependencyTemplates {
6108
6298
  declare interface DestructuringAssignmentProperty {
6109
6299
  id: string;
6110
6300
  range: [number, number];
6111
- loc: SourceLocation;
6112
6301
  pattern?: Set<DestructuringAssignmentProperty>;
6113
6302
  shorthand: string | boolean;
6114
6303
  }
@@ -6579,7 +6768,7 @@ declare class ElectronTargetPlugin {
6579
6768
  * Creates an instance of ElectronTargetPlugin.
6580
6769
  */
6581
6770
  constructor(
6582
- context?: "main" | "preload" | "renderer",
6771
+ context?: "preload" | "main" | "renderer",
6583
6772
  type?:
6584
6773
  | "import"
6585
6774
  | "var"
@@ -6599,6 +6788,7 @@ declare class ElectronTargetPlugin {
6599
6788
  | "umd2"
6600
6789
  | "jsonp"
6601
6790
  | "system"
6791
+ | "amd-async"
6602
6792
  | "promise"
6603
6793
  | "module-import"
6604
6794
  | "script"
@@ -6952,7 +7142,7 @@ declare interface EntryOptionPluginHooks {
6952
7142
  undefined | string
6953
7143
  >;
6954
7144
  }
6955
- type EntryOptions = { name?: string } & Omit<
7145
+ type EntryOptions = { name?: string; worklet?: boolean } & Omit<
6956
7146
  EntryDescriptionNormalized,
6957
7147
  "import"
6958
7148
  >;
@@ -6978,11 +7168,6 @@ declare class EntryPlugin {
6978
7168
  options: string | EntryOptions
6979
7169
  ): EntryDependency;
6980
7170
  }
6981
- declare interface EntryScriptInfo {
6982
- request: string;
6983
- entryName: string;
6984
- type: "script" | "stylesheet" | "script-module" | "modulepreload";
6985
- }
6986
7171
  type EntryStatic = string | EntryObject | string[];
6987
7172
 
6988
7173
  /**
@@ -7082,6 +7267,11 @@ declare interface Environment {
7082
7267
  */
7083
7268
  forOf?: boolean;
7084
7269
 
7270
+ /**
7271
+ * The environment supports generator functions and yield ('function* () { yield ... }').
7272
+ */
7273
+ generator?: boolean;
7274
+
7085
7275
  /**
7086
7276
  * The environment supports 'globalThis'.
7087
7277
  */
@@ -7117,6 +7307,11 @@ declare interface Environment {
7117
7307
  */
7118
7308
  module?: boolean;
7119
7309
 
7310
+ /**
7311
+ * The environment supports `<link rel="modulepreload">` to preload EcmaScript modules.
7312
+ */
7313
+ modulePreload?: boolean;
7314
+
7120
7315
  /**
7121
7316
  * The environment supports `process.getBuiltinModule()` to synchronously load Node.js core modules.
7122
7317
  */
@@ -7254,6 +7449,11 @@ declare interface ExecuteModuleOptions {
7254
7449
  declare interface ExecuteModuleResult {
7255
7450
  exports: any;
7256
7451
  cacheable: boolean;
7452
+
7453
+ /**
7454
+ * reasons why the executed modules are not cacheable
7455
+ */
7456
+ notCacheableReasons: string[];
7257
7457
  assets: Map<string, { source: Source; info?: AssetInfo }>;
7258
7458
  fileDependencies: LazySet<string>;
7259
7459
  contextDependencies: LazySet<string>;
@@ -7286,10 +7486,10 @@ declare interface Experiments {
7286
7486
  [index: string]: any;
7287
7487
 
7288
7488
  /**
7289
- * Support WebAssembly as asynchronous EcmaScript Module.
7489
+ * Support WebAssembly as asynchronous EcmaScript Module. `"auto"` (the default) enables it unless a loader is registered for WebAssembly files.
7290
7490
  * @experimental
7291
7491
  */
7292
- asyncWebAssembly?: boolean;
7492
+ asyncWebAssembly?: boolean | "auto";
7293
7493
 
7294
7494
  /**
7295
7495
  * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
@@ -7310,10 +7510,10 @@ declare interface Experiments {
7310
7510
  cacheUnaffected?: boolean;
7311
7511
 
7312
7512
  /**
7313
- * Enable css support.
7513
+ * Enable css support. `"auto"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.
7314
7514
  * @experimental
7315
7515
  */
7316
- css?: boolean;
7516
+ css?: boolean | "auto";
7317
7517
 
7318
7518
  /**
7319
7519
  * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
@@ -7328,10 +7528,10 @@ declare interface Experiments {
7328
7528
  futureDefaults?: boolean;
7329
7529
 
7330
7530
  /**
7331
- * Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.
7531
+ * Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points. `"auto"` (the default) enables it unless a loader is registered for HTML files.
7332
7532
  * @experimental
7333
7533
  */
7334
- html?: boolean;
7534
+ html?: boolean | "auto";
7335
7535
 
7336
7536
  /**
7337
7537
  * Compile entrypoints and import()s only when they are accessed.
@@ -7358,10 +7558,10 @@ declare interface Experiments {
7358
7558
  syncWebAssembly?: boolean;
7359
7559
 
7360
7560
  /**
7361
- * Enable typescript support.
7561
+ * Enable typescript support. `"auto"` (the default) enables the built-in TypeScript support when Node.js supports it (>= 22.6) and no loader is registered for TypeScript files.
7362
7562
  * @experimental
7363
7563
  */
7364
- typescript?: boolean;
7564
+ typescript?: boolean | "auto";
7365
7565
  }
7366
7566
 
7367
7567
  /**
@@ -7369,10 +7569,10 @@ declare interface Experiments {
7369
7569
  */
7370
7570
  declare interface ExperimentsNormalized {
7371
7571
  /**
7372
- * Support WebAssembly as asynchronous EcmaScript Module.
7572
+ * Support WebAssembly as asynchronous EcmaScript Module. `"auto"` (the default) enables it unless a loader is registered for WebAssembly files.
7373
7573
  * @experimental
7374
7574
  */
7375
- asyncWebAssembly?: boolean;
7575
+ asyncWebAssembly?: boolean | "auto";
7376
7576
 
7377
7577
  /**
7378
7578
  * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
@@ -7393,10 +7593,10 @@ declare interface ExperimentsNormalized {
7393
7593
  cacheUnaffected?: boolean;
7394
7594
 
7395
7595
  /**
7396
- * Enable css support.
7596
+ * Enable css support. `"auto"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.
7397
7597
  * @experimental
7398
7598
  */
7399
- css?: boolean;
7599
+ css?: boolean | "auto";
7400
7600
 
7401
7601
  /**
7402
7602
  * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
@@ -7411,10 +7611,10 @@ declare interface ExperimentsNormalized {
7411
7611
  futureDefaults?: boolean;
7412
7612
 
7413
7613
  /**
7414
- * Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.
7614
+ * Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points. `"auto"` (the default) enables it unless a loader is registered for HTML files.
7415
7615
  * @experimental
7416
7616
  */
7417
- html?: boolean;
7617
+ html?: boolean | "auto";
7418
7618
 
7419
7619
  /**
7420
7620
  * Compile entrypoints and import()s only when they are accessed.
@@ -7441,10 +7641,10 @@ declare interface ExperimentsNormalized {
7441
7641
  syncWebAssembly?: boolean;
7442
7642
 
7443
7643
  /**
7444
- * Enable typescript support.
7644
+ * Enable typescript support. `"auto"` (the default) enables the built-in TypeScript support when Node.js supports it (>= 22.6) and no loader is registered for TypeScript files.
7445
7645
  * @experimental
7446
7646
  */
7447
- typescript?: boolean;
7647
+ typescript?: boolean | "auto";
7448
7648
  }
7449
7649
  declare abstract class ExportInfo {
7450
7650
  name: string;
@@ -7984,7 +8184,11 @@ type ExternalItem =
7984
8184
  data: ExternalItemFunctionData,
7985
8185
  callback: (
7986
8186
  err?: null | Error,
7987
- result?: string | boolean | string[] | { [index: string]: any }
8187
+ result?:
8188
+ | string
8189
+ | boolean
8190
+ | string[]
8191
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown)
7988
8192
  ) => void
7989
8193
  ) => void)
7990
8194
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
@@ -7993,7 +8197,11 @@ type ExternalItemFunction =
7993
8197
  data: ExternalItemFunctionData,
7994
8198
  callback: (
7995
8199
  err?: null | Error,
7996
- result?: string | boolean | string[] | { [index: string]: any }
8200
+ result?:
8201
+ | string
8202
+ | boolean
8203
+ | string[]
8204
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown)
7997
8205
  ) => void
7998
8206
  ) => void)
7999
8207
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
@@ -8054,7 +8262,28 @@ declare interface ExternalItemObjectKnown {
8054
8262
  declare interface ExternalItemObjectUnknown {
8055
8263
  [index: string]: ExternalItemValue;
8056
8264
  }
8057
- type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
8265
+ type ExternalItemValue =
8266
+ | string
8267
+ | boolean
8268
+ | string[]
8269
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown);
8270
+
8271
+ /**
8272
+ * The target of the external with a type, optionally with an 'interop' hint describing how its exports interoperate with ES module imports.
8273
+ */
8274
+ declare interface ExternalItemValueObjectKnown {
8275
+ /**
8276
+ * How an external's exports interoperate with ES module imports, independent of the importing module's strictness (similar to Rollup's `output.interop`). 'default': treat as CommonJS, the default import is the whole exports (Node.js semantics). 'esModule': treat as an ES module namespace, the default import is unboxed to `.default`.
8277
+ */
8278
+ interop?: "default" | "esModule";
8279
+ }
8280
+
8281
+ /**
8282
+ * The target of the external with a type, optionally with an 'interop' hint describing how its exports interoperate with ES module imports.
8283
+ */
8284
+ declare interface ExternalItemValueObjectUnknown {
8285
+ [index: string]: string | string[];
8286
+ }
8058
8287
  declare class ExternalModule extends Module {
8059
8288
  /**
8060
8289
  * Creates an instance of ExternalModule.
@@ -8064,13 +8293,15 @@ declare class ExternalModule extends Module {
8064
8293
  type: ExternalsType,
8065
8294
  userRequest: string,
8066
8295
  dependencyMeta?:
8067
- ImportDependencyMeta | CssImportDependencyMeta | AssetDependencyMeta
8296
+ ImportDependencyMeta | CssImportDependencyMeta | AssetDependencyMeta,
8297
+ interop?: "default" | "esModule"
8068
8298
  );
8069
8299
  request: ExternalModuleRequest;
8070
8300
  externalType: ExternalsType;
8071
8301
  userRequest: string;
8072
8302
  dependencyMeta?:
8073
8303
  ImportDependencyMeta | CssImportDependencyMeta | AssetDependencyMeta;
8304
+ interop?: "default" | "esModule";
8074
8305
 
8075
8306
  /**
8076
8307
  * restore unsafe cache data
@@ -8186,7 +8417,11 @@ type Externals =
8186
8417
  data: ExternalItemFunctionData,
8187
8418
  callback: (
8188
8419
  err?: null | Error,
8189
- result?: string | boolean | string[] | { [index: string]: any }
8420
+ result?:
8421
+ | string
8422
+ | boolean
8423
+ | string[]
8424
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown)
8190
8425
  ) => void
8191
8426
  ) => void)
8192
8427
  | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
@@ -8215,6 +8450,7 @@ declare class ExternalsPlugin {
8215
8450
  | "umd2"
8216
8451
  | "jsonp"
8217
8452
  | "system"
8453
+ | "amd-async"
8218
8454
  | "promise"
8219
8455
  | "module-import"
8220
8456
  | "script"
@@ -8245,6 +8481,7 @@ declare class ExternalsPlugin {
8245
8481
  | "umd2"
8246
8482
  | "jsonp"
8247
8483
  | "system"
8484
+ | "amd-async"
8248
8485
  | "promise"
8249
8486
  | "module-import"
8250
8487
  | "script"
@@ -8344,6 +8581,7 @@ type ExternalsType =
8344
8581
  | "umd2"
8345
8582
  | "jsonp"
8346
8583
  | "system"
8584
+ | "amd-async"
8347
8585
  | "promise"
8348
8586
  | "module-import"
8349
8587
  | "script"
@@ -8459,7 +8697,7 @@ declare interface FileCacheOptions {
8459
8697
  /**
8460
8698
  * Compression type used for the cache files.
8461
8699
  */
8462
- compression?: false | "gzip" | "brotli";
8700
+ compression?: false | "gzip" | "brotli" | "zstd";
8463
8701
 
8464
8702
  /**
8465
8703
  * Algorithm used for generation the hash (see node.js crypto package).
@@ -9380,6 +9618,77 @@ declare interface HotModuleReplacementPluginLoaderContext {
9380
9618
  declare class HotUpdateChunk extends Chunk {
9381
9619
  constructor();
9382
9620
  }
9621
+ declare interface HtmlCompilationHooks {
9622
+ /**
9623
+ * called with the list of extra tags to inject into each page (initially empty) plus the current HTML; push `HtmlTagDescriptor`s and return the list — webpack serializes and places them by `injectTo`. A structured alternative to the string-level `transformHtml` for adding tags; runs before CSP so injected inline tags are hashed
9624
+ */
9625
+ injectTags: AsyncSeriesWaterfallHook<
9626
+ [HtmlTagDescriptor[], HtmlInjectTagsContext],
9627
+ HtmlTagDescriptor[]
9628
+ >;
9629
+
9630
+ /**
9631
+ * called with the page's `<script>`/`<link>`/`<style>`/`<meta>` tags (webpack's own and any injected) as mutable descriptors; mutate `attrs` (add a `nonce`/`data-*`, switch `defer`↔`async`, …), set `remove: true`, or change `injectTo` to move a tag between `<head>` and `<body>`, and webpack rewrites the changed tags. Add new tags with `injectTags` instead
9632
+ */
9633
+ transformTags: AsyncSeriesHook<[HtmlMutableTag[], HtmlTransformTagsContext]>;
9634
+
9635
+ /**
9636
+ * called with each emitted page's final HTML (all sentinels resolved) just before it is written; return the (possibly transformed) HTML — e.g. to minify, inject a CSP meta, or rewrite tags
9637
+ */
9638
+ transformHtml: AsyncSeriesWaterfallHook<
9639
+ [string, HtmlTransformHtmlContext],
9640
+ string
9641
+ >;
9642
+
9643
+ /**
9644
+ * called once each page's HTML asset has been finalized — a post-emit notification (nothing to return)
9645
+ */
9646
+ htmlEmitted: AsyncSeriesHook<[HtmlEmittedContext]>;
9647
+ }
9648
+ declare interface HtmlEmittedContext {
9649
+ outputName: string;
9650
+ }
9651
+ declare interface HtmlEntryInfo {
9652
+ request: string;
9653
+ entryName: string;
9654
+ type:
9655
+ | "html"
9656
+ | "script"
9657
+ | "stylesheet"
9658
+ | "prefetch"
9659
+ | "preload"
9660
+ | "modulepreload"
9661
+ | "script-module";
9662
+ css?: boolean;
9663
+ }
9664
+ type HtmlFaviconIcon =
9665
+ | string
9666
+ | {
9667
+ /**
9668
+ * Value for the `color` attribute (used by `rel="mask-icon"`).
9669
+ */
9670
+ color?: string;
9671
+ /**
9672
+ * Value for the `crossorigin` attribute.
9673
+ */
9674
+ crossorigin?: "anonymous" | "use-credentials";
9675
+ /**
9676
+ * Path to the icon file, emitted as a hashed asset.
9677
+ */
9678
+ href: string;
9679
+ /**
9680
+ * Value for the `media` attribute (e.g. `"(prefers-color-scheme: dark)"`).
9681
+ */
9682
+ media?: string;
9683
+ /**
9684
+ * Value for the `sizes` attribute (e.g. `"180x180"` or `"any"`).
9685
+ */
9686
+ sizes?: string;
9687
+ /**
9688
+ * Value for the `type` attribute; inferred from the file extension when omitted.
9689
+ */
9690
+ type?: string;
9691
+ };
9383
9692
  declare abstract class HtmlGenerator extends Generator {
9384
9693
  options: HtmlGeneratorOptions;
9385
9694
 
@@ -9430,14 +9739,75 @@ declare interface HtmlGeneratorOptions {
9430
9739
  */
9431
9740
  extract?: boolean | "inline";
9432
9741
  }
9742
+ declare interface HtmlInjectTagsContext {
9743
+ outputName: string;
9744
+ html: string;
9745
+ }
9433
9746
  type HtmlModuleBuildInfo = KnownBuildInfo &
9434
9747
  Record<string, any> &
9435
9748
  KnownNormalModuleBuildInfo &
9436
9749
  KnownHtmlModuleBuildInfo;
9750
+ declare class HtmlModulesPlugin {
9751
+ constructor();
9752
+
9753
+ /**
9754
+ * Applies the plugin by registering its hooks on the compiler.
9755
+ */
9756
+ apply(compiler: Compiler): void;
9757
+
9758
+ /**
9759
+ * `output.hashFunction`/`hashSalt`/`hashDigest`/`hashDigestLength`
9760
+ * digest of `content`, with `nonNumericOnlyHash` applied — webpack's
9761
+ * standard `[contenthash]` recipe.
9762
+ */
9763
+ static computeContentHash(
9764
+ content: string | Buffer,
9765
+ outputOptions: Output
9766
+ ): string;
9767
+
9768
+ /**
9769
+ * Filename template for an extracted HTML page: `output.htmlFilename` for
9770
+ * initial chunks, `output.htmlChunkFilename` otherwise — the HTML counterpart
9771
+ * of `CssModulesPlugin.getChunkFilenameTemplate`.
9772
+ */
9773
+ static getChunkFilenameTemplate(
9774
+ chunk: Chunk,
9775
+ outputOptions: Output
9776
+ ): ChunkFilenameTemplate;
9777
+
9778
+ /**
9779
+ * Per-compilation hooks for the experimental HTML support.
9780
+ */
9781
+ static getCompilationHooks: (
9782
+ compilation: Compilation
9783
+ ) => HtmlCompilationHooks;
9784
+ }
9785
+ declare interface HtmlMutableTag {
9786
+ /**
9787
+ * the (lowercased) tag name
9788
+ */
9789
+ tag: string;
9790
+
9791
+ /**
9792
+ * mutable attributes; a string value renders `name="value"`, `true` a bare attribute, `false`/`undefined`/deleting the key drops it
9793
+ */
9794
+ attrs: Record<string, undefined | string | boolean>;
9795
+
9796
+ /**
9797
+ * the tag's current region (`"head"`/`"body"`); set a different value to move it there (`*-prepend` to the region's start)
9798
+ */
9799
+ injectTo?: "body" | "head" | "head-prepend" | "body-prepend";
9800
+
9801
+ /**
9802
+ * set true to delete the whole element
9803
+ */
9804
+ remove?: boolean;
9805
+ }
9437
9806
  declare abstract class HtmlParser extends ParserClass {
9438
9807
  magicCommentContext: ContextImport;
9439
9808
  template?: (source: string, context: HtmlTemplateContext) => string;
9440
- sourcesByTag: Record<string, Record<string, SourceItem>>;
9809
+ fragmentContext?: string;
9810
+ sourcesByTag: SourceTable;
9441
9811
 
9442
9812
  /**
9443
9813
  * Runs the `template` option over the source and returns the transformed
@@ -9453,6 +9823,11 @@ declare abstract class HtmlParser extends ParserClass {
9453
9823
  * Parser options for html modules.
9454
9824
  */
9455
9825
  declare interface HtmlParserOptions {
9826
+ /**
9827
+ * Configure how the HTML source is parsed: `"document"` (the default) parses a full page; any other value is the tag name of the context element to parse the source as that element's inner HTML (a fragment) — e.g. `"template"` for a neutral fragment, or `"tbody"` so context-sensitive tags like a bare `<tr>`/`<td>` are kept instead of dropped.
9828
+ */
9829
+ as?: string;
9830
+
9456
9831
  /**
9457
9832
  * Configure extraction of URL-like attribute values (e.g. `<img src>`, `<link href>`, `<script src>`) as webpack dependencies. `true` (default) uses the built-in source list; `false` disables extraction entirely so attributes are left untouched and `<script src>` / `<link rel="modulepreload">` / `<link rel="stylesheet">` no longer become compilation entries; an array lets you customize which `tag`/`attribute` pairs are treated as URLs and how they are bundled. Use the string `"..."` inside the array to inline the defaults. Inline `<script>` and `<style>` bodies are always processed. Use `webpackIgnore` comments or `IgnorePlugin` to skip individual URLs.
9458
9833
  */
@@ -9477,9 +9852,11 @@ declare interface HtmlParserOptions {
9477
9852
  */
9478
9853
  tag?: string;
9479
9854
  /**
9480
- * How the attribute value should be parsed and bundled. `src` extracts a single URL as a plain asset; `srcset` parses a `srcset`-style list of candidate URLs as plain assets; `css-url` extracts `url(...)` references from a CSS value (like an SVG presentation attribute such as `fill`) as plain assets; `script` and `script-module` emit a classic / ES-module chunk entry like `<script src>` and `<script type="module" src>`; `stylesheet` emits a CSS chunk entry like `<link rel="stylesheet">`; `stylesheet-style` treats the attribute value as a full stylesheet (like a `<style>` body) and `stylesheet-style-attribute` as a CSS block's contents (a declaration list, like a `style` attribute) — both bundle it through the CSS pipeline and replace the attribute's content with the processed CSS at render time; `srcdoc` treats the attribute value as an entity-encoded HTML document (like `<iframe srcdoc>`), bundling it through the HTML pipeline and replacing the attribute's content with the processed HTML at render time.
9855
+ * How the attribute value should be parsed and bundled, or `false` to disable a built-in source for this `tag`/`attribute` (use together with `"..."` to drop a default, e.g. stop treating `<img src>` as a URL). `src` extracts a single URL as a plain asset; `srcset` parses a `srcset`-style list of candidate URLs as plain assets; `css-url` extracts `url(...)` references from a CSS value (like an SVG presentation attribute such as `fill`) as plain assets; `script` and `script-module` emit a classic / ES-module chunk entry like `<script src>` and `<script type="module" src>`; `stylesheet` emits a CSS chunk entry like `<link rel="stylesheet">`; `html` treats the URL as a link to another HTML file that is bundled as its own emitted page (its assets extracted) and rewrites the attribute to the page's output filename (like Parcel's `<a href="page.html">`); `stylesheet-style` treats the attribute value as a full stylesheet (like a `<style>` body) and `stylesheet-style-attribute` as a CSS block's contents (a declaration list, like a `style` attribute) — both bundle it through the CSS pipeline and replace the attribute's content with the processed CSS at render time; `srcdoc` treats the attribute value as an entity-encoded HTML document (like `<iframe srcdoc>`), bundling it through the HTML pipeline and replacing the attribute's content with the processed HTML at render time.
9481
9856
  */
9482
9857
  type:
9858
+ | false
9859
+ | "html"
9483
9860
  | "script"
9484
9861
  | "css-url"
9485
9862
  | "stylesheet"
@@ -9496,6 +9873,145 @@ declare interface HtmlParserOptions {
9496
9873
  * Transform the raw source before the html parser extracts dependencies. Receives the source string and a context (`{ module, resource }`) and must return the html string to parse. Useful for compiling a templating language (Handlebars, EJS, Eta, …) to html so that URLs the template emits are still picked up as webpack dependencies. Runs synchronously.
9497
9874
  */
9498
9875
  template?: (source: string, context: HtmlTemplateContext) => string;
9876
+
9877
+ /**
9878
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
9879
+ */
9880
+ urlHints?: UrlHintRule[];
9881
+ }
9882
+ declare interface HtmlResourceHintHtmlEntryDependency {
9883
+ /**
9884
+ * hint relationship
9885
+ */
9886
+ rel: HtmlResourceHintRel;
9887
+
9888
+ /**
9889
+ * literal URL (external, `preconnect`, or an already-hashed asset)
9890
+ */
9891
+ href?: string;
9892
+
9893
+ /**
9894
+ * chunk name to hint
9895
+ */
9896
+ chunk?: string;
9897
+
9898
+ /**
9899
+ * entrypoint name to hint (expands to one hint per initial chunk)
9900
+ */
9901
+ entry?: string;
9902
+
9903
+ /**
9904
+ * the `as` attribute; defaults to `script` for chunk/entry refs
9905
+ */
9906
+ as?: string;
9907
+
9908
+ /**
9909
+ * the `type` attribute (MIME)
9910
+ */
9911
+ type?: string;
9912
+
9913
+ /**
9914
+ * CORS mode (`true` → `anonymous`)
9915
+ */
9916
+ crossorigin?: boolean | "anonymous" | "use-credentials";
9917
+
9918
+ /**
9919
+ * the `media` attribute
9920
+ */
9921
+ media?: string;
9922
+
9923
+ /**
9924
+ * SRI for a chunk/entry ref; follows `output.html.integrity` by default, `false` opts out
9925
+ */
9926
+ integrity?: boolean;
9927
+
9928
+ /**
9929
+ * the `fetchpriority` attribute (allowed on `preload`/`modulepreload`/`prefetch`)
9930
+ */
9931
+ fetchPriority?: "auto" | "low" | "high";
9932
+ }
9933
+ type HtmlResourceHintRel =
9934
+ "prefetch" | "preload" | "modulepreload" | "preconnect" | "dns-prefetch";
9935
+
9936
+ /**
9937
+ * A custom resource-hint `<link>` for `output.html.resourceHints`. Exactly one of `href` / `chunk` / `entry` names the target.
9938
+ */
9939
+ declare interface HtmlResourceHintWebpackOptions {
9940
+ /**
9941
+ * The `as` attribute (`script`, `style`, `font`, …); defaults to `script` for chunk/entry references.
9942
+ */
9943
+ as?: string;
9944
+
9945
+ /**
9946
+ * Name of a chunk to hint; its emitted URL is resolved automatically.
9947
+ */
9948
+ chunk?: string;
9949
+
9950
+ /**
9951
+ * The CORS mode; `true` maps to `anonymous`.
9952
+ */
9953
+ crossorigin?: boolean | "anonymous" | "use-credentials";
9954
+
9955
+ /**
9956
+ * Name of an entrypoint to hint; expands to one hint per initial chunk.
9957
+ */
9958
+ entry?: string;
9959
+
9960
+ /**
9961
+ * The `fetchpriority` attribute. Emitted on `preload` / `modulepreload` and on `prefetch` (the spec now permits it there).
9962
+ */
9963
+ fetchPriority?: "auto" | "low" | "high";
9964
+
9965
+ /**
9966
+ * A literal URL used verbatim (external resource, `preconnect` origin, or an already-hashed asset).
9967
+ */
9968
+ href?: string;
9969
+
9970
+ /**
9971
+ * Subresource Integrity for a chunk/entry reference. Follows `output.html.integrity` by default; set `false` to opt this hint out.
9972
+ */
9973
+ integrity?: boolean;
9974
+
9975
+ /**
9976
+ * The `media` attribute.
9977
+ */
9978
+ media?: string;
9979
+
9980
+ /**
9981
+ * The `rel` of the resource hint.
9982
+ */
9983
+ rel: "prefetch" | "preload" | "modulepreload" | "preconnect" | "dns-prefetch";
9984
+
9985
+ /**
9986
+ * The `type` attribute (MIME type).
9987
+ */
9988
+ type?: string;
9989
+ }
9990
+ declare interface HtmlTagDescriptor {
9991
+ /**
9992
+ * tag name, e.g. `"script"` / `"link"` / `"meta"`
9993
+ */
9994
+ tag: string;
9995
+
9996
+ /**
9997
+ * attributes; `true` renders a bare boolean attribute, `false`/`undefined` is omitted
9998
+ */
9999
+ attrs?: Record<string, undefined | string | boolean>;
10000
+
10001
+ /**
10002
+ * inner content (ignored for void elements like `<link>`/`<meta>`)
10003
+ */
10004
+ children?: string;
10005
+
10006
+ /**
10007
+ * placement; defaults to `"head"`
10008
+ */
10009
+ injectTo?: "body" | "head" | "head-prepend" | "body-prepend";
10010
+
10011
+ /**
10012
+ * force a void element (no closing tag); inferred from the tag name when omitted
10013
+ */
10014
+ voidTag?: boolean;
9499
10015
  }
9500
10016
  declare interface HtmlTemplateContext {
9501
10017
  /**
@@ -9538,6 +10054,13 @@ declare interface HtmlTemplateContext {
9538
10054
  */
9539
10055
  emitError: (error: string | Error) => void;
9540
10056
  }
10057
+ declare interface HtmlTransformHtmlContext {
10058
+ outputName: string;
10059
+ }
10060
+ declare interface HtmlTransformTagsContext {
10061
+ outputName: string;
10062
+ html: string;
10063
+ }
9541
10064
 
9542
10065
  /**
9543
10066
  * Options for building http resources.
@@ -9960,6 +10483,65 @@ declare interface ImportDependencyMeta {
9960
10483
  type ImportExpressionJavascriptParser = ImportExpressionImport & {
9961
10484
  phase?: "defer" | "source";
9962
10485
  };
10486
+ type ImportMetaParserOptions = ImportMetaParserOptionsKnown &
10487
+ ImportMetaParserOptionsUnknown;
10488
+
10489
+ /**
10490
+ * Enable/disable evaluating import.meta fields. Omitted fields are enabled and unknown fields are preserved. Custom fields are allowed.
10491
+ */
10492
+ declare interface ImportMetaParserOptionsKnown {
10493
+ /**
10494
+ * Enable/disable evaluating import.meta.dirname.
10495
+ */
10496
+ dirname?: boolean;
10497
+
10498
+ /**
10499
+ * Enable/disable evaluating import.meta.env.
10500
+ */
10501
+ env?: boolean;
10502
+
10503
+ /**
10504
+ * Enable/disable evaluating import.meta.filename.
10505
+ */
10506
+ filename?: boolean;
10507
+
10508
+ /**
10509
+ * Enable/disable evaluating import.meta.main.
10510
+ */
10511
+ main?: boolean;
10512
+
10513
+ /**
10514
+ * Enable/disable evaluating import.meta.resolve.
10515
+ */
10516
+ resolve?: boolean;
10517
+
10518
+ /**
10519
+ * Enable/disable evaluating import.meta.url.
10520
+ */
10521
+ url?: boolean;
10522
+
10523
+ /**
10524
+ * Enable/disable evaluating import.meta.webpack.
10525
+ */
10526
+ webpack?: boolean;
10527
+
10528
+ /**
10529
+ * Enable/disable evaluating import.meta.webpackContext.
10530
+ */
10531
+ webpackContext?: boolean;
10532
+
10533
+ /**
10534
+ * Enable/disable evaluating import.meta.webpackHot.
10535
+ */
10536
+ webpackHot?: boolean;
10537
+ }
10538
+
10539
+ /**
10540
+ * Enable/disable evaluating import.meta fields. Omitted fields are enabled and unknown fields are preserved. Custom fields are allowed.
10541
+ */
10542
+ declare interface ImportMetaParserOptionsUnknown {
10543
+ [index: string]: boolean;
10544
+ }
9963
10545
  declare interface ImportModuleOptions {
9964
10546
  /**
9965
10547
  * the target layer
@@ -10019,6 +10601,11 @@ declare interface InfrastructureLogging {
10019
10601
  */
10020
10602
  level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
10021
10603
 
10604
+ /**
10605
+ * Show build progress. `"auto"` shows it only for interactive terminals. This option is only used when no custom console is provided.
10606
+ */
10607
+ progress?: boolean | "auto";
10608
+
10022
10609
  /**
10023
10610
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
10024
10611
  */
@@ -10281,10 +10868,9 @@ declare abstract class JavascriptGenerator extends Generator {
10281
10868
  * Processes the provided module.
10282
10869
  */
10283
10870
  sourceDependency(
10284
- module: Module,
10285
10871
  dependency: Dependency,
10286
- initFragments: InitFragment<GenerateContext>[],
10287
10872
  source: ReplaceSource,
10873
+ templateContext: DependencyTemplateContext,
10288
10874
  generateContext: GenerateContext
10289
10875
  ): void;
10290
10876
 
@@ -10294,7 +10880,7 @@ declare abstract class JavascriptGenerator extends Generator {
10294
10880
  sourceBlock(
10295
10881
  module: Module,
10296
10882
  block: DependenciesBlock,
10297
- initFragments: InitFragment<GenerateContext>[],
10883
+ templateContext: DependencyTemplateContext,
10298
10884
  source: ReplaceSource,
10299
10885
  generateContext: GenerateContext
10300
10886
  ): void;
@@ -10406,6 +10992,8 @@ declare class JavascriptParser extends ParserClass {
10406
10992
  options?: {
10407
10993
  parse?: (code: string, options: ParseOptions) => ParseResult;
10408
10994
  typescript?: boolean;
10995
+ importPhases?: boolean;
10996
+ strictModeViolations?: false | "error" | "warn";
10409
10997
  }
10410
10998
  );
10411
10999
  hooks: Readonly<{
@@ -10555,6 +11143,41 @@ declare class JavascriptParser extends ParserClass {
10555
11143
  ],
10556
11144
  boolean | void
10557
11145
  >;
11146
+ preStatementByType: HookMap<
11147
+ SyncBailHook<
11148
+ [
11149
+ | ImportDeclaration
11150
+ | ExportNamedDeclaration
11151
+ | ExportAllDeclaration
11152
+ | FunctionDeclaration
11153
+ | MaybeNamedFunctionDeclaration
11154
+ | VariableDeclaration
11155
+ | ClassDeclaration
11156
+ | MaybeNamedClassDeclaration
11157
+ | ExpressionStatement
11158
+ | BlockStatement
11159
+ | StaticBlock
11160
+ | EmptyStatement
11161
+ | DebuggerStatement
11162
+ | WithStatement
11163
+ | ReturnStatement
11164
+ | LabeledStatement
11165
+ | BreakStatement
11166
+ | ContinueStatement
11167
+ | IfStatement
11168
+ | SwitchStatement
11169
+ | ThrowStatement
11170
+ | TryStatement
11171
+ | WhileStatement
11172
+ | DoWhileStatement
11173
+ | ForStatement
11174
+ | ForInStatement
11175
+ | ForOfStatement
11176
+ | ExportDefaultDeclaration
11177
+ ],
11178
+ boolean | void
11179
+ >
11180
+ >;
10558
11181
  blockPreStatement: SyncBailHook<
10559
11182
  [
10560
11183
  | ImportDeclaration
@@ -10588,6 +11211,41 @@ declare class JavascriptParser extends ParserClass {
10588
11211
  ],
10589
11212
  boolean | void
10590
11213
  >;
11214
+ blockPreStatementByType: HookMap<
11215
+ SyncBailHook<
11216
+ [
11217
+ | ImportDeclaration
11218
+ | ExportNamedDeclaration
11219
+ | ExportAllDeclaration
11220
+ | FunctionDeclaration
11221
+ | MaybeNamedFunctionDeclaration
11222
+ | VariableDeclaration
11223
+ | ClassDeclaration
11224
+ | MaybeNamedClassDeclaration
11225
+ | ExpressionStatement
11226
+ | BlockStatement
11227
+ | StaticBlock
11228
+ | EmptyStatement
11229
+ | DebuggerStatement
11230
+ | WithStatement
11231
+ | ReturnStatement
11232
+ | LabeledStatement
11233
+ | BreakStatement
11234
+ | ContinueStatement
11235
+ | IfStatement
11236
+ | SwitchStatement
11237
+ | ThrowStatement
11238
+ | TryStatement
11239
+ | WhileStatement
11240
+ | DoWhileStatement
11241
+ | ForStatement
11242
+ | ForInStatement
11243
+ | ForOfStatement
11244
+ | ExportDefaultDeclaration
11245
+ ],
11246
+ boolean | void
11247
+ >
11248
+ >;
10591
11249
  statement: SyncBailHook<
10592
11250
  [
10593
11251
  | ImportDeclaration
@@ -10847,11 +11505,13 @@ declare class JavascriptParser extends ParserClass {
10847
11505
  options: {
10848
11506
  parse?: (code: string, options: ParseOptions) => ParseResult;
10849
11507
  typescript?: boolean;
11508
+ importPhases?: boolean;
11509
+ strictModeViolations?: false | "error" | "warn";
10850
11510
  };
10851
11511
  scope: ScopeInfo;
10852
11512
  state: JavascriptParserState;
10853
11513
  comments?: CommentJavascriptParser[];
10854
- semicolons?: Set<number>;
11514
+ semicolons?: Map<number, boolean>;
10855
11515
  statementPath?: StatementPathItem[];
10856
11516
  prevStatement?:
10857
11517
  | ImportDeclaration
@@ -12130,6 +12790,20 @@ declare class JavascriptParser extends ParserClass {
12130
12790
  commentsStartPos: number
12131
12791
  ): boolean;
12132
12792
 
12793
+ /**
12794
+ * Returns the location of a node or comment, computed from its offsets so
12795
+ * ASTs from parsers without location support work too. Falls back to the
12796
+ * node's own `loc` only when no source text is available (preparsed ASTs).
12797
+ * Offsets can only be mapped while parsing — callbacks deferred past the
12798
+ * `parse()` call must take the location upfront.
12799
+ */
12800
+ getLocation(node: {
12801
+ start?: number;
12802
+ end?: number;
12803
+ range?: [number, number];
12804
+ loc?: null | SourceLocation;
12805
+ }): DependencyLocation;
12806
+
12133
12807
  /**
12134
12808
  * Returns comments in the range.
12135
12809
  */
@@ -12485,6 +13159,11 @@ declare interface JavascriptParserOptions {
12485
13159
  */
12486
13160
  deferImport?: boolean;
12487
13161
 
13162
+ /**
13163
+ * Auto-emit `<link rel="preload" as="style">` for the CSS of every dynamically imported (`import()`) chunk, so the stylesheet fetches in parallel with the chunk's JavaScript instead of after it parses. Unlike `dynamicImportPreload`, the JavaScript itself is not preloaded. `true` uses the default order; a number sets the preload order.
13164
+ */
13165
+ dynamicImportCssPreload?: number | boolean;
13166
+
12488
13167
  /**
12489
13168
  * Specifies global fetchPriority for dynamic import.
12490
13169
  */
@@ -12551,12 +13230,13 @@ declare interface JavascriptParserOptions {
12551
13230
  importExportsPresence?: false | "auto" | "error" | "warn";
12552
13231
 
12553
13232
  /**
12554
- * Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
13233
+ * Enable/disable evaluating import.meta. Set to 'preserve-unknown' or an object to preserve unknown properties for runtime evaluation.
12555
13234
  */
12556
- importMeta?: boolean | "preserve-unknown";
13235
+ importMeta?: boolean | "preserve-unknown" | ImportMetaParserOptions;
12557
13236
 
12558
13237
  /**
12559
- * Enable/disable evaluating import.meta.webpackContext.
13238
+ * Deprecated in favor of "importMeta" object option with a "webpackContext" field. Enable/disable evaluating import.meta.webpackContext.
13239
+ * @deprecated
12560
13240
  */
12561
13241
  importMetaContext?: boolean;
12562
13242
 
@@ -12616,6 +13296,11 @@ declare interface JavascriptParserOptions {
12616
13296
  */
12617
13297
  strictExportPresence?: boolean;
12618
13298
 
13299
+ /**
13300
+ * Specifies the behavior of constructs that break at runtime in strict mode (e.g. 'with', 'arguments.callee', assigning to read-only globals) when modules are emitted as ES module output.
13301
+ */
13302
+ strictModeViolations?: false | "error" | "warn";
13303
+
12619
13304
  /**
12620
13305
  * Handle the this context correctly according to the spec for namespace objects.
12621
13306
  */
@@ -12657,11 +13342,21 @@ declare interface JavascriptParserOptions {
12657
13342
  */
12658
13343
  url?: boolean | "relative";
12659
13344
 
13345
+ /**
13346
+ * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).
13347
+ */
13348
+ urlHints?: UrlHintRule[];
13349
+
12660
13350
  /**
12661
13351
  * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
12662
13352
  */
12663
13353
  worker?: boolean | string[];
12664
13354
 
13355
+ /**
13356
+ * Disable or configure parsing of Worklet syntax like context.audioWorklet.addModule() or CSS.paintWorklet.addModule().
13357
+ */
13358
+ worklet?: boolean | string[];
13359
+
12665
13360
  /**
12666
13361
  * Enable warnings for partial dynamic dependencies.
12667
13362
  */
@@ -12906,6 +13601,11 @@ declare interface KnownAssetModuleBuildInfo {
12906
13601
  }
12907
13602
  declare interface KnownBuildInfo {
12908
13603
  cacheable?: boolean;
13604
+
13605
+ /**
13606
+ * reasons why the module is not cacheable (e.g. paths of loaders that marked it)
13607
+ */
13608
+ notCacheableReasons?: string[];
12909
13609
  strict?: boolean;
12910
13610
  moduleArgument?: string;
12911
13611
  exportsArgument?: string;
@@ -12925,6 +13625,11 @@ declare interface KnownBuildInfo {
12925
13625
  * true when the module is part of a circular dependency chain
12926
13626
  */
12927
13627
  isCircular?: boolean;
13628
+
13629
+ /**
13630
+ * module uses top-level `for await…of`, which can't be lowered to a generator
13631
+ */
13632
+ usesTopLevelAwaitForOf?: boolean;
12928
13633
  }
12929
13634
  declare interface KnownBuildMeta {
12930
13635
  exportsType?: "default" | "namespace" | "flagged" | "dynamic";
@@ -13023,7 +13728,7 @@ declare interface KnownHtmlModuleBuildInfo {
13023
13728
  /**
13024
13729
  * entries collected from the document, grouped by kind
13025
13730
  */
13026
- htmlEntryScripts?: Record<string, EntryScriptInfo[]>;
13731
+ htmlEntries?: Record<string, HtmlEntryInfo[]>;
13027
13732
 
13028
13733
  /**
13029
13734
  * `../` per `<base href>` path segment, prepended to the auto-public-path undo path so a relative base doesn't misdirect bundled URLs
@@ -13323,6 +14028,7 @@ declare interface KnownStatsModule {
13323
14028
  size?: number;
13324
14029
  sizes?: Record<string, number>;
13325
14030
  cacheable?: boolean;
14031
+ notCacheableReasons?: string[];
13326
14032
  built?: boolean;
13327
14033
  codeGenerated?: boolean;
13328
14034
  buildTimeExecuted?: boolean;
@@ -14533,10 +15239,6 @@ type Matcher =
14533
15239
  | RegExp
14534
15240
  | ((str: string) => boolean)
14535
15241
  | (string | RegExp | ((str: string) => boolean))[];
14536
-
14537
- /**
14538
- * Extract fragment index.
14539
- */
14540
15242
  declare interface MaybeMergeableInitFragment<GenerateContext> {
14541
15243
  key?: string;
14542
15244
  stage: number;
@@ -14598,6 +15300,41 @@ declare interface MergeDuplicateChunksPluginOptions {
14598
15300
  */
14599
15301
  stage?: number;
14600
15302
  }
15303
+ type MergedDefinitionNode =
15304
+ | undefined
15305
+ | null
15306
+ | string
15307
+ | number
15308
+ | bigint
15309
+ | boolean
15310
+ | Function
15311
+ | RegExp
15312
+ | RuntimeValue
15313
+ | {
15314
+ [index: string]: RecursiveArrayOrRecord<
15315
+ | undefined
15316
+ | null
15317
+ | string
15318
+ | number
15319
+ | bigint
15320
+ | boolean
15321
+ | Function
15322
+ | RegExp
15323
+ | RuntimeValue
15324
+ >;
15325
+ }
15326
+ | RecursiveArrayOrRecord<
15327
+ | undefined
15328
+ | null
15329
+ | string
15330
+ | number
15331
+ | bigint
15332
+ | boolean
15333
+ | Function
15334
+ | RegExp
15335
+ | RuntimeValue
15336
+ >[]
15337
+ | Map<string, MergedDefinitionNode>;
14601
15338
  type Meta = KnownMeta & Record<symbol, string[]> & Record<string, any>;
14602
15339
  declare class MinChunkSizePlugin {
14603
15340
  /**
@@ -15310,6 +16047,7 @@ declare interface ModuleFederationPluginOptions {
15310
16047
  | "umd2"
15311
16048
  | "jsonp"
15312
16049
  | "system"
16050
+ | "amd-async"
15313
16051
  | "promise"
15314
16052
  | "module-import"
15315
16053
  | "script"
@@ -16277,6 +17015,7 @@ declare class MultiCompiler {
16277
17015
  compilers: Compiler[];
16278
17016
  dependencies: WeakMap<Compiler, string[]>;
16279
17017
  running: boolean;
17018
+ watching?: MultiWatching;
16280
17019
  get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
16281
17020
  get outputPath(): string;
16282
17021
 
@@ -17756,9 +18495,9 @@ declare interface Optimization {
17756
18495
  false | "natural" | "named" | "deterministic" | "size" | "total-size";
17757
18496
 
17758
18497
  /**
17759
- * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
18498
+ * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. An options object implies 'true'.
17760
18499
  */
17761
- concatenateModules?: boolean;
18500
+ concatenateModules?: boolean | ConcatenateModulesOptions;
17762
18501
 
17763
18502
  /**
17764
18503
  * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
@@ -17906,9 +18645,9 @@ declare interface OptimizationNormalized {
17906
18645
  false | "natural" | "named" | "deterministic" | "size" | "total-size";
17907
18646
 
17908
18647
  /**
17909
- * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
18648
+ * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. An options object implies 'true'.
17910
18649
  */
17911
- concatenateModules?: boolean;
18650
+ concatenateModules?: boolean | ConcatenateModulesOptions;
17912
18651
 
17913
18652
  /**
17914
18653
  * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
@@ -18067,7 +18806,9 @@ type OptimizationNormalizedWithDefaults = OptimizationNormalized & {
18067
18806
  mangleExports: NonNullable<undefined | boolean | "deterministic" | "size">;
18068
18807
  innerGraph: NonNullable<undefined | boolean>;
18069
18808
  inlineExports: NonNullable<undefined | boolean>;
18070
- concatenateModules: NonNullable<undefined | boolean>;
18809
+ concatenateModules: NonNullable<
18810
+ undefined | boolean | ConcatenateModulesOptions
18811
+ >;
18071
18812
  avoidEntryIife: NonNullable<undefined | boolean>;
18072
18813
  emitOnErrors: NonNullable<undefined | boolean>;
18073
18814
  checkWasmTypes: NonNullable<undefined | boolean>;
@@ -18667,6 +19408,26 @@ declare interface Output {
18667
19408
  */
18668
19409
  publicPath?: string | TemplatePathFn<PathData>;
18669
19410
 
19411
+ /**
19412
+ * Resource-hint (`<link rel="prefetch">` / `<link rel="preload">` / `<link rel="modulepreload">` / `<link rel="preconnect">`) emission for extracted HTML entries and URL-referenced assets. Accepts the initial-graph shorthand (boolean / `"prefetch"` / `"preload"` / `"none"` / `HtmlResourceHint[]` / function — equivalent to `{ initial: <value> }`) or the full object form `{ initial, urlHints, preconnect, modulePreloadPolyfill, manifest }`. `initial` defaults on for ESM output (`output.module`), where native `import()` would otherwise waterfall; classic output stays opt-in.
19413
+ */
19414
+ resourceHints?:
19415
+ | boolean
19416
+ | "none"
19417
+ | ResourceHintsOptions
19418
+ | HtmlResourceHintWebpackOptions[]
19419
+ | "prefetch"
19420
+ | "preload"
19421
+ | ((context: {
19422
+ entryName: string;
19423
+ entrypoint: Entrypoint;
19424
+ hostType: "html" | "js";
19425
+ compilation: Compilation;
19426
+ defaultHints: (HtmlResourceHintHtmlEntryDependency & {
19427
+ hostChunks: string[];
19428
+ })[];
19429
+ }) => HtmlResourceHintHtmlEntryDependency[]);
19430
+
18670
19431
  /**
18671
19432
  * This option enables loading async chunks via a custom script type, such as script type="module".
18672
19433
  */
@@ -18718,6 +19479,11 @@ declare interface Output {
18718
19479
  */
18719
19480
  wasmLoading?: string | false;
18720
19481
 
19482
+ /**
19483
+ * Fall back to non-streaming WebAssembly instantiation when streaming compilation fails because the server does not serve `.wasm` files with the `application/wasm` MIME type.
19484
+ */
19485
+ wasmStreamingFallback?: boolean;
19486
+
18721
19487
  /**
18722
19488
  * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
18723
19489
  */
@@ -18788,10 +19554,155 @@ declare interface OutputFileSystem {
18788
19554
  * Options for the generated HTML files.
18789
19555
  */
18790
19556
  declare interface OutputHtmlOptions {
19557
+ /**
19558
+ * Inject a `<base>` element into the page `<head>`. A string sets `href`; an object sets both `href` and optionally `target`. Skipped if the HTML already contains a `<base>` element.
19559
+ */
19560
+ base?:
19561
+ | string
19562
+ | {
19563
+ /**
19564
+ * Value for the `href` attribute of the `<base>` element.
19565
+ */
19566
+ href: string;
19567
+ /**
19568
+ * Value for the `target` attribute of the `<base>` element (e.g. `"_blank"`).
19569
+ */
19570
+ target?: string;
19571
+ };
19572
+
19573
+ /**
19574
+ * Inject a `<meta http-equiv="Content-Security-Policy">` into every webpack-emitted HTML page. `false` (default) does nothing; `true` uses a strict baseline (`script-src 'self'`, `style-src 'self'`, `object-src 'none'`, `base-uri 'self'`) and appends a `sha256` hash of every inline `<script>`/`<style>` to `script-src`/`style-src`. An object customizes it. Skipped when the page already declares a CSP.
19575
+ */
19576
+ csp?:
19577
+ | boolean
19578
+ | {
19579
+ /**
19580
+ * Hash algorithm used for inline `<script>`/`<style>` sources.
19581
+ */
19582
+ hashFunction?: "sha256" | "sha384" | "sha512";
19583
+ /**
19584
+ * Placeholder nonce added to injected `<script>`/`<style>` tags and as a `'nonce-…'` source; rewrite it per request server-side.
19585
+ */
19586
+ nonce?: string;
19587
+ /**
19588
+ * CSP directives merged over the baseline. Each key is a directive (e.g. `"script-src"`); the value is a source string or list. Inline hashes and any `nonce` are still appended to `script-src`/`style-src`.
19589
+ */
19590
+ policy?: { [index: string]: string | string[] };
19591
+ };
19592
+
19593
+ /**
19594
+ * Favicon(s) for webpack-generated HTML (authored pages are left untouched). `false` (default) injects nothing; `true` injects the webpack logo; a string is a path to an icon; an object maps each `<link rel>` to an icon — a path string, an object with the icon `href` plus extra link attributes (`sizes`, `media`, `color`, `type`, `crossorigin`), or an array of these for multiple icons under the same `rel` (e.g. several `sizes`, or light/dark `media` variants); a function receives the page name and returns one of these. Every icon is emitted as a hashed asset.
19595
+ */
19596
+ favicon?:
19597
+ | string
19598
+ | boolean
19599
+ | {
19600
+ [index: string]:
19601
+ | string
19602
+ | {
19603
+ /**
19604
+ * Value for the `color` attribute (used by `rel="mask-icon"`).
19605
+ */
19606
+ color?: string;
19607
+ /**
19608
+ * Value for the `crossorigin` attribute.
19609
+ */
19610
+ crossorigin?: "anonymous" | "use-credentials";
19611
+ /**
19612
+ * Path to the icon file, emitted as a hashed asset.
19613
+ */
19614
+ href: string;
19615
+ /**
19616
+ * Value for the `media` attribute (e.g. `"(prefers-color-scheme: dark)"`).
19617
+ */
19618
+ media?: string;
19619
+ /**
19620
+ * Value for the `sizes` attribute (e.g. `"180x180"` or `"any"`).
19621
+ */
19622
+ sizes?: string;
19623
+ /**
19624
+ * Value for the `type` attribute; inferred from the file extension when omitted.
19625
+ */
19626
+ type?: string;
19627
+ }
19628
+ | HtmlFaviconIcon[];
19629
+ }
19630
+ | ((name: string) =>
19631
+ | string
19632
+ | boolean
19633
+ | {
19634
+ [index: string]:
19635
+ | string
19636
+ | {
19637
+ /**
19638
+ * Value for the `color` attribute (used by `rel="mask-icon"`).
19639
+ */
19640
+ color?: string;
19641
+ /**
19642
+ * Value for the `crossorigin` attribute.
19643
+ */
19644
+ crossorigin?: "anonymous" | "use-credentials";
19645
+ /**
19646
+ * Path to the icon file, emitted as a hashed asset.
19647
+ */
19648
+ href: string;
19649
+ /**
19650
+ * Value for the `media` attribute (e.g. `"(prefers-color-scheme: dark)"`).
19651
+ */
19652
+ media?: string;
19653
+ /**
19654
+ * Value for the `sizes` attribute (e.g. `"180x180"` or `"any"`).
19655
+ */
19656
+ sizes?: string;
19657
+ /**
19658
+ * Value for the `type` attribute; inferred from the file extension when omitted.
19659
+ */
19660
+ type?: string;
19661
+ }
19662
+ | HtmlFaviconIcon[];
19663
+ });
19664
+
19665
+ /**
19666
+ * Where to place injected chunk `<script>`/`<link>` tags. `"body"` (default; `"head"` with `output.module`) keeps them next to the entry tag — end of `<body>` on generated pages; `"head"` moves them into `<head>`; `false` suppresses sibling-chunk injection (entry tags and resource hints remain).
19667
+ */
19668
+ inject?: false | "body" | "head";
19669
+
19670
+ /**
19671
+ * Inline the content of matching chunks directly into the HTML instead of emitting a separate `<script>`/`<link>` tag. `true` inlines every chunk; `"script"` inlines only JavaScript, `"style"` only CSS; an array of `RegExp` patterns matches against the chunk name.
19672
+ */
19673
+ inline?: boolean | "script" | "style" | RegExp[];
19674
+
19675
+ /**
19676
+ * Add Subresource Integrity (SRI) `integrity` attributes to injected `<script>`/`<link>` tags. `true` uses `['sha384']`; an array sets the hash algorithms; a function receives each referenced asset and returns the algorithms to use or `false` to skip it.
19677
+ */
19678
+ integrity?:
19679
+ | boolean
19680
+ | string[]
19681
+ | ((asset: { chunk: Chunk; filename: string }) => false | string[]);
19682
+
19683
+ /**
19684
+ * Web app manifest for webpack-generated HTML (authored pages are left untouched). `false` (default) injects nothing. A string is a path to an existing `.webmanifest` file to link. An object is the manifest contents — serialized, emitted as a hashed `.webmanifest` and linked with `<link rel="manifest">`; its `icons`/`screenshots` `src` paths resolve like any request and are emitted as hashed assets. A function receives the page name and returns one of these.
19685
+ */
19686
+ manifest?:
19687
+ | string
19688
+ | false
19689
+ | { [index: string]: any }
19690
+ | ((name: string) => string | false | { [index: string]: any });
19691
+
19692
+ /**
19693
+ * Inject `<meta>` tags into the page `<head>`. Each key is the `name` attribute (or `"charset"` for a charset declaration); the value is the `content` string. Keys beginning with `og:` use the `property` attribute instead of `name`. A tag is skipped if the HTML already contains a meta with the same name.
19694
+ */
19695
+ meta?: { [index: string]: string };
19696
+
18791
19697
  /**
18792
19698
  * How injected `<script>` tags load. `auto` (default) emits a module script for ES module output and `defer` otherwise; `defer` forces a deferred script; `blocking` emits a plain blocking script.
18793
19699
  */
18794
19700
  scriptLoading?: "auto" | "defer" | "blocking";
19701
+
19702
+ /**
19703
+ * Sets the `<title>` of the generated HTML page. Skipped if the HTML already contains a `<title>` element.
19704
+ */
19705
+ title?: string;
18795
19706
  }
18796
19707
 
18797
19708
  /**
@@ -19005,6 +19916,11 @@ declare interface OutputNormalized {
19005
19916
  */
19006
19917
  publicPath?: string | TemplatePathFn<PathData>;
19007
19918
 
19919
+ /**
19920
+ * Full resource-hint configuration.
19921
+ */
19922
+ resourceHints?: ResourceHintsOptions;
19923
+
19008
19924
  /**
19009
19925
  * This option enables loading async chunks via a custom script type, such as script type="module".
19010
19926
  */
@@ -19051,6 +19967,11 @@ declare interface OutputNormalized {
19051
19967
  */
19052
19968
  wasmLoading?: string | false;
19053
19969
 
19970
+ /**
19971
+ * Fall back to non-streaming WebAssembly instantiation when streaming compilation fails because the server does not serve `.wasm` files with the `application/wasm` MIME type.
19972
+ */
19973
+ wasmStreamingFallback?: boolean;
19974
+
19054
19975
  /**
19055
19976
  * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
19056
19977
  */
@@ -19138,14 +20059,32 @@ declare interface ParseOptions {
19138
20059
  locations?: boolean;
19139
20060
  comments?: boolean;
19140
20061
  ranges?: boolean;
19141
- semicolons?: boolean;
19142
20062
  allowHashBang?: boolean;
19143
20063
  allowReturnOutsideFunction?: boolean;
20064
+
20065
+ /**
20066
+ * internal: serve `range` lazily and skip acorn's location/range tracking
20067
+ */
20068
+ lazyNodes?: boolean;
20069
+
20070
+ /**
20071
+ * internal: collect comments here without slicing their text eagerly
20072
+ */
20073
+ lazyComments?: CommentJavascriptParser[];
20074
+
20075
+ /**
20076
+ * enable parsing of the import phase proposals (import defer / import source)
20077
+ */
20078
+ importPhases?: boolean;
20079
+
20080
+ /**
20081
+ * internal: for `auto`, let the parser downgrade module->script in place instead of re-parsing
20082
+ */
20083
+ moduleFallback?: boolean;
19144
20084
  }
19145
20085
  declare interface ParseResult {
19146
20086
  ast: Program;
19147
20087
  comments: CommentJavascriptParser[];
19148
- semicolons: Set<number>;
19149
20088
  }
19150
20089
  declare interface ParsedIdentifier {
19151
20090
  /**
@@ -19627,6 +20566,7 @@ declare class ProgressPlugin {
19627
20566
  percentBy: null | "entries" | "modules" | "dependencies";
19628
20567
  progressBar:
19629
20568
  | false
20569
+ | "auto"
19630
20570
  | Required<{
19631
20571
  /**
19632
20572
  * Color used for the filled portion of the bar.
@@ -19636,7 +20576,13 @@ declare class ProgressPlugin {
19636
20576
  * Name shown before the progress bar.
19637
20577
  */
19638
20578
  name?: string;
20579
+ /**
20580
+ * Width of the progress bar in characters. Default: 25.
20581
+ */
20582
+ width?: number;
19639
20583
  }>;
20584
+ estimatedTime: boolean;
20585
+ phaseTimings: boolean;
19640
20586
 
19641
20587
  /**
19642
20588
  * Applies the plugin by registering its hooks on the compiler.
@@ -19653,18 +20599,7 @@ declare class ProgressPlugin {
19653
20599
  static createDefaultHandler: (
19654
20600
  profile: undefined | null | boolean,
19655
20601
  logger: WebpackLogger,
19656
- progressBar?:
19657
- | false
19658
- | Required<{
19659
- /**
19660
- * Color used for the filled portion of the bar.
19661
- */
19662
- color?: string;
19663
- /**
19664
- * Name shown before the progress bar.
19665
- */
19666
- name?: string;
19667
- }>
20602
+ options?: DefaultHandlerOptions
19668
20603
  ) => (percentage: number, msg: string, ...args: string[]) => void;
19669
20604
  }
19670
20605
  type ProgressPluginArgument =
@@ -19695,6 +20630,11 @@ declare interface ProgressPluginOptions {
19695
20630
  */
19696
20631
  entries?: boolean;
19697
20632
 
20633
+ /**
20634
+ * Show estimated time remaining based on build progress. Default: false.
20635
+ */
20636
+ estimatedTime?: boolean;
20637
+
19698
20638
  /**
19699
20639
  * Function that executes for every progress step.
19700
20640
  */
@@ -19715,16 +20655,22 @@ declare interface ProgressPluginOptions {
19715
20655
  */
19716
20656
  percentBy?: null | "entries" | "modules" | "dependencies";
19717
20657
 
20658
+ /**
20659
+ * Show a timing breakdown for each build phase when the build completes. Default: false.
20660
+ */
20661
+ phaseTimings?: boolean;
20662
+
19718
20663
  /**
19719
20664
  * Collect profile data for progress steps. Default: false.
19720
20665
  */
19721
20666
  profile?: null | boolean;
19722
20667
 
19723
20668
  /**
19724
- * Generate progress bar. Default: false.
20669
+ * Generate progress bar. `"auto"` enables it only for interactive terminals. Default: false.
19725
20670
  */
19726
20671
  progressBar?:
19727
20672
  | boolean
20673
+ | "auto"
19728
20674
  | {
19729
20675
  /**
19730
20676
  * Color used for the filled portion of the bar.
@@ -19734,6 +20680,10 @@ declare interface ProgressPluginOptions {
19734
20680
  * Name shown before the progress bar.
19735
20681
  */
19736
20682
  name?: string;
20683
+ /**
20684
+ * Width of the progress bar in characters. Default: 25.
20685
+ */
20686
+ width?: number;
19737
20687
  };
19738
20688
  }
19739
20689
  declare class ProvidePlugin {
@@ -19809,6 +20759,11 @@ type PureCondition =
19809
20759
  declare interface RawChunkGroupOptions {
19810
20760
  preloadOrder?: number;
19811
20761
  prefetchOrder?: number;
20762
+
20763
+ /**
20764
+ * preload only the chunk's CSS (`as="style"`), not its JS
20765
+ */
20766
+ cssPreloadOrder?: number;
19812
20767
  fetchPriority?: "auto" | "low" | "high";
19813
20768
  }
19814
20769
  type RawDevTool = string | false;
@@ -21667,6 +22622,50 @@ declare interface ResourceDataWithData {
21667
22622
  context?: string;
21668
22623
  data: ResourceSchemeData & Partial<ResolveRequest>;
21669
22624
  }
22625
+
22626
+ /**
22627
+ * Full resource-hint configuration.
22628
+ */
22629
+ declare interface ResourceHintsOptions {
22630
+ /**
22631
+ * Initial dependency-graph chunk hints. `true` auto-emits `<link rel="modulepreload">` (ESM output) or `<link rel="preload" as="script">` (classic) for each of the entry's initial dependency chunks; `"prefetch"` uses `<link rel="prefetch">`; `"preload"` is an alias of `true`; `false` disables chunk hints (URL-asset hints from magic comments / `urlHints` still fire); `"none"` is a hard off switch (no `<link>` anywhere, empty stats / manifest); an array of `HtmlResourceHint` descriptors replaces the auto set; a function receives the auto `defaultHints` plus context (`entryName`, `entrypoint`, `hostType: "html" | "js"`, `compilation`) and returns the final list (replaces the removed `resolveDependencies` hook).
22632
+ */
22633
+ initial?:
22634
+ | boolean
22635
+ | "none"
22636
+ | HtmlResourceHintWebpackOptions[]
22637
+ | "prefetch"
22638
+ | "preload"
22639
+ | ((context: {
22640
+ entryName: string;
22641
+ entrypoint: Entrypoint;
22642
+ hostType: "html" | "js";
22643
+ compilation: Compilation;
22644
+ defaultHints: (HtmlResourceHintHtmlEntryDependency & {
22645
+ hostChunks: string[];
22646
+ })[];
22647
+ }) => HtmlResourceHintHtmlEntryDependency[]);
22648
+
22649
+ /**
22650
+ * Emit a JSON manifest of the resolved resource hints for each entrypoint (the same descriptors as `stats.entrypoints[].resourceHints`) as an output asset at this path. Lets an SSR server inject the `<link>` tags itself without walking the chunk graph — webpack's analogue of Vite's `build.ssrManifest`. Empty when `initial` is `"none"`.
22651
+ */
22652
+ manifest?: string;
22653
+
22654
+ /**
22655
+ * Inject a tiny inline `<script>` polyfill for `<link rel="modulepreload">` into extracted HTML pages. Defaults from the target's modulepreload support (`output.environment.modulePreload`) — `true` when the environment lacks native support, `false` when it has it. Set `false` to never inject (the `<link>` tags are still emitted but do nothing on browsers without support — useful under a strict CSP that forbids inline scripts).
22656
+ */
22657
+ modulePreloadPolyfill?: boolean;
22658
+
22659
+ /**
22660
+ * Auto-emit `<link rel="preconnect">` for the origin of a cross-origin `output.publicPath` (the origin bundles and assets are served from) into extracted HTML entries and the resource-hint stats / manifest. Mirrors `output.crossOriginLoading`. No-op when `publicPath` is relative or `"auto"`.
22661
+ */
22662
+ preconnect?: boolean;
22663
+
22664
+ /**
22665
+ * Project-wide URL-referenced-asset hint rules, applied as the base `urlHints` of every parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>`). Parser-scoped `module.parser.<type>.urlHints` rules and per-URL magic comments still override these.
22666
+ */
22667
+ urlHints?: UrlHintRule[];
22668
+ }
21670
22669
  declare interface ResourceSchemeData {
21671
22670
  /**
21672
22671
  * mime type of the resource
@@ -22340,6 +23339,7 @@ declare abstract class RuntimeTemplate {
22340
23339
  supportsLogicalAssignment(): boolean;
22341
23340
  supportsArrowFunction(): boolean;
22342
23341
  supportsAsyncFunction(): boolean;
23342
+ supportsGenerator(): boolean;
22343
23343
  supportsOptionalChaining(): boolean;
22344
23344
  supportsSpread(): boolean;
22345
23345
  supportsObjectHasOwn(): boolean;
@@ -22349,6 +23349,8 @@ declare abstract class RuntimeTemplate {
22349
23349
  supportsBigIntLiteral(): boolean;
22350
23350
  supportsDynamicImport(): boolean;
22351
23351
  supportsEcmaScriptModuleSyntax(): boolean;
23352
+ supportsModulePreload(): boolean;
23353
+ supportsAnalyzableEsm(): boolean;
22352
23354
  supportTemplateLiteral(): boolean;
22353
23355
  supportNodePrefixForCoreModules(): boolean;
22354
23356
 
@@ -22692,6 +23694,10 @@ declare abstract class RuntimeTemplate {
22692
23694
  * if set, will be filled with runtime requirements
22693
23695
  */
22694
23696
  runtimeRequirements: Set<string>;
23697
+ /**
23698
+ * the module the `import()` is emitted into
23699
+ */
23700
+ originModule?: Module;
22695
23701
  }): string;
22696
23702
 
22697
23703
  /**
@@ -22852,6 +23858,10 @@ declare abstract class RuntimeTemplate {
22852
23858
  * if set, will be filled with runtime requirements
22853
23859
  */
22854
23860
  runtimeRequirements: Set<string>;
23861
+ /**
23862
+ * the module the `import()` is emitted into
23863
+ */
23864
+ originModule?: Module;
22855
23865
  }): string;
22856
23866
 
22857
23867
  /**
@@ -23491,6 +24501,9 @@ declare interface SourceAndMap {
23491
24501
  */
23492
24502
  map: null | RawSourceMap;
23493
24503
  }
24504
+ declare interface SourceBucket {
24505
+ [index: string]: undefined | SourceItem;
24506
+ }
23494
24507
  declare interface SourceItem {
23495
24508
  type: SourceTypeOrResolver;
23496
24509
  filter?: (attributes: Map<string, string>, value: string) => boolean;
@@ -23677,12 +24690,18 @@ declare interface SourcePosition {
23677
24690
  line: number;
23678
24691
  column?: number;
23679
24692
  }
24693
+ declare interface SourceTable {
24694
+ [index: string]: SourceBucket;
24695
+ }
23680
24696
  type SourceType =
24697
+ | "html"
23681
24698
  | "script"
23682
24699
  | "css-url"
23683
24700
  | "stylesheet"
23684
- | "script-module"
24701
+ | "prefetch"
24702
+ | "preload"
23685
24703
  | "modulepreload"
24704
+ | "script-module"
23686
24705
  | "src"
23687
24706
  | "srcset"
23688
24707
  | "stylesheet-style"
@@ -23690,11 +24709,14 @@ type SourceType =
23690
24709
  | "srcdoc"
23691
24710
  | "msapplication-task";
23692
24711
  type SourceTypeOrResolver =
24712
+ | "html"
23693
24713
  | "script"
23694
24714
  | "css-url"
23695
24715
  | "stylesheet"
23696
- | "script-module"
24716
+ | "prefetch"
24717
+ | "preload"
23697
24718
  | "modulepreload"
24719
+ | "script-module"
23698
24720
  | "src"
23699
24721
  | "srcset"
23700
24722
  | "stylesheet-style"
@@ -23821,11 +24843,15 @@ declare abstract class StackEntry {
23821
24843
 
23822
24844
  /**
23823
24845
  * Layered map that supports child scopes while memoizing lookups from parent
23824
- * scopes into the current layer.
24846
+ * scopes. Layers form a linked parent chain, so `createChild` is O(1) instead
24847
+ * of copying a layer array per scope. A layer's `Map` is only allocated on its
24848
+ * first own write, and lookup results are memoized into the nearest
24849
+ * `Map`-bearing layer of the walk — read-only layers (most block scopes) stay
24850
+ * allocation-free and share their parent's memoized entries.
23825
24851
  */
23826
24852
  declare abstract class StackedMap<K, V> {
23827
- map: Map<K, InternalCell<V>>;
23828
- stack: Map<K, InternalCell<V>>[];
24853
+ map?: Map<K, InternalCell<V>>;
24854
+ parent?: StackedMap<K, V>;
23829
24855
 
23830
24856
  /**
23831
24857
  * Stores a value in the current layer, preserving explicit `undefined`
@@ -23841,13 +24867,14 @@ declare abstract class StackedMap<K, V> {
23841
24867
 
23842
24868
  /**
23843
24869
  * Checks whether a key exists in the current scope chain, caching any parent
23844
- * lookup result in the current layer.
24870
+ * lookup result in the nearest `Map`-bearing layer.
23845
24871
  */
23846
24872
  has(item: K): boolean;
23847
24873
 
23848
24874
  /**
23849
24875
  * Returns the visible value for a key, caching parent hits and misses in the
23850
- * current layer.
24876
+ * nearest `Map`-bearing layer so repeated lookups (from this layer or any
24877
+ * sibling below that layer) answer with a single probe.
23851
24878
  */
23852
24879
  get(item: K): Cell<V>;
23853
24880
 
@@ -24361,6 +25388,11 @@ declare interface StatsOptions {
24361
25388
  */
24362
25389
  chunkGroupMaxAssets?: number;
24363
25390
 
25391
+ /**
25392
+ * Include the resolved `<link>` resource-hint descriptors for each entrypoint (`entrypoints[name].resourceHints`). Combines `output.resourceHints.chunks` (initial-graph modulepreload/preload/prefetch) with `output.resourceHints.assets` (URL-referenced fonts / images / …). Lets SSR frameworks inject the hints server-side without walking the chunk graph themselves; the analogue of Vite's `build.ssrManifest`.
25393
+ */
25394
+ chunkGroupResourceHints?: boolean;
25395
+
24364
25396
  /**
24365
25397
  * Display all chunk groups with the corresponding bundles.
24366
25398
  */
@@ -25109,6 +26141,71 @@ declare interface UpdateHashContextGenerator {
25109
26141
  runtime: RuntimeSpec;
25110
26142
  runtimeTemplate?: RuntimeTemplate;
25111
26143
  }
26144
+
26145
+ /**
26146
+ * One default-hint rule for URL-referenced assets emitted by this parser (JS `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`). `test` / `include` / `exclude` match against the asset's request; omit all three to apply to every asset. Matching rules set the same fields a `webpackPrefetch` / `webpackPreload` / `webpackAs` / `webpackType` / `webpackMedia` / `webpackFetchPriority` magic comment would; explicit magic comments on the same URL still win.
26147
+ */
26148
+ declare interface UrlHintRule {
26149
+ /**
26150
+ * Default `as` attribute (script / style / font / image / …).
26151
+ */
26152
+ as?: string;
26153
+
26154
+ /**
26155
+ * A condition matcher.
26156
+ */
26157
+ exclude?:
26158
+ | string
26159
+ | RegExp
26160
+ | ((value: string) => boolean)
26161
+ | RuleSetLogicalConditions
26162
+ | RuleSetCondition[];
26163
+
26164
+ /**
26165
+ * Default fetchpriority for prefetch / preload links.
26166
+ */
26167
+ fetchPriority?: false | "auto" | "low" | "high";
26168
+
26169
+ /**
26170
+ * A condition matcher.
26171
+ */
26172
+ include?:
26173
+ | string
26174
+ | RegExp
26175
+ | ((value: string) => boolean)
26176
+ | RuleSetLogicalConditions
26177
+ | RuleSetCondition[];
26178
+
26179
+ /**
26180
+ * Default `media` attribute (e.g. `"(min-width: 800px)"`).
26181
+ */
26182
+ media?: string;
26183
+
26184
+ /**
26185
+ * When true, emit `<link rel="prefetch">` for matching assets without an explicit hint comment.
26186
+ */
26187
+ prefetch?: boolean;
26188
+
26189
+ /**
26190
+ * When true, emit `<link rel="preload">` for matching assets without an explicit hint comment.
26191
+ */
26192
+ preload?: boolean;
26193
+
26194
+ /**
26195
+ * A condition matcher.
26196
+ */
26197
+ test?:
26198
+ | string
26199
+ | RegExp
26200
+ | ((value: string) => boolean)
26201
+ | RuleSetLogicalConditions
26202
+ | RuleSetCondition[];
26203
+
26204
+ /**
26205
+ * Default `type` attribute (MIME).
26206
+ */
26207
+ type?: string;
26208
+ }
25112
26209
  type Usage = string | true | TopLevelSymbol;
25113
26210
  type UsageStateType = 0 | 1 | 2 | 3 | 4;
25114
26211
  type UsedName = string | false | string[] | InlinedUsedName;
@@ -25852,6 +26949,7 @@ declare interface WebpackOptionsNormalized {
25852
26949
  | "umd2"
25853
26950
  | "jsonp"
25854
26951
  | "system"
26952
+ | "amd-async"
25855
26953
  | "promise"
25856
26954
  | "module-import"
25857
26955
  | "script"
@@ -26025,6 +27123,7 @@ type WebpackOptionsNormalizedWithDefaults = WebpackOptionsNormalized & {
26025
27123
  | "umd2"
26026
27124
  | "jsonp"
26027
27125
  | "system"
27126
+ | "amd-async"
26028
27127
  | "promise"
26029
27128
  | "module-import"
26030
27129
  | "script"
@@ -26290,12 +27389,15 @@ declare namespace exports {
26290
27389
  export namespace RuntimeGlobals {
26291
27390
  export let amdDefine: "__webpack_require__.amdD";
26292
27391
  export let amdOptions: "__webpack_require__.amdO";
27392
+ export let analyzableChunkImport: "__webpack_require__.ei";
26293
27393
  export let asyncModule: "__webpack_require__.a";
26294
27394
  export let asyncModuleDoneSymbol: "__webpack_require__.aD";
26295
27395
  export let asyncModuleExportSymbol: "__webpack_require__.aE";
27396
+ export let asyncModuleGenerator: "__webpack_require__.aG";
26296
27397
  export let baseURI: "__webpack_require__.b";
26297
27398
  export let chunkCallback: "webpackChunk";
26298
27399
  export let chunkName: "__webpack_require__.cn";
27400
+ export let commonJsWrap: "__webpack_require__.cjs";
26299
27401
  export let compatGetDefaultExport: "__webpack_require__.n";
26300
27402
  export let compileWasm: "__webpack_require__.vs";
26301
27403
  export let createFakeNamespaceObject: "__webpack_require__.t";
@@ -26323,6 +27425,7 @@ declare namespace exports {
26323
27425
  export let getFullHash: "__webpack_require__.h";
26324
27426
  export let getTrustedTypesPolicy: "__webpack_require__.tt";
26325
27427
  export let getUpdateManifestFilename: "__webpack_require__.hmrF";
27428
+ export let getWorkletBootstrap: "__webpack_require__.wb";
26326
27429
  export let global: "__webpack_require__.g";
26327
27430
  export let harmonyModuleDecorator: "__webpack_require__.hmd";
26328
27431
  export let hasCssModules: "has css modules";
@@ -26348,8 +27451,10 @@ declare namespace exports {
26348
27451
  export let moduleLoaded: "module.loaded";
26349
27452
  export let nodeModuleDecorator: "__webpack_require__.nmd";
26350
27453
  export let onChunksLoaded: "__webpack_require__.O";
27454
+ export let prefetchAsset: "__webpack_require__.PA";
26351
27455
  export let prefetchChunk: "__webpack_require__.E";
26352
27456
  export let prefetchChunkHandlers: "__webpack_require__.F";
27457
+ export let preloadAsset: "__webpack_require__.LA";
26353
27458
  export let preloadChunk: "__webpack_require__.G";
26354
27459
  export let preloadChunkHandlers: "__webpack_require__.H";
26355
27460
  export let publicPath: "__webpack_require__.p";
@@ -26362,6 +27467,7 @@ declare namespace exports {
26362
27467
  export let setAnonymousDefaultName: "__webpack_require__.dn";
26363
27468
  export let shareScopeMap: "__webpack_require__.S";
26364
27469
  export let startup: "__webpack_require__.x";
27470
+ export let startupAssetHints: "__webpack_require__.SAH";
26365
27471
  export let startupEntrypoint: "__webpack_require__.X";
26366
27472
  export let startupNoDefault: "__webpack_require__.x (no default handler)";
26367
27473
  export let startupOnlyAfter: "__webpack_require__.x (only after)";
@@ -26491,6 +27597,9 @@ declare namespace exports {
26491
27597
  export namespace css {
26492
27598
  export { CssModulesPlugin };
26493
27599
  }
27600
+ export namespace html {
27601
+ export { HtmlModulesPlugin };
27602
+ }
26494
27603
  export namespace library {
26495
27604
  export { AbstractLibraryPlugin, EnableLibraryPlugin };
26496
27605
  }
@@ -26747,7 +27856,11 @@ declare namespace exports {
26747
27856
  data: ExternalItemFunctionData,
26748
27857
  callback: (
26749
27858
  err?: null | Error,
26750
- result?: string | boolean | string[] | { [index: string]: any }
27859
+ result?:
27860
+ | string
27861
+ | boolean
27862
+ | string[]
27863
+ | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown)
26751
27864
  ) => void
26752
27865
  ) => void;
26753
27866
  export type ExternalItemFunctionDataGetResolve = (