webpack 5.108.3 → 5.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/lib/APIPlugin.js +48 -29
  2. package/lib/CacheFacade.js +8 -0
  3. package/lib/ChunkGroup.js +1 -0
  4. package/lib/CompatibilityPlugin.js +31 -29
  5. package/lib/Compilation.js +50 -8
  6. package/lib/ConstPlugin.js +11 -11
  7. package/lib/ContextModule.js +239 -6
  8. package/lib/ContextModuleFactory.js +139 -14
  9. package/lib/DefinePlugin.js +396 -101
  10. package/lib/Entrypoint.js +1 -1
  11. package/lib/ExportsInfoApiPlugin.js +2 -2
  12. package/lib/ExternalModule.js +107 -5
  13. package/lib/ExternalModuleFactoryPlugin.js +20 -1
  14. package/lib/FileSystemInfo.js +130 -74
  15. package/lib/FlagDependencyExportsPlugin.js +55 -8
  16. package/lib/HotModuleReplacementPlugin.js +18 -15
  17. package/lib/LazyBarrel.js +30 -3
  18. package/lib/Module.js +3 -0
  19. package/lib/ModuleFilenameHelpers.js +2 -2
  20. package/lib/ModuleTypeConstants.js +8 -1
  21. package/lib/MultiCompiler.js +13 -2
  22. package/lib/MultiWatching.js +1 -0
  23. package/lib/NodeStuffPlugin.js +51 -33
  24. package/lib/NormalModule.js +169 -405
  25. package/lib/NormalModuleFactory.js +76 -2
  26. package/lib/ProgressPlugin.js +211 -119
  27. package/lib/ProvidePlugin.js +2 -2
  28. package/lib/RuntimeGlobals.js +47 -0
  29. package/lib/RuntimePlugin.js +33 -0
  30. package/lib/RuntimeTemplate.js +304 -16
  31. package/lib/UseStrictPlugin.js +1 -1
  32. package/lib/WebpackIsIncludedPlugin.js +1 -1
  33. package/lib/WebpackOptionsApply.js +24 -19
  34. package/lib/asset/AssetGenerator.js +110 -28
  35. package/lib/asset/AssetModulesPlugin.js +92 -2
  36. package/lib/asset/WebManifestGenerator.js +164 -0
  37. package/lib/asset/WebManifestParser.js +130 -0
  38. package/lib/async-modules/AwaitDependenciesInitFragment.js +14 -4
  39. package/lib/async-modules/isGeneratorLowered.js +26 -0
  40. package/lib/cache/PackFileCacheStrategy.js +9 -3
  41. package/lib/config/browserslistTargetHandler.js +40 -0
  42. package/lib/config/defaults.js +222 -32
  43. package/lib/config/normalization.js +26 -0
  44. package/lib/config/target.js +9 -1
  45. package/lib/css/CssGenerator.js +73 -73
  46. package/lib/css/CssLoadingRuntimeModule.js +5 -1
  47. package/lib/css/CssModulesPlugin.js +92 -53
  48. package/lib/css/CssParser.js +843 -302
  49. package/lib/css/syntax.js +1219 -483
  50. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +6 -6
  51. package/lib/dependencies/AMDPlugin.js +2 -2
  52. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +13 -13
  53. package/lib/dependencies/CommonJsDependencyHelpers.js +39 -0
  54. package/lib/dependencies/CommonJsExportsDependency.js +47 -2
  55. package/lib/dependencies/CommonJsExportsParserPlugin.js +10 -10
  56. package/lib/dependencies/CommonJsImportsParserPlugin.js +18 -18
  57. package/lib/dependencies/CommonJsPlugin.js +2 -2
  58. package/lib/dependencies/CommonJsRequireDependency.js +26 -1
  59. package/lib/dependencies/CommonJsSelfReferenceDependency.js +32 -1
  60. package/lib/dependencies/ContextDependencyHelpers.js +3 -3
  61. package/lib/dependencies/CreateRequireParserPlugin.js +6 -6
  62. package/lib/dependencies/CssIcssExportDependency.js +190 -87
  63. package/lib/dependencies/CssUrlDependency.js +35 -4
  64. package/lib/dependencies/ExternalModuleInitFragmentDependency.js +2 -2
  65. package/lib/dependencies/HarmonyCompatibilityDependency.js +32 -14
  66. package/lib/dependencies/HarmonyDetectionParserPlugin.js +43 -13
  67. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +7 -19
  68. package/lib/dependencies/HarmonyImportDependency.js +12 -1
  69. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +34 -107
  70. package/lib/dependencies/HarmonyImportGuard.js +192 -20
  71. package/lib/dependencies/HarmonyModulesPlugin.js +6 -0
  72. package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
  73. package/lib/dependencies/HtmlEntryDependency.js +797 -172
  74. package/lib/dependencies/HtmlSourceDependency.js +26 -0
  75. package/lib/dependencies/ImportDependency.js +43 -1
  76. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +31 -18
  77. package/lib/dependencies/ImportMetaContextPlugin.js +38 -7
  78. package/lib/dependencies/ImportMetaGlobDependency.js +81 -0
  79. package/lib/dependencies/ImportMetaGlobDependencyParserPlugin.js +78 -0
  80. package/lib/dependencies/ImportMetaGlobHelpers.js +660 -0
  81. package/lib/dependencies/ImportMetaPlugin.js +532 -180
  82. package/lib/dependencies/ImportMetaResolveDependency.js +90 -0
  83. package/lib/dependencies/ImportParserPlugin.js +87 -26
  84. package/lib/dependencies/ImportPhase.js +10 -8
  85. package/lib/dependencies/LoaderPlugin.js +5 -1
  86. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  87. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +3 -6
  88. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +4 -11
  89. package/lib/dependencies/SystemPlugin.js +2 -4
  90. package/lib/dependencies/TopLevelAwaitDependency.js +93 -0
  91. package/lib/dependencies/URLDependency.js +141 -21
  92. package/lib/dependencies/{WorkerPlugin.js → WorkerAndWorkletPlugin.js} +324 -112
  93. package/lib/dependencies/WorkerDependency.js +86 -18
  94. package/lib/dependencies/WorkletDependency.js +278 -0
  95. package/lib/dll/DelegatedModuleFactoryPlugin.js +19 -0
  96. package/lib/errors/EnvironmentNotSupportAsyncWarning.js +1 -1
  97. package/lib/errors/LoaderLoadingError.js +20 -0
  98. package/lib/errors/ModuleParseError.js +39 -22
  99. package/lib/errors/NodeStuffInWebError.js +1 -1
  100. package/lib/esm/ModuleChunkFormatPlugin.js +47 -14
  101. package/lib/esm/ModuleChunkLoadingPlugin.js +8 -1
  102. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +29 -1
  103. package/lib/hmr/lazyCompilationBackend.js +32 -8
  104. package/lib/html/HtmlGenerator.js +940 -91
  105. package/lib/html/HtmlModule.js +3 -2
  106. package/lib/html/HtmlModulesPlugin.js +625 -170
  107. package/lib/html/HtmlParser.js +812 -340
  108. package/lib/html/favicon.svg +1 -0
  109. package/lib/html/syntax.js +2116 -834
  110. package/lib/ids/IdHelpers.js +1 -1
  111. package/lib/index.js +6 -0
  112. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -5
  113. package/lib/javascript/BasicEvaluatedExpression.js +366 -48
  114. package/lib/javascript/JavascriptGenerator.js +197 -49
  115. package/lib/javascript/JavascriptModulesPlugin.js +178 -24
  116. package/lib/javascript/JavascriptParser.js +711 -355
  117. package/lib/javascript/JavascriptParserHelpers.js +3 -6
  118. package/lib/javascript/syntax.js +4380 -0
  119. package/lib/library/ModuleLibraryPlugin.js +38 -1
  120. package/lib/loaders/LoaderRunner.js +714 -0
  121. package/lib/loaders/loadLoader.js +100 -0
  122. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +19 -0
  123. package/lib/node/ReadFileCompileWasmPlugin.js +14 -0
  124. package/lib/optimize/ConcatenatedModule.js +120 -16
  125. package/lib/optimize/FlagIncludedChunksPlugin.js +13 -3
  126. package/lib/optimize/InnerGraphPlugin.js +50 -30
  127. package/lib/optimize/ModuleConcatenationPlugin.js +69 -3
  128. package/lib/optimize/SideEffectsFlagPlugin.js +86 -43
  129. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +15 -0
  130. package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +24 -13
  131. package/lib/prefetch/ResourceHintPlugin.js +663 -0
  132. package/lib/prefetch/ResourceHintRuntimeModule.js +149 -0
  133. package/lib/prefetch/StartupAssetHintRuntimeModule.js +210 -0
  134. package/lib/prefetch/parseResourceHintOptions.js +103 -0
  135. package/lib/rules/RuleSetCompiler.js +114 -0
  136. package/lib/runtime/AsyncModuleGeneratorRuntimeModule.js +56 -0
  137. package/lib/runtime/AsyncModuleRuntimeModule.js +24 -8
  138. package/lib/runtime/AutoPublicPathRuntimeModule.js +7 -1
  139. package/lib/runtime/CommonJsWrapRuntimeModule.js +37 -0
  140. package/lib/runtime/GetWorkletBootstrapRuntimeModule.js +59 -0
  141. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +204 -8
  142. package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +4 -1
  143. package/lib/schemes/HttpUriPlugin.js +40 -1
  144. package/lib/schemes/VirtualUrlPlugin.js +1 -2
  145. package/lib/serialization/FileMiddleware.js +29 -3
  146. package/lib/stats/DefaultStatsFactoryPlugin.js +32 -3
  147. package/lib/stats/DefaultStatsPresetPlugin.js +2 -0
  148. package/lib/stats/DefaultStatsPrinterPlugin.js +12 -2
  149. package/lib/stats/StatsFactory.js +15 -8
  150. package/lib/url/URLParserPlugin.js +98 -19
  151. package/lib/util/AsyncQueue.js +122 -72
  152. package/lib/util/LocConverter.js +9 -8
  153. package/lib/util/SetHelpers.js +1 -1
  154. package/lib/util/SourceProcessor.js +41 -28
  155. package/lib/util/StackedMap.js +122 -48
  156. package/lib/util/binarySearchBounds.js +2 -2
  157. package/lib/util/concatenate.js +40 -14
  158. package/lib/util/createHooksRegistry.js +13 -5
  159. package/lib/util/dataURL.js +2 -2
  160. package/lib/util/deterministicGrouping.js +7 -5
  161. package/lib/util/formatSize.js +6 -2
  162. package/lib/util/globUtils.js +710 -0
  163. package/lib/util/identifier.js +23 -6
  164. package/lib/util/implicitTypeLoaderFallback.js +62 -0
  165. package/lib/util/internalSerializables.js +88 -71
  166. package/lib/util/magicComment.js +121 -25
  167. package/lib/util/numberHash.js +2 -2
  168. package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +24 -18
  169. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +33 -22
  170. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +79 -16
  171. package/lib/web/FetchCompileAsyncWasmPlugin.js +19 -0
  172. package/lib/web/FetchCompileWasmPlugin.js +14 -0
  173. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -0
  174. package/lib/webpack.js +65 -0
  175. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -0
  176. package/module.d.ts +21 -0
  177. package/package.json +14 -13
  178. package/schemas/WebpackOptions.check.js +1 -1
  179. package/schemas/WebpackOptions.json +759 -36
  180. package/schemas/plugins/HtmlParserOptions.check.js +1 -1
  181. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  182. package/schemas/plugins/ProgressPlugin.json +17 -1
  183. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  184. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  185. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  186. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  187. package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
  188. package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +1 -1
  189. package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
  190. package/schemas/plugins/css/CssParserOptions.check.js +1 -1
  191. package/types.d.ts +1300 -325
