@rspack/core 1.0.0-beta.0 → 1.0.0-beta.2

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 (177) hide show
  1. package/dist/ChunkGroup.d.ts +1 -0
  2. package/dist/ChunkGroup.js +3 -0
  3. package/dist/Compilation.d.ts +19 -1
  4. package/dist/Compiler.d.ts +11 -10
  5. package/dist/Compiler.js +16 -16
  6. package/dist/ExecuteModulePlugin.d.ts +0 -1
  7. package/dist/ExecuteModulePlugin.js +0 -1
  8. package/dist/Module.d.ts +2 -2
  9. package/dist/Module.js +1 -1
  10. package/dist/MultiCompiler.js +1 -1
  11. package/dist/NormalModule.d.ts +1 -0
  12. package/dist/NormalModule.js +1 -0
  13. package/dist/Resolver.d.ts +1 -2
  14. package/dist/RspackError.js +1 -1
  15. package/dist/Stats.js +22 -2
  16. package/dist/Template.js +2 -2
  17. package/dist/builtin-loader/lightningcss/index.js +1 -1
  18. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/BannerPlugin.d.ts +31 -31
  23. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/DefinePlugin.js +1 -1
  31. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +3 -3
  36. package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +1 -1
  37. package/dist/builtin-plugin/EnableLibraryPlugin.js +1 -6
  38. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
  39. package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +1 -1
  40. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/EntryPlugin.d.ts +3 -2
  42. package/dist/builtin-plugin/EntryPlugin.js +1 -0
  43. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/ExternalsPlugin.d.ts +5 -5
  46. package/dist/builtin-plugin/ExternalsPlugin.js +1 -1
  47. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +9 -9
  52. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +0 -1
  56. package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
  57. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +4 -11
  60. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  72. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  73. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  74. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  75. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  76. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  77. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  78. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  79. package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
  80. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -3
  81. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  82. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
  83. package/dist/builtin-plugin/base.d.ts +1 -1
  84. package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +3 -5
  85. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +7 -5
  86. package/dist/builtin-plugin/css-extract/loader.d.ts +8 -3
  87. package/dist/builtin-plugin/css-extract/loader.js +27 -22
  88. package/dist/builtin-plugin/lazy-compilation/backend.js +4 -4
  89. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  90. package/dist/config/adapter.js +16 -2
  91. package/dist/config/adapterRuleUse.d.ts +2 -6
  92. package/dist/config/adapterRuleUse.js +10 -9
  93. package/dist/config/defaults.js +28 -42
  94. package/dist/config/normalization.d.ts +7 -3
  95. package/dist/config/normalization.js +7 -2
  96. package/dist/config/zod.d.ts +1634 -1093
  97. package/dist/config/zod.js +31 -2
  98. package/dist/container/ContainerReferencePlugin.d.ts +1 -1
  99. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  100. package/dist/container/default.runtime.js +1 -1
  101. package/dist/exports.d.ts +1 -1
  102. package/dist/lib/AbstractMethodError.d.ts +12 -3
  103. package/dist/lib/AbstractMethodError.js +29 -22
  104. package/dist/lib/Cache.d.ts +40 -46
  105. package/dist/lib/Cache.js +43 -78
  106. package/dist/lib/CacheFacade.d.ts +119 -143
  107. package/dist/lib/CacheFacade.js +123 -124
  108. package/dist/lib/Dependency.d.ts +23 -0
  109. package/dist/lib/Dependency.js +11 -0
  110. package/dist/lib/EntryOptionPlugin.d.ts +19 -2
  111. package/dist/lib/EntryOptionPlugin.js +22 -6
  112. package/dist/lib/EnvironmentPlugin.d.ts +17 -10
  113. package/dist/lib/EnvironmentPlugin.js +16 -17
  114. package/dist/lib/HookWebpackError.d.ts +27 -33
  115. package/dist/lib/HookWebpackError.js +33 -34
  116. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  117. package/dist/lib/{ignoreWarningsPlugin.js → IgnoreWarningsPlugin.js} +17 -0
  118. package/dist/lib/LoaderOptionsPlugin.d.ts +18 -9
  119. package/dist/lib/LoaderOptionsPlugin.js +38 -14
  120. package/dist/lib/LoaderTargetPlugin.d.ts +17 -8
  121. package/dist/lib/LoaderTargetPlugin.js +17 -15
  122. package/dist/lib/ModuleFilenameHelpers.d.ts +10 -1
  123. package/dist/lib/ModuleFilenameHelpers.js +10 -1
  124. package/dist/lib/NormalModuleReplacementPlugin.d.ts +15 -5
  125. package/dist/lib/NormalModuleReplacementPlugin.js +15 -5
  126. package/dist/lib/WebpackError.d.ts +23 -22
  127. package/dist/lib/WebpackError.js +15 -35
  128. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  129. package/dist/lib/cache/MemoryCachePlugin.js +40 -0
  130. package/dist/lib/cache/getLazyHashedEtag.d.ts +24 -24
  131. package/dist/lib/cache/getLazyHashedEtag.js +20 -23
  132. package/dist/lib/cache/mergeEtags.d.ts +15 -9
  133. package/dist/lib/cache/mergeEtags.js +18 -11
  134. package/dist/lib/formatLocation.d.ts +14 -9
  135. package/dist/lib/formatLocation.js +17 -15
  136. package/dist/loader-runner/index.js +6 -7
  137. package/dist/loader-runner/loadLoader.js +8 -11
  138. package/dist/logging/Logger.js +3 -3
  139. package/dist/logging/createConsoleLogger.d.ts +26 -6
  140. package/dist/logging/createConsoleLogger.js +21 -58
  141. package/dist/logging/runtime.d.ts +4 -10
  142. package/dist/logging/runtime.js +8 -23
  143. package/dist/logging/truncateArgs.d.ts +4 -4
  144. package/dist/logging/truncateArgs.js +5 -10
  145. package/dist/node/NodeEnvironmentPlugin.js +2 -2
  146. package/dist/node/NodeWatchFileSystem.js +6 -6
  147. package/dist/node/nodeConsole.d.ts +7 -21
  148. package/dist/node/nodeConsole.js +29 -36
  149. package/dist/rspackOptionsApply.d.ts +0 -1
  150. package/dist/rspackOptionsApply.js +10 -9
  151. package/dist/sharing/ProvideSharedPlugin.d.ts +20 -19
  152. package/dist/sharing/ProvideSharedPlugin.js +26 -17
  153. package/dist/sharing/SharePlugin.d.ts +3 -0
  154. package/dist/sharing/SharePlugin.js +4 -1
  155. package/dist/stats/DefaultStatsFactoryPlugin.js +187 -96
  156. package/dist/stats/DefaultStatsPresetPlugin.js +1 -2
  157. package/dist/stats/DefaultStatsPrinterPlugin.js +18 -19
  158. package/dist/stats/StatsFactory.d.ts +2 -1
  159. package/dist/stats/StatsFactory.js +2 -6
  160. package/dist/stats/statsFactoryUtils.d.ts +63 -23
  161. package/dist/util/SizeFormatHelpers.js +1 -1
  162. package/dist/util/bindingVersionCheck.js +3 -3
  163. package/dist/util/cleverMerge.js +3 -2
  164. package/dist/util/comparators.d.ts +2 -2
  165. package/dist/util/comparators.js +5 -4
  166. package/dist/util/createHash.js +1 -1
  167. package/dist/util/fs.js +2 -2
  168. package/dist/util/identifier.js +2 -2
  169. package/dist/util/index.js +1 -1
  170. package/dist/util/memoize.js +1 -4
  171. package/dist/util/smartGrouping.js +4 -6
  172. package/dist/util/webpack.d.ts +1 -1
  173. package/dist/util/webpack.js +2 -1
  174. package/module.d.ts +1 -1
  175. package/package.json +3 -3
  176. package/compiled/enhanced-resolve/index.js +0 -5566
  177. package/dist/lib/ignoreWarningsPlugin.d.ts +0 -7
