@rspack/core 0.5.8 → 0.5.9

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 (69) hide show
  1. package/dist/Chunk.d.ts +2 -0
  2. package/dist/Chunk.js +4 -0
  3. package/dist/Compilation.d.ts +25 -26
  4. package/dist/Compilation.js +16 -16
  5. package/dist/Compiler.d.ts +12 -5
  6. package/dist/Compiler.js +83 -138
  7. package/dist/Module.d.ts +3 -0
  8. package/dist/Module.js +12 -0
  9. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  10. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  11. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  12. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  13. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -10
  24. package/dist/builtin-plugin/EnableLibraryPlugin.js +39 -1
  25. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
  28. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/base.d.ts +2 -2
  60. package/dist/config/normalization.js +1 -1
  61. package/dist/config/zod.d.ts +359 -51
  62. package/dist/config/zod.js +8 -5
  63. package/dist/container/ContainerPlugin.d.ts +2 -2
  64. package/dist/exports.d.ts +74 -29
  65. package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
  66. package/dist/sharing/ShareRuntimePlugin.js +1 -1
  67. package/package.json +5 -5
  68. package/dist/util/normalization.d.ts +0 -5
  69. package/dist/util/normalization.js +0 -9
@@ -3,7 +3,7 @@ export declare const RemoveEmptyChunksPlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: void;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -3,7 +3,7 @@ export declare const RuntimePlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: void;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -3,7 +3,7 @@ export declare const SideEffectsFlagPlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: void;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -16,7 +16,7 @@ export declare const SourceMapDevToolPlugin: {
16
16
  new (options: SourceMapDevToolPluginOptions): {
17
17
  name: BuiltinPluginName;
18
18
  _options: RawSourceMapDevToolPluginOptions;
19
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
19
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
20
20
  raw(): import("@rspack/binding").BuiltinPlugin;
21
21
  apply(compiler: import("../Compiler").Compiler): void;
22
22
  };
@@ -3,7 +3,7 @@ export declare const SwcCssMinimizerRspackPlugin: {
3
3
  new (options?: any): {
4
4
  name: BuiltinPluginName;
5
5
  _options: undefined;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -232,7 +232,7 @@ export declare const SwcJsMinimizerRspackPlugin: {
232
232
  new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
233
233
  name: BuiltinPluginName;
234
234
  _options: RawSwcJsMinimizerRspackPluginOptions;
235
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
235
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
236
236
  raw(): import("@rspack/binding").BuiltinPlugin;
237
237
  apply(compiler: import("../Compiler").Compiler): void;
238
238
  };
@@ -3,7 +3,7 @@ export declare const WarnCaseSensitiveModulesPlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: void;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -3,7 +3,7 @@ export declare const WebWorkerTemplatePlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: undefined;
6
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
@@ -4,7 +4,7 @@ type AffectedHooks = keyof Compiler["hooks"];
4
4
  export declare const HOOKS_CAN_NOT_INHERENT_FROM_PARENT: string[];
5
5
  export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
6
6
  export declare abstract class RspackBuiltinPlugin implements RspackPluginInstance {
7
- abstract raw(compiler: Compiler): binding.BuiltinPlugin | null;
7
+ abstract raw(compiler: Compiler): binding.BuiltinPlugin | undefined;
8
8
  abstract name: binding.BuiltinPluginName;
9
9
  affectedHooks?: AffectedHooks;
10
10
  apply(compiler: Compiler): void;
@@ -14,7 +14,7 @@ export declare function create<T extends any[], R>(name: binding.BuiltinPluginNa
14
14
  new (...args: T): {
15
15
  name: binding.BuiltinPluginName;
16
16
  _options: R;
17
- affectedHooks: "emit" | "done" | "compilation" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishModules" | "finishMake" | "entryOption" | undefined;
17
+ affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
18
18
  raw(): binding.BuiltinPlugin;
19
19
  apply(compiler: Compiler): void;
20
20
  };
@@ -30,7 +30,7 @@ const getNormalizedRspackOptions = (config) => {
30
30
  mode: config.mode,
31
31
  entry: config.entry === undefined
32
32
  ? { main: {} }
33
- : getNormalizedEntryStatic(config.entry),
33
+ : getNormalizedEntryStatic(typeof config.entry === "function" ? config.entry() : config.entry),
34
34
  output: nestedConfig(config.output, output => {
35
35
  var _a;
36
36
  const { library } = output;