@@ -363,6 +363,17 @@
363
363
  "description": "Check if to be emitted file already exists and have the same content before writing to output filesystem.",
364
364
  "type": "boolean"
365
365
  },
366
+ "ConcatenateModulesOptions": {
367
+ "description": "Advanced options for module concatenation.",
368
+ "type": "object",
369
+ "additionalProperties": false,
370
+ "properties": {
371
+ "commonjs": {
372
+ "description": "Also concatenate CommonJS modules with statically analyzable exports. Defaults to 'true'.",
373
+ "type": "boolean"
374
+ }
375
+ }
376
+ },
366
377
  "Context": {
367
378
  "description": "The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.",
368
379
  "type": "string",
@@ -389,12 +400,21 @@
389
400
  "customIdents": {
390
401
  "$ref": "#/definitions/CssParserCustomIdents"
391
402
  },
403
+ "customMedia": {
404
+ "$ref": "#/definitions/CssParserCustomMedia"
405
+ },
406
+ "customSelectors": {
407
+ "$ref": "#/definitions/CssParserCustomSelectors"
408
+ },
392
409
  "dashedIdents": {
393
410
  "$ref": "#/definitions/CssParserDashedIdents"
394
411
  },
395
412
  "exportType": {
396
413
  "$ref": "#/definitions/CssParserExportType"
397
414
  },
415
+ "fontPreload": {
416
+ "$ref": "#/definitions/CssParserFontPreload"
417
+ },
398
418
  "function": {
399
419
  "$ref": "#/definitions/CssParserFunction"
400
420
  },
@@ -412,6 +432,9 @@
412
432
  },
413
433
  "url": {
414
434
  "$ref": "#/definitions/CssParserUrl"
435
+ },
436
+ "urlHints": {
437
+ "$ref": "#/definitions/UrlHints"
415
438
  }
416
439
  }