@@ -126,6 +126,7 @@ const applyExperimentsDefaults = (experiments) => {
126
126
  D(experiments, "lazyCompilation", false);
127
127
  D(experiments, "asyncWebAssembly", experiments.futureDefaults);
128
128
  D(experiments, "css", experiments.futureDefaults ? true : undefined);
129
+ D(experiments, "layers", false);
129
130
  D(experiments, "topLevelAwait", true);
130
131
  // IGNORE(experiments.rspackFuture): Rspack specific configuration
131
132
  D(experiments, "rspackFuture", {});
@@ -152,6 +153,7 @@ const applyJavascriptParserOptionsDefaults = (parserOptions, fallback) => {
152
153
  D(parserOptions, "strictExportPresence", fallback?.strictExportPresence ?? false);
153
154
  D(parserOptions, "worker", fallback?.worker ?? ["..."]);
154
155
  D(parserOptions, "overrideStrict", fallback?.overrideStrict ?? undefined);
156
+ D(parserOptions, "importMeta", fallback?.importMeta ?? true);
155
157
  };
156
158
  const applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties }) => {
157
159
  (0, assertNotNil_1.assertNotNill)(module.parser);
@@ -316,16 +318,10 @@ const applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties }
316
318
  type: "asset/resource"
317
319
  }