417
440
  },
@@ -533,12 +556,21 @@
533
556
  "customIdents": {
534
557
  "$ref": "#/definitions/CssParserCustomIdents"
535
558
  },
559
+ "customMedia": {
560
+ "$ref": "#/definitions/CssParserCustomMedia"
561
+ },
562
+ "customSelectors": {
563
+ "$ref": "#/definitions/CssParserCustomSelectors"
564
+ },
536
565
  "dashedIdents": {
537
566
  "$ref": "#/definitions/CssParserDashedIdents"
538
567
  },
539
568
  "exportType": {
540
569
  "$ref": "#/definitions/CssParserExportType"
541
570
  },
571
+ "fontPreload": {
572
+ "$ref": "#/definitions/CssParserFontPreload"
573
+ },
542
574
  "function": {
543
575
  "$ref": "#/definitions/CssParserFunction"
544
576
  },
@@ -553,6 +585,9 @@
553
585
  },
554
586
  "url": {
555
587
  "$ref": "#/definitions/CssParserUrl"
588
+ },
589
+ "urlHints": {
590
+ "$ref": "#/definitions/UrlHints"
556
591
  }
557
592
  }
558
593
  },
@@ -572,6 +607,14 @@
572
607
  "description": "Enable/disable renaming of custom identifiers.",
573
608
  "type": "boolean"
574
609
  },
610
+ "CssParserCustomMedia": {
611
+ "description": "Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution).",
612
+ "type": "boolean"
613
+ },
614
+ "CssParserCustomSelectors": {
615
+ "description": "Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`).",
616
+ "type": "boolean"
617
+ },
575
618
  "CssParserDashedIdents": {
576
619
  "description": "Enable/disable renaming of dashed identifiers, e. g. custom properties.",
577
620
  "type": "boolean"
@@ -580,6 +623,10 @@
580
623
  "description": "Configure how CSS content is exported as default.",
581
624
  "enum": ["link", "text", "css-style-sheet", "style"]
582
625
  },
626
+ "CssParserFontPreload": {
627
+ "description": "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.",
628
+ "type": "boolean"
629
+ },
583
630
  "CssParserFunction": {
584
631
  "description": "Enable/disable renaming of `@function` names.",
585
632
  "type": "boolean"
@@ -604,9 +651,18 @@
604
651
  "as": {
605
652
  "$ref": "#/definitions/CssParserAs"
606
653
  },
654
+ "customMedia": {
655
+ "$ref": "#/definitions/CssParserCustomMedia"
656
+ },
657
+ "customSelectors": {
658
+ "$ref": "#/definitions/CssParserCustomSelectors"
659
+ },
607
660
  "exportType": {
608
661
  "$ref": "#/definitions/CssParserExportType"
609
662
  },
663
+ "fontPreload": {
664
+ "$ref": "#/definitions/CssParserFontPreload"
665
+ },
610
666
  "import": {
611
667
  "$ref": "#/definitions/CssParserImport"
612
668
  },
@@ -615,6 +671,9 @@
615
671
  },
616
672
  "url": {
617
673
  "$ref": "#/definitions/CssParserUrl"
674
+ },
675
+ "urlHints": {
676
+ "$ref": "#/definitions/UrlHints"
618
677
  }
619
678
  }
620
679
  },
@@ -1089,6 +1148,10 @@
1089
1148
  "description": "The environment supports 'for of' iteration ('for (const x of array) { ... }').",
1090
1149
  "type": "boolean"
1091
1150
  },
1151
+ "generator": {
1152
+ "description": "The environment supports generator functions and yield ('function* () { yield ... }').",
1153
+ "type": "boolean"
1154
+ },
1092
1155
  "globalThis": {
1093
1156
  "description": "The environment supports 'globalThis'.",
1094
1157
  "type": "boolean"
@@ -1117,6 +1180,10 @@
1117
1180
  "description": "The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').",
1118
1181
  "type": "boolean"
1119
1182
  },
1183
+ "modulePreload": {
1184
+ "description": "The environment supports `<link rel=\"modulepreload\">` to preload EcmaScript modules.",
1185
+ "type": "boolean"
1186
+ },
1120
1187
  "nodeBuiltinModuleGetter": {
1121
1188
  "description": "The environment supports `process.getBuiltinModule()` to synchronously load Node.js core modules.",
1122
1189
  "type": "boolean"
@@ -1149,8 +1216,17 @@
1149
1216
  "additionalProperties": true,
1150
1217
  "properties": {
1151
1218
  "asyncWebAssembly": {
1152
- "description": "Support WebAssembly as asynchronous EcmaScript Module.",
1153
- "type": "boolean",
1219
+ "description": "Support WebAssembly as asynchronous EcmaScript Module. `\"auto\"` (the default) enables it unless a loader is registered for WebAssembly files.",
1220
+ "anyOf": [
1221
+ {
1222
+ "description": "Enable the built-in async WebAssembly support only when no loader is registered for WebAssembly files.",
1223
+ "enum": ["auto"]
1224
+ },
1225
+ {
1226
+ "description": "Enable/disable the built-in async WebAssembly support.",
1227
+ "type": "boolean"
1228
+ }
1229
+ ],
1154
1230
  "experimental": true
1155
1231
  },
1156
1232
  "backCompat": {
@@ -1176,8 +1252,17 @@
1176
1252
  "experimental": true
1177
1253
  },
1178
1254
  "css": {
1179
- "description": "Enable css support.",
1180
- "type": "boolean",
1255
+ "description": "Enable css support. `\"auto\"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.",
1256
+ "anyOf": [
1257
+ {
1258
+ "description": "Enable the built-in CSS support only when no loader is registered for CSS files.",
1259
+ "enum": ["auto"]
1260
+ },
1261
+ {
1262
+ "description": "Enable/disable the built-in CSS support.",
1263
+ "type": "boolean"
1264
+ }
1265
+ ],
1181
1266
  "experimental": true
1182
1267
  },
1183
1268
  "deferImport": {
@@ -1191,8 +1276,17 @@
1191
1276
  "experimental": true
1192
1277
  },
1193
1278
  "html": {
1194
- "description": "Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.",
1195
- "type": "boolean",
1279
+ "description": "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.",
1280
+ "anyOf": [
1281
+ {
1282
+ "description": "Enable the built-in HTML support only when no loader is registered for HTML files.",
1283
+ "enum": ["auto"]
1284
+ },
1285
+ {
1286
+ "description": "Enable/disable the built-in HTML support.",
1287
+ "type": "boolean"
1288
+ }
1289
+ ],
1196
1290
  "experimental": true
1197
1291
  },
1198
1292
  "lazyCompilation": {
@@ -1223,8 +1317,17 @@
1223
1317
  "experimental": true
1224
1318
  },
1225
1319
  "typescript": {
1226
- "description": "Enable typescript support.",
1227
- "type": "boolean",
1320
+ "description": "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.",
1321
+ "anyOf": [
1322
+ {
1323
+ "description": "Enable the built-in TypeScript support only when Node.js supports it (>= 22.6) and no loader is registered for TypeScript files.",
1324
+ "enum": ["auto"]
1325
+ },
1326
+ {
1327
+ "description": "Enable/disable the built-in TypeScript support.",
1328
+ "type": "boolean"
1329
+ }
1330
+ ],
1228
1331
  "experimental": true
1229
1332
  }
1230
1333
  }
@@ -1235,8 +1338,17 @@
1235
1338
  "additionalProperties": false,
1236
1339
  "properties": {
1237
1340
  "asyncWebAssembly": {
1238
- "description": "Support WebAssembly as asynchronous EcmaScript Module.",
1239
- "type": "boolean",
1341
+ "description": "Support WebAssembly as asynchronous EcmaScript Module. `\"auto\"` (the default) enables it unless a loader is registered for WebAssembly files.",
1342
+ "anyOf": [
1343
+ {
1344
+ "description": "Enable the built-in async WebAssembly support only when no loader is registered for WebAssembly files.",
1345
+ "enum": ["auto"]
1346
+ },
1347
+ {
1348
+ "description": "Enable/disable the built-in async WebAssembly support.",
1349
+ "type": "boolean"
1350
+ }
1351
+ ],
1240
1352
  "experimental": true
1241
1353
  },
1242
1354
  "backCompat": {
@@ -1259,8 +1371,17 @@
1259
1371
  "experimental": true
1260
1372
  },
1261
1373
  "css": {
1262
- "description": "Enable css support.",
1263
- "type": "boolean",
1374
+ "description": "Enable css support. `\"auto\"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.",
1375
+ "anyOf": [
1376
+ {
1377
+ "description": "Enable the built-in CSS support only when no loader is registered for CSS files.",
1378
+ "enum": ["auto"]
1379
+ },
1380
+ {
1381
+ "description": "Enable/disable the built-in CSS support.",
1382
+ "type": "boolean"
1383
+ }
1384
+ ],
1264
1385
  "experimental": true
1265
1386
  },
1266
1387
  "deferImport": {
@@ -1274,8 +1395,17 @@
1274
1395
  "experimental": true
1275
1396
  },
1276
1397
  "html": {
1277
- "description": "Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.",
1278
- "type": "boolean",
1398
+ "description": "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.",
1399
+ "anyOf": [
1400
+ {
1401
+ "description": "Enable the built-in HTML support only when no loader is registered for HTML files.",
1402
+ "enum": ["auto"]
1403
+ },
1404
+ {
1405
+ "description": "Enable/disable the built-in HTML support.",
1406
+ "type": "boolean"
1407
+ }
1408
+ ],
1279
1409
  "experimental": true
1280
1410
  },
1281
1411
  "lazyCompilation": {
@@ -1306,8 +1436,17 @@
1306
1436
  "experimental": true
1307
1437
  },
1308
1438
  "typescript": {
1309
- "description": "Enable typescript support.",
1310
- "type": "boolean",
1439
+ "description": "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.",
1440
+ "anyOf": [
1441
+ {
1442
+ "description": "Enable the built-in TypeScript support only when Node.js supports it (>= 22.6) and no loader is registered for TypeScript files.",
1443
+ "enum": ["auto"]
1444
+ },
1445
+ {
1446
+ "description": "Enable/disable the built-in TypeScript support.",
1447
+ "type": "boolean"
1448
+ }
1449
+ ],
1311
1450
  "experimental": true
1312
1451
  }
1313
1452
  }
@@ -1392,6 +1531,10 @@
1392
1531
  "instanceof": "Function",
1393
1532
  "tsType": "import(\"../lib/ExternalModuleFactoryPlugin\").ExternalItemFunctionPromise"
1394
1533
  },
1534
+ "ExternalItemInterop": {
1535
+ "description": "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`.",
1536
+ "enum": ["default", "esModule"]
1537
+ },
1395
1538
  "ExternalItemValue": {
1396
1539
  "description": "The dependency used for the external.",
1397
1540
  "anyOf": [
@@ -1412,7 +1555,30 @@
1412
1555
  "type": "string"
1413
1556
  },
1414
1557
  {
1415
- "type": "object"
1558
+ "description": "The target of the external with a type, optionally with an 'interop' hint describing how its exports interoperate with ES module imports.",
1559
+ "type": "object",
1560
+ "additionalProperties": {
1561
+ "description": "The target of the external for a specific external type.",
1562
+ "anyOf": [
1563
+ {
1564
+ "type": "array",
1565
+ "items": {
1566
+ "description": "A part of the target of the external.",
1567
+ "type": "string",
1568
+ "minLength": 1
1569
+ }
1570
+ },
1571
+ {
1572
+ "description": "The target of the external.",
1573
+ "type": "string"
1574
+ }
1575
+ ]
1576
+ },
1577
+ "properties": {
1578
+ "interop": {
1579
+ "$ref": "#/definitions/ExternalItemInterop"
1580
+ }
1581
+ }
1416
1582
  }
1417
1583
  ]
1418
1584
  },
@@ -1493,6 +1659,7 @@
1493
1659
  "commonjs-static",
1494
1660
  "amd",
1495
1661
  "amd-require",
1662
+ "amd-async",
1496
1663
  "umd",
1497
1664
  "umd2",
1498
1665
  "jsonp",
@@ -1551,7 +1718,7 @@
1551
1718
  },
1552
1719
  "compression": {
1553
1720
  "description": "Compression type used for the cache files.",
1554
- "enum": [false, "gzip", "brotli"]
1721
+ "enum": [false, "gzip", "brotli", "zstd"]
1555
1722
  },
1556
1723
  "hashAlgorithm": {
1557
1724
  "description": "Algorithm used for generation the hash (see node.js crypto package).",
@@ -1828,6 +1995,51 @@
1828
1995
  }
1829
1996
  ]
1830
1997
  },