318
320
  ]
319
- }
320
- // {
321
- // assert: { type: "json" },
322
- // type: "json"
323
- // },
324
- // {
325
- // with: { type: "json" },
326
- // type: "json"
327
- // }
328
- );
321
+ }, {
322
+ with: { type: "json" },
323
+ type: "json"
324
+ });
329
325
  return rules;
330
326
  });
331
327
  };
@@ -407,8 +403,9 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
407
403
  D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`);
408
404
  D(output, "hotUpdateMainFilename", "[runtime].[fullhash].hot-update.json");
409
405
  const uniqueNameId = Template_1.Template.toIdentifier(output.uniqueName);
410
- F(output, "hotUpdateGlobal", () => "webpackHotUpdate" + uniqueNameId);
411
- F(output, "chunkLoadingGlobal", () => "webpackChunk" + uniqueNameId);
406
+ F(output, "hotUpdateGlobal", () => `webpackHotUpdate${uniqueNameId}`);
407
+ F(output, "chunkLoadingGlobal", () => `webpackChunk${uniqueNameId}`);
408
+ D(output, "cssHeadDataCompression", !development);
412
409
  D(output, "assetModuleFilename", "[hash][ext][query]");
413
410
  D(output, "webassemblyModuleFilename", "[hash].module.wasm");
414
411
  F(output, "path", () => node_path_1.default.join(process.cwd(), "dist"));
@@ -431,10 +428,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
431
428
  return "module";
432
429
  if (tp.document)
433
430
  return "array-push";
434
- throw new Error("For the selected environment is no default ESM chunk format available:\n" +
435
- "ESM exports can be chosen when 'import()' is available.\n" +
436
- "JSONP Array push can be chosen when 'document' is available.\n" +
437
- helpMessage);
431
+ throw new Error(`For the selected environment is no default ESM chunk format available:\nESM exports can be chosen when 'import()' is available.\nJSONP Array push can be chosen when 'document' is available.\n${helpMessage}`);
438
432
  }
439
433
  if (tp.document)
440
434
  return "array-push";
@@ -444,10 +438,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
444
438
  return "commonjs";
445
439
  if (tp.importScripts)
446
440
  return "array-push";
447
- throw new Error("For the selected environment is no default script chunk format available:\n" +
448
- "JSONP Array push can be chosen when 'document' or 'importScripts' is available.\n" +
449
- "CommonJs exports can be chosen when 'require' or node builtins are available.\n" +
450
- helpMessage);
441
+ throw new Error(`For the selected environment is no default script chunk format available:\nJSONP Array push can be chosen when 'document' or 'importScripts' is available.\nCommonJs exports can be chosen when 'require' or node builtins are available.\n${helpMessage}`);
451
442
  }
452
443
  throw new Error("Chunk format can't be selected by default when no target is specified");
453
444
  });
@@ -530,6 +521,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
530
521
  return "self";
531
522
  });
532
523
  D(output, "importFunctionName", "import");
524
+ D(output, "importMetaName", "import.meta");
533
525
  // IGNORE(output.clean): The default value of `output.clean` in webpack is undefined, but it has the same effect as false.
534
526
  F(output, "clean", () => !!output.clean);
535
527
  D(output, "crossOriginLoading", false);
@@ -595,8 +587,8 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
595
587
  const environment = output.environment;
596
588
  const optimistic = (v) => v || v === undefined;
597
589
  const conditionallyOptimistic = (v, c) => (v === undefined && c) || v;
598
- F(environment, "globalThis", () => tp && tp.globalThis);
599
- F(environment, "bigIntLiteral", () => tp && tp.bigIntLiteral);
590
+ F(environment, "globalThis", () => tp?.globalThis);
591
+ F(environment, "bigIntLiteral", () => tp?.bigIntLiteral);
600
592
  F(environment, "const", () => tp && optimistic(tp.const));
601
593
  F(environment, "arrowFunction", () => tp && optimistic(tp.arrowFunction));
602
594
  F(environment, "asyncFunction", () => tp && optimistic(tp.asyncFunction));
@@ -605,25 +597,19 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
605
597
  F(environment, "optionalChaining", () => tp && optimistic(tp.optionalChaining));
606
598
  F(environment, "nodePrefixForCoreModules", () => tp && optimistic(tp.nodePrefixForCoreModules));
607
599
  F(environment, "templateLiteral", () => tp && optimistic(tp.templateLiteral));
608
- F(environment, "dynamicImport", () => conditionallyOptimistic(tp && tp.dynamicImport, output.module));
609
- F(environment, "dynamicImportInWorker", () => conditionallyOptimistic(tp && tp.dynamicImportInWorker, output.module));
610
- F(environment, "module", () => conditionallyOptimistic(tp && tp.module, output.module));
600
+ F(environment, "dynamicImport", () => conditionallyOptimistic(tp?.dynamicImport, output.module));
601
+ F(environment, "dynamicImportInWorker", () => conditionallyOptimistic(tp?.dynamicImportInWorker, output.module));
602
+ F(environment, "module", () => conditionallyOptimistic(tp?.module, output.module));
611
603
  F(environment, "document", () => tp && optimistic(tp.document));
612
604
  };
613
605
  const applyExternalsPresetsDefaults = (externalsPresets, { targetProperties }) => {
614
- D(externalsPresets, "web", targetProperties && targetProperties.web);
615
- D(externalsPresets, "node", targetProperties && targetProperties.node);
616
- D(externalsPresets, "electron", targetProperties && targetProperties.electron);
617
- D(externalsPresets, "electronMain", targetProperties &&
618
- targetProperties.electron &&
619
- targetProperties.electronMain);
620
- D(externalsPresets, "electronPreload", targetProperties &&
621
- targetProperties.electron &&
622
- targetProperties.electronPreload);
623
- D(externalsPresets, "electronRenderer", targetProperties &&
624
- targetProperties.electron &&
625
- targetProperties.electronRenderer);
626
- D(externalsPresets, "nwjs", targetProperties && targetProperties.nwjs);
606
+ D(externalsPresets, "web", targetProperties?.web);
607
+ D(externalsPresets, "node", targetProperties?.node);
608
+ D(externalsPresets, "electron", targetProperties?.electron);
609
+ D(externalsPresets, "electronMain", targetProperties?.electron && targetProperties.electronMain);
610
+ D(externalsPresets, "electronPreload", targetProperties?.electron && targetProperties.electronPreload);
611
+ D(externalsPresets, "electronRenderer", targetProperties?.electron && targetProperties.electronRenderer);
612
+ D(externalsPresets, "nwjs", targetProperties?.nwjs);
627
613
  };
628
614
  const applyLoaderDefaults = (loader, { targetProperties, environment }) => {
629
615
  F(loader, "target", () => {
@@ -652,19 +638,19 @@ const applyNodeDefaults = (node, { targetProperties }) => {
652
638
  return;
653
639
  // IGNORE(node.global): The default value of `global` is determined by `futureDefaults` in webpack.
654
640
  F(node, "global", () => {
655
- if (targetProperties && targetProperties.global)
641
+ if (targetProperties?.global)
656
642
  return false;
657
643
  return "warn";
658
644
  });
659
645
  // IGNORE(node.__dirname): The default value of `__dirname` is determined by `futureDefaults` in webpack.
660
646
  F(node, "__dirname", () => {
661
- if (targetProperties && targetProperties.node)
647
+ if (targetProperties?.node)
662
648
  return "eval-only";
663
649
  return "warn-mock";
664
650
  });
665
651
  // IGNORE(node.__filename): The default value of `__filename` is determined by `futureDefaults` in webpack.
666
652
  F(node, "__filename", () => {
667
- if (targetProperties && targetProperties.node)
653
+ if (targetProperties?.node)
668
654
  return "eval-only";
669
655
  return "warn-mock";
670
656
  });
@@ -775,7 +761,7 @@ const getResolveDefaults = ({ context, targetProperties, mode, css }) => {
775
761
  }
776
762
  const jsExtensions = [".js", ".json", ".wasm"];
777
763
  const tp = targetProperties;
778
- const browserField = tp && tp.web && (!tp.node || (tp.electron && tp.electronRenderer));
764
+ const browserField = tp?.web && (!tp.node || (tp.electron && tp.electronRenderer));
779
765
  const aliasFields = browserField ? ["browser"] : [];
780
766
  const mainFields = browserField
781
767
  ? ["browser", "module", "..."]
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { Compilation } from "../Compilation";
11
- import type { AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryFilename, EntryRuntime, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./zod";
11
+ import type { AssetModuleFilename, AsyncChunks, Bail, BaseUri, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryFilename, EntryRuntime, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, InfrastructureLogging, Layer, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./zod";
12
12
  export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
13
13
  export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
14
14
  export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
@@ -19,12 +19,13 @@ export interface EntryDescriptionNormalized {
19
19
  import?: string[];
20
20
  runtime?: EntryRuntime;
21
21
  chunkLoading?: ChunkLoading;
22
- asyncChunks?: boolean;
22
+ asyncChunks?: AsyncChunks;
23
23
  publicPath?: PublicPath;
24
- baseUri?: string;
24
+ baseUri?: BaseUri;
25
25
  filename?: EntryFilename;
26
26
  library?: LibraryOptions;
27
27
  dependOn?: string[];
28
+ layer?: Layer;
28
29
  }
29
30
  export interface OutputNormalized {
30
31
  path?: Path;
@@ -48,6 +49,7 @@ export interface OutputNormalized {
48
49
  strictModuleErrorHandling?: StrictModuleErrorHandling;
49
50
  globalObject?: GlobalObject;
50
51
  importFunctionName?: ImportFunctionName;
52
+ importMetaName?: ImportMetaName;
51
53
  iife?: Iife;
52
54
  wasmLoading?: WasmLoading;
53
55
  enabledWasmLoadingTypes?: EnabledWasmLoadingTypes;
@@ -72,6 +74,7 @@ export interface OutputNormalized {
72
74
  environment?: Environment;
73
75
  charset?: boolean;
74
76
  chunkLoadTimeout?: number;
77
+ cssHeadDataCompression?: boolean;
75
78
  }
76
79
  export interface ModuleOptionsNormalized {
77
80
  defaultRules?: RuleSetRules;
@@ -86,6 +89,7 @@ export interface ExperimentsNormalized {
86
89
  outputModule?: boolean;
87
90
  topLevelAwait?: boolean;
88
91
  css?: boolean;
92
+ layers?: boolean;
89
93
  futureDefaults?: boolean;
90
94
  rspackFuture?: RspackFutureOptions;
91
95
  }
@@ -54,6 +54,7 @@ const getNormalizedRspackOptions = (config) => {
54
54
  chunkLoading: output.chunkLoading,
55
55
  chunkFilename: output.chunkFilename,
56
56
  crossOriginLoading: output.crossOriginLoading,
57
+ cssHeadDataCompression: output.cssHeadDataCompression,
57
58
  cssFilename: output.cssFilename,
58
59
  cssChunkFilename: output.cssChunkFilename,
59
60
  hotUpdateMainFilename: output.hotUpdateMainFilename,
@@ -75,6 +76,7 @@ const getNormalizedRspackOptions = (config) => {
75
76
  : ["..."],
76
77
  globalObject: output.globalObject,
77
78
  importFunctionName: output.importFunctionName,
79
+ importMetaName: output.importMetaName,
78
80
  iife: output.iife,
79
81
  module: output.module,
80
82
  sourceMapFilename: output.sourceMapFilename,
@@ -240,6 +242,7 @@ const getNormalizedEntryStatic = (entry) => {
240
242
  asyncChunks: value.asyncChunks,
241
243
  filename: value.filename,
242
244
  library: value.library,
245
+ layer: value.layer,
243
246
  dependOn: Array.isArray(value.dependOn)
244
247
  ? value.dependOn
245
248
  : value.dependOn
@@ -280,8 +283,10 @@ const cloneObject = (value) => ({ ...value });
280
283
  const keyedNestedConfig = (value, fn, customKeys) => {
281
284
  const result = value === undefined
282
285
  ? {}
283
- : Object.keys(value).reduce((obj, key) => ((obj[key] = (customKeys && key in customKeys ? customKeys[key] : fn)(value[key])),
284
- obj), {});
286
+ : Object.keys(value).reduce((obj, key) => {
287
+ obj[key] = (customKeys && key in customKeys ? customKeys[key] : fn)(value[key]);
288
+ return obj;
289
+ }, {});
285
290
  if (customKeys) {
286
291
  for (const key of Object.keys(customKeys)) {
287
292
  if (!(key in result)) {