1998
+ "HtmlFaviconIcon": {
1999
+ "description": "A single favicon `<link>`: either a path string (used as the icon `href`) or an object with the icon `href` plus extra link attributes (`sizes`, `media`, `color`, `type`, `crossorigin`).",
2000
+ "anyOf": [
2001
+ {
2002
+ "type": "string",
2003
+ "minLength": 1
2004
+ },
2005
+ {
2006
+ "type": "object",
2007
+ "additionalProperties": false,
2008
+ "properties": {
2009
+ "color": {
2010
+ "description": "Value for the `color` attribute (used by `rel=\"mask-icon\"`).",
2011
+ "type": "string",
2012
+ "minLength": 1
2013
+ },
2014
+ "crossorigin": {
2015
+ "description": "Value for the `crossorigin` attribute.",
2016
+ "enum": ["anonymous", "use-credentials"]
2017
+ },
2018
+ "href": {
2019
+ "description": "Path to the icon file, emitted as a hashed asset.",
2020
+ "type": "string",
2021
+ "minLength": 1
2022
+ },
2023
+ "media": {
2024
+ "description": "Value for the `media` attribute (e.g. `\"(prefers-color-scheme: dark)\"`).",
2025
+ "type": "string",
2026
+ "minLength": 1
2027
+ },
2028
+ "sizes": {
2029
+ "description": "Value for the `sizes` attribute (e.g. `\"180x180\"` or `\"any\"`).",
2030
+ "type": "string",
2031
+ "minLength": 1
2032
+ },
2033
+ "type": {
2034
+ "description": "Value for the `type` attribute; inferred from the file extension when omitted.",
2035
+ "type": "string",
2036
+ "minLength": 1
2037
+ }
2038
+ },
2039
+ "required": ["href"]
2040
+ }
2041
+ ]
2042
+ },
1831
2043
  "HtmlFilename": {
1832
2044
  "description": "Specifies the filename template of output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.",
1833
2045
  "oneOf": [
@@ -1854,11 +2066,25 @@
1854
2066
  }
1855
2067
  }
1856
2068
  },
2069
+ "HtmlParserAs": {
2070
+ "description": "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.",
2071
+ "anyOf": [
2072
+ {
2073
+ "enum": ["document"]
2074
+ },
2075
+ {
2076
+ "type": "string"
2077
+ }
2078
+ ]
2079
+ },
1857
2080
  "HtmlParserOptions": {
1858
2081
  "description": "Parser options for html modules.",
1859
2082
  "type": "object",
1860
2083
  "additionalProperties": false,
1861
2084
  "properties": {
2085
+ "as": {
2086
+ "$ref": "#/definitions/HtmlParserAs"
2087
+ },
1862
2088
  "sources": {
1863
2089
  "description": "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.",
1864
2090
  "anyOf": [
@@ -1891,17 +2117,25 @@
1891
2117
  "minLength": 1
1892
2118
  },
1893
2119
  "type": {
1894
- "description": "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.",
1895
- "enum": [
1896
- "src",
1897
- "srcset",
1898
- "css-url",
1899
- "script",
1900
- "script-module",
1901
- "stylesheet",
1902
- "stylesheet-style",
1903
- "stylesheet-style-attribute",
1904
- "srcdoc"
2120
+ "description": "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.",
2121
+ "anyOf": [
2122
+ {
2123
+ "enum": [
2124
+ "src",
2125
+ "srcset",
2126
+ "css-url",
2127
+ "script",
2128
+ "script-module",
2129
+ "stylesheet",
2130
+ "html",
2131
+ "stylesheet-style",
2132
+ "stylesheet-style-attribute",
2133
+ "srcdoc"
2134
+ ]
2135
+ },
2136
+ {
2137
+ "enum": [false]
2138
+ }
1905
2139
  ]
1906
2140
  }
1907
2141
  },
@@ -1920,9 +2154,75 @@
1920
2154
  "description": "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.",
1921
2155
  "instanceof": "Function",
1922
2156
  "tsType": "import('../lib/html/HtmlParser').HtmlTemplateFunction"
2157
+ },
2158
+ "urlHints": {
2159
+ "$ref": "#/definitions/UrlHints"
1923
2160
  }
1924
2161
  }
1925
2162
  },
2163
+ "HtmlResourceHint": {
2164
+ "description": "A custom resource-hint `<link>` for `output.html.resourceHints`. Exactly one of `href` / `chunk` / `entry` names the target.",
2165
+ "type": "object",
2166
+ "additionalProperties": false,
2167
+ "properties": {
2168
+ "as": {
2169
+ "description": "The `as` attribute (`script`, `style`, `font`, …); defaults to `script` for chunk/entry references.",
2170
+ "type": "string"
2171
+ },
2172
+ "chunk": {
2173
+ "description": "Name of a chunk to hint; its emitted URL is resolved automatically.",
2174
+ "type": "string",
2175
+ "minLength": 1
2176
+ },
2177
+ "crossorigin": {
2178
+ "description": "The CORS mode; `true` maps to `anonymous`.",
2179
+ "anyOf": [
2180
+ {
2181
+ "enum": ["anonymous", "use-credentials"]
2182
+ },
2183
+ {
2184
+ "type": "boolean"
2185
+ }
2186
+ ]
2187
+ },
2188
+ "entry": {
2189
+ "description": "Name of an entrypoint to hint; expands to one hint per initial chunk.",
2190
+ "type": "string",
2191
+ "minLength": 1
2192
+ },
2193
+ "fetchPriority": {
2194
+ "description": "The `fetchpriority` attribute. Emitted on `preload` / `modulepreload` and on `prefetch` (the spec now permits it there).",
2195
+ "enum": ["low", "high", "auto"]
2196
+ },
2197
+ "href": {
2198
+ "description": "A literal URL used verbatim (external resource, `preconnect` origin, or an already-hashed asset).",
2199
+ "type": "string"
2200
+ },
2201
+ "integrity": {
2202
+ "description": "Subresource Integrity for a chunk/entry reference. Follows `output.html.integrity` by default; set `false` to opt this hint out.",
2203
+ "type": "boolean"
2204
+ },
2205
+ "media": {
2206
+ "description": "The `media` attribute.",
2207
+ "type": "string"
2208
+ },
2209
+ "rel": {
2210
+ "description": "The `rel` of the resource hint.",
2211
+ "enum": [
2212
+ "preload",
2213
+ "prefetch",
2214
+ "modulepreload",
2215
+ "preconnect",
2216
+ "dns-prefetch"
2217
+ ]
2218
+ },
2219
+ "type": {
2220
+ "description": "The `type` attribute (MIME type).",
2221
+ "type": "string"
2222
+ }
2223
+ },
2224
+ "required": ["rel"]
2225
+ },
1926
2226
  "HttpUriAllowedUris": {
1927
2227
  "description": "List of allowed URIs for building http resources.",
1928
2228
  "cli": {
@@ -2059,6 +2359,52 @@
2059
2359
  "description": "The name of the native import.meta object (can be exchanged for a polyfill).",
2060
2360
  "type": "string"
2061
2361
  },
2362
+ "ImportMetaParserOptions": {
2363
+ "description": "Enable/disable evaluating import.meta fields. Omitted fields are enabled and unknown fields are preserved. Custom fields are allowed.",
2364
+ "type": "object",
2365
+ "additionalProperties": {
2366
+ "description": "Enable/disable evaluating a custom import.meta field.",
2367
+ "type": "boolean"
2368
+ },
2369
+ "properties": {
2370
+ "dirname": {
2371
+ "description": "Enable/disable evaluating import.meta.dirname.",
2372
+ "type": "boolean"
2373
+ },
2374
+ "env": {
2375
+ "description": "Enable/disable evaluating import.meta.env.",
2376
+ "type": "boolean"
2377
+ },
2378
+ "filename": {
2379
+ "description": "Enable/disable evaluating import.meta.filename.",
2380
+ "type": "boolean"
2381
+ },
2382
+ "main": {
2383
+ "description": "Enable/disable evaluating import.meta.main.",
2384
+ "type": "boolean"
2385
+ },
2386
+ "resolve": {
2387
+ "description": "Enable/disable evaluating import.meta.resolve.",
2388
+ "type": "boolean"
2389
+ },
2390
+ "url": {
2391
+ "description": "Enable/disable evaluating import.meta.url.",
2392
+ "type": "boolean"
2393
+ },
2394
+ "webpack": {
2395
+ "description": "Enable/disable evaluating import.meta.webpack.",
2396
+ "type": "boolean"
2397
+ },
2398
+ "webpackContext": {
2399
+ "description": "Enable/disable evaluating import.meta.webpackContext.",
2400
+ "type": "boolean"
2401
+ },
2402
+ "webpackHot": {
2403
+ "description": "Enable/disable evaluating import.meta.webpackHot.",
2404
+ "type": "boolean"
2405
+ }
2406
+ }
2407
+ },
2062
2408
  "InfrastructureLogging": {
2063
2409
  "description": "Options for infrastructure level logging.",
2064
2410
  "type": "object",
@@ -2092,6 +2438,17 @@
2092
2438
  "description": "Log level.",
2093
2439
  "enum": ["none", "error", "warn", "info", "log", "verbose"]
2094
2440
  },
2441
+ "progress": {
2442
+ "description": "Show build progress. `\"auto\"` shows it only for interactive terminals. This option is only used when no custom console is provided.",
2443
+ "anyOf": [
2444
+ {
2445
+ "enum": ["auto"]
2446
+ },
2447
+ {
2448
+ "type": "boolean"
2449
+ }
2450
+ ]
2451
+ },
2095
2452
  "stream": {
2096
2453
  "description": "Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.",
2097
2454
  "tsType": "NodeJS.WritableStream & { isTTY?: boolean, columns?: number, rows?: number }"
@@ -2137,6 +2494,17 @@
2137
2494
  "description": "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.",
2138
2495
  "type": "boolean"
2139
2496
  },
2497
+ "dynamicImportCssPreload": {
2498
+ "description": "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.",
2499
+ "anyOf": [
2500
+ {
2501
+ "type": "number"
2502
+ },
2503
+ {
2504
+ "type": "boolean"
2505
+ }
2506
+ ]
2507
+ },
2140
2508
  "dynamicImportFetchPriority": {
2141
2509
  "description": "Specifies global fetchPriority for dynamic import.",
2142
2510
  "enum": ["low", "high", "auto", false]
@@ -2212,7 +2580,7 @@
2212
2580
  "enum": ["error", "warn", "auto", false]
2213
2581
  },
2214
2582
  "importMeta": {
2215
- "description": "Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.",
2583
+ "description": "Enable/disable evaluating import.meta. Set to 'preserve-unknown' or an object to preserve unknown properties for runtime evaluation.",
2216
2584
  "anyOf": [
2217
2585
  {
2218
2586
  "type": "boolean"
@@ -2220,12 +2588,16 @@
2220
2588
  {
2221
2589
  "type": "string",
2222
2590
  "enum": ["preserve-unknown"]
2591
+ },
2592
+ {
2593
+ "$ref": "#/definitions/ImportMetaParserOptions"
2223
2594
  }
2224
2595
  ]
2225
2596
  },
2226
2597
  "importMetaContext": {
2227
- "description": "Enable/disable evaluating import.meta.webpackContext.",
2228
- "type": "boolean"
2598
+ "description": "Deprecated in favor of \"importMeta\" object option with a \"webpackContext\" field. Enable/disable evaluating import.meta.webpackContext.",
2599
+ "type": "boolean",
2600
+ "deprecated": true
2229
2601
  },
2230
2602
  "node": {
2231
2603
  "$ref": "#/definitions/Node"
@@ -2277,6 +2649,10 @@
2277
2649
  "type": "boolean",
2278
2650
  "deprecated": true
2279
2651
  },
2652
+ "strictModeViolations": {
2653
+ "description": "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.",
2654
+ "enum": ["error", "warn", false]
2655
+ },
2280
2656
  "strictThisContextOnImports": {
2281
2657
  "description": "Handle the this context correctly according to the spec for namespace objects.",
2282
2658
  "type": "boolean"
@@ -2325,6 +2701,9 @@
2325
2701
  }
2326
2702
  ]
2327
2703
  },
2704
+ "urlHints": {
2705
+ "$ref": "#/definitions/UrlHints"
2706
+ },
2328
2707
  "worker": {
2329
2708
  "description": "Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().",
2330
2709
  "anyOf": [
@@ -2341,6 +2720,22 @@
2341
2720
  }
2342
2721
  ]
2343
2722
  },
2723
+ "worklet": {
2724
+ "description": "Disable or configure parsing of Worklet syntax like context.audioWorklet.addModule() or CSS.paintWorklet.addModule().",
2725
+ "anyOf": [
2726
+ {
2727
+ "type": "array",
2728
+ "items": {
2729
+ "description": "Specify a syntax that should be parsed as Worklet reference. '*context.audioWorklet.addModule()' handles 'context.audioWorklet.addModule()', 'abc()' handles 'abc()', and combinations are also possible.",
2730
+ "type": "string",
2731
+ "minLength": 1
2732
+ }
2733
+ },
2734
+ {
2735
+ "type": "boolean"
2736
+ }
2737
+ ]
2738
+ },
2344
2739
  "wrappedContextCritical": {
2345
2740
  "description": "Enable warnings for partial dynamic dependencies.",
2346
2741
  "type": "boolean"
@@ -3019,8 +3414,15 @@
3019
3414
  ]
3020
3415
  },
3021
3416
  "concatenateModules": {
3022
- "description": "Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.",
3023
- "type": "boolean"
3417
+ "description": "Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. An options object implies 'true'.",
3418
+ "anyOf": [
3419
+ {
3420
+ "type": "boolean"
3421
+ },
3422
+ {
3423
+ "$ref": "#/definitions/ConcatenateModulesOptions"
3424
+ }
3425
+ ]
3024
3426
  },
3025
3427
  "emitOnErrors": {
3026
3428
  "description": "Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.",
@@ -3191,8 +3593,15 @@
3191
3593
  ]
3192
3594
  },
3193
3595
  "concatenateModules": {
3194
- "description": "Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.",
3195
- "type": "boolean"
3596
+ "description": "Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. An options object implies 'true'.",
3597
+ "anyOf": [
3598
+ {
3599
+ "type": "boolean"
3600
+ },
3601
+ {
3602
+ "$ref": "#/definitions/ConcatenateModulesOptions"
3603
+ }
3604
+ ]
3196
3605
  },
3197
3606
  "emitOnErrors": {
3198
3607
  "description": "Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.",
@@ -4034,6 +4443,9 @@
4034
4443
  "publicPath": {
4035
4444
  "$ref": "#/definitions/PublicPath"
4036
4445
  },
4446
+ "resourceHints": {
4447
+ "$ref": "#/definitions/ResourceHints"
4448
+ },
4037
4449
  "scriptType": {
4038
4450
  "$ref": "#/definitions/ScriptType"
4039
4451
  },
@@ -4084,6 +4496,9 @@
4084
4496
  "wasmLoading": {
4085
4497
  "$ref": "#/definitions/WasmLoading"
4086
4498
  },
4499
+ "wasmStreamingFallback": {
4500
+ "$ref": "#/definitions/WasmStreamingFallback"
4501
+ },
4087
4502
  "webassemblyModuleFilename": {
4088
4503
  "$ref": "#/definitions/WebassemblyModuleFilename"
4089
4504
  },
@@ -4117,9 +4532,194 @@
4117
4532
  "type": "object",
4118
4533
  "additionalProperties": false,
4119
4534
  "properties": {
4535
+ "base": {
4536
+ "description": "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.",
4537
+ "anyOf": [
4538
+ {
4539
+ "type": "string",
4540
+ "minLength": 1
4541
+ },
4542
+ {
4543
+ "type": "object",
4544
+ "additionalProperties": false,
4545
+ "properties": {
4546
+ "href": {
4547
+ "description": "Value for the `href` attribute of the `<base>` element.",
4548
+ "type": "string",
4549
+ "minLength": 1
4550
+ },
4551
+ "target": {
4552
+ "description": "Value for the `target` attribute of the `<base>` element (e.g. `\"_blank\"`).",
4553
+ "type": "string",
4554
+ "minLength": 1
4555
+ }
4556
+ },
4557
+ "required": ["href"]
4558
+ }
4559
+ ]
4560
+ },
4561
+ "csp": {
4562
+ "description": "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.",
4563
+ "anyOf": [
4564
+ {
4565
+ "type": "boolean"
4566
+ },
4567
+ {
4568
+ "type": "object",
4569
+ "additionalProperties": false,
4570
+ "properties": {
4571
+ "hashFunction": {
4572
+ "description": "Hash algorithm used for inline `<script>`/`<style>` sources.",
4573
+ "enum": ["sha256", "sha384", "sha512"]
4574
+ },
4575
+ "nonce": {
4576
+ "description": "Placeholder nonce added to injected `<script>`/`<style>` tags and as a `'nonce-…'` source; rewrite it per request server-side.",
4577
+ "type": "string",
4578
+ "minLength": 1
4579
+ },
4580
+ "policy": {
4581
+ "description": "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`.",
4582
+ "type": "object",
4583
+ "additionalProperties": {
4584
+ "description": "A CSP source expression, or a list of them, for this directive.",
4585
+ "anyOf": [
4586
+ {
4587
+ "type": "array",
4588
+ "items": {
4589
+ "description": "A CSP source expression (e.g. `\"'self'\"`, `\"https://cdn.example.com\"`).",
4590
+ "type": "string"
4591
+ }
4592
+ },
4593
+ {
4594
+ "type": "string"
4595
+ }
4596
+ ]
4597
+ }
4598
+ }
4599
+ }
4600
+ }
4601
+ ]
4602
+ },
4603
+ "favicon": {
4604
+ "description": "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.",
4605
+ "anyOf": [
4606
+ {
4607
+ "type": "boolean"
4608
+ },
4609
+ {
4610
+ "type": "string",
4611
+ "minLength": 1
4612
+ },
4613
+ {
4614
+ "type": "object",
4615
+ "additionalProperties": {
4616
+ "description": "Icon(s) for a single `<link rel>`: one icon or an array of icons.",
4617
+ "anyOf": [
4618
+ {
4619
+ "type": "array",
4620
+ "items": {
4621
+ "$ref": "#/definitions/HtmlFaviconIcon"
4622
+ },
4623
+ "minItems": 1
4624
+ },
4625
+ {
4626
+ "$ref": "#/definitions/HtmlFaviconIcon"
4627
+ }
4628
+ ]
4629
+ }
4630
+ },
4631
+ {
4632
+ "instanceof": "Function",
4633
+ "tsType": "((name: string) => boolean | string | { [rel: string]: HtmlFaviconIcon | HtmlFaviconIcon[] })"
4634
+ }
4635
+ ]
4636
+ },
4637
+ "inject": {
4638
+ "description": "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).",
4639
+ "anyOf": [
4640
+ {
4641
+ "enum": ["body", "head"]
4642
+ },
4643
+ {
4644
+ "type": "boolean",
4645
+ "enum": [false]
4646
+ }
4647
+ ]
4648
+ },
4649
+ "inline": {
4650
+ "description": "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.",
4651
+ "anyOf": [
4652
+ {
4653
+ "type": "array",
4654
+ "items": {
4655
+ "description": "A regular expression matched against the chunk name; matching chunks are inlined.",
4656
+ "instanceof": "RegExp",
4657
+ "tsType": "RegExp"
4658
+ }
4659
+ },
4660
+ {
4661
+ "enum": ["script", "style"]
4662
+ },
4663
+ {
4664
+ "type": "boolean"
4665
+ }
4666
+ ]
4667
+ },
4668
+ "integrity": {
4669
+ "description": "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.",
4670
+ "anyOf": [
4671
+ {
4672
+ "type": "array",
4673
+ "items": {
4674
+ "description": "A hash algorithm name passed to Node.js `crypto.createHash` (e.g. 'sha256', 'sha384', 'sha512').",
4675
+ "type": "string",
4676
+ "minLength": 1
4677
+ }
4678
+ },
4679
+ {
4680
+ "type": "boolean"
4681
+ },
4682
+ {
4683
+ "instanceof": "Function",
4684
+ "tsType": "((asset: { chunk: import('../lib/Chunk'), filename: string }) => string[] | false)"
4685
+ }
4686
+ ]
4687
+ },
4688
+ "manifest": {
4689
+ "description": "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.",
4690
+ "anyOf": [
4691
+ {
4692
+ "enum": [false]
4693
+ },
4694
+ {
4695
+ "type": "string",
4696
+ "minLength": 1
4697
+ },
4698
+ {
4699
+ "type": "object",
4700
+ "additionalProperties": true
4701
+ },
4702
+ {
4703
+ "instanceof": "Function",
4704
+ "tsType": "((name: string) => false | string | { [key: string]: EXPECTED_ANY })"
4705
+ }
4706
+ ]
4707
+ },
4708
+ "meta": {
4709
+ "description": "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.",
4710
+ "type": "object",
4711
+ "additionalProperties": {
4712
+ "description": "Content string for the meta tag.",
4713
+ "type": "string"
4714
+ }
4715
+ },
4120
4716
  "scriptLoading": {
4121
4717
  "description": "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.",
4122
4718
  "enum": ["auto", "blocking", "defer"]
4719
+ },
4720
+ "title": {
4721
+ "description": "Sets the `<title>` of the generated HTML page. Skipped if the HTML already contains a `<title>` element.",
4722
+ "type": "string"
4123
4723
  }
4124
4724
  }
4125
4725
  },
@@ -4257,6 +4857,9 @@
4257
4857
  "publicPath": {
4258
4858
  "$ref": "#/definitions/PublicPath"
4259
4859
  },
4860
+ "resourceHints": {
4861
+ "$ref": "#/definitions/ResourceHintsOptions"
4862
+ },
4260
4863
  "scriptType": {
4261
4864
  "$ref": "#/definitions/ScriptType"
4262
4865
  },
@@ -4284,6 +4887,9 @@
4284
4887
  "wasmLoading": {
4285
4888
  "$ref": "#/definitions/WasmLoading"
4286
4889
  },
4890
+ "wasmStreamingFallback": {
4891
+ "$ref": "#/definitions/WasmStreamingFallback"
4892
+ },
4287
4893
  "webassemblyModuleFilename": {
4288
4894
  "$ref": "#/definitions/WebassemblyModuleFilename"
4289
4895
  },
@@ -4926,6 +5532,68 @@
4926
5532
  }
4927
5533
  ]
4928
5534
  },
5535
+ "ResourceHints": {
5536
+ "description": "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.",
5537
+ "anyOf": [
5538
+ {
5539
+ "$ref": "#/definitions/ResourceHintsInitial"
5540
+ },
5541
+ {
5542
+ "$ref": "#/definitions/ResourceHintsOptions"
5543
+ }
5544
+ ]
5545
+ },
5546
+ "ResourceHintsInitial": {
5547
+ "description": "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).",
5548
+ "anyOf": [
5549
+ {
5550
+ "type": "array",
5551
+ "items": {
5552
+ "$ref": "#/definitions/HtmlResourceHint"
5553
+ }
5554
+ },
5555
+ {
5556
+ "enum": ["prefetch", "preload", "none"]
5557
+ },
5558
+ {
5559
+ "type": "boolean"
5560
+ },
5561
+ {
5562
+ "instanceof": "Function",
5563
+ "tsType": "((context: { entryName: string, entrypoint: import('../lib/Entrypoint'), hostType: 'html' | 'js', compilation: import('../lib/Compilation'), defaultHints: (import('../lib/dependencies/HtmlEntryDependency').HtmlResourceHint & { hostChunks: string[] })[] }) => import('../lib/dependencies/HtmlEntryDependency').HtmlResourceHint[])"
5564
+ }
5565
+ ]
5566
+ },
5567
+ "ResourceHintsOptions": {
5568
+ "description": "Full resource-hint configuration.",
5569
+ "type": "object",
5570
+ "additionalProperties": false,
5571
+ "properties": {
5572
+ "initial": {
5573
+ "$ref": "#/definitions/ResourceHintsInitial"
5574
+ },
5575
+ "manifest": {
5576
+ "description": "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\"`.",
5577
+ "type": "string",
5578
+ "minLength": 1
5579
+ },
5580
+ "modulePreloadPolyfill": {
5581
+ "description": "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).",
5582
+ "type": "boolean"
5583
+ },
5584
+ "preconnect": {
5585
+ "description": "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\"`.",
5586
+ "type": "boolean"
5587
+ },
5588
+ "urlHints": {
5589
+ "description": "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.",
5590
+ "type": "array",
5591
+ "items": {
5592
+ "$ref": "#/definitions/UrlHintRule"
5593
+ }
5594
+ }
5595
+ }
5596
+ },
4929
5597
  "RuleSetCondition": {
4930
5598
  "description": "A condition matcher.",
4931
5599
  "cli": {
@@ -5653,6 +6321,10 @@
5653
6321
  "description": "Limit of assets displayed in chunk groups.",
5654
6322
  "type": "number"
5655
6323
  },
6324
+ "chunkGroupResourceHints": {
6325
+ "description": "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`.",
6326
+ "type": "boolean"
6327
+ },
5656
6328
  "chunkGroups": {
5657
6329
  "description": "Display all chunk groups with the corresponding bundles.",
5658
6330
  "type": "boolean"
@@ -6133,6 +6805,53 @@
6133
6805
  "type": "string",
6134
6806
  "minLength": 1
6135
6807
  },
6808
+ "UrlHintRule": {
6809
+ "description": "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.",
6810
+ "type": "object",
6811
+ "additionalProperties": false,
6812
+ "properties": {
6813
+ "as": {
6814
+ "description": "Default `as` attribute (script / style / font / image / …).",
6815
+ "type": "string"
6816
+ },
6817
+ "exclude": {
6818
+ "$ref": "#/definitions/RuleSetCondition"
6819
+ },
6820
+ "fetchPriority": {
6821
+ "description": "Default fetchpriority for prefetch / preload links.",
6822
+ "enum": ["low", "high", "auto", false]
6823
+ },
6824
+ "include": {
6825
+ "$ref": "#/definitions/RuleSetCondition"
6826
+ },
6827
+ "media": {
6828
+ "description": "Default `media` attribute (e.g. `\"(min-width: 800px)\"`).",
6829
+ "type": "string"
6830
+ },
6831
+ "prefetch": {
6832
+ "description": "When true, emit `<link rel=\"prefetch\">` for matching assets without an explicit hint comment.",
6833
+ "type": "boolean"
6834
+ },
6835
+ "preload": {
6836
+ "description": "When true, emit `<link rel=\"preload\">` for matching assets without an explicit hint comment.",
6837
+ "type": "boolean"
6838
+ },
6839
+ "test": {
6840
+ "$ref": "#/definitions/RuleSetCondition"
6841
+ },
6842
+ "type": {
6843
+ "description": "Default `type` attribute (MIME).",
6844
+ "type": "string"
6845
+ }
6846
+ }
6847
+ },
6848
+ "UrlHints": {
6849
+ "description": "URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `<img src>` / `<link href>` / `<script src>`).",
6850
+ "type": "array",
6851
+ "items": {
6852
+ "$ref": "#/definitions/UrlHintRule"
6853
+ }
6854
+ },
6136
6855
  "Validate": {
6137
6856
  "description": "Enable validation of webpack configuration. Defaults to true in development mode. In production mode, defaults to true unless futureDefaults is enabled, then defaults to false.",
6138
6857
  "type": "boolean"
@@ -6204,6 +6923,10 @@
6204
6923
  }
6205
6924
  ]
6206
6925
  },
6926
+ "WasmStreamingFallback": {
6927
+ "description": "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.",
6928
+ "type": "boolean"
6929
+ },
6207
6930
  "Watch": {
6208
6931
  "description": "Enter watch mode, which rebuilds on file change.",
6209
6932
  "type": "boolean"