@rspack/core 1.4.2 → 1.4.3

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 (81) hide show
  1. package/dist/Chunk.d.ts +14 -34
  2. package/dist/ChunkGraph.d.ts +6 -21
  3. package/dist/Chunks.d.ts +0 -1
  4. package/dist/Compilation.d.ts +8 -7
  5. package/dist/Entrypoint.d.ts +2 -10
  6. package/dist/ErrorHelpers.d.ts +2 -0
  7. package/dist/RspackError.d.ts +1 -1
  8. package/dist/builtin-plugin/APIPlugin.d.ts +1 -2
  9. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -2
  10. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -2
  11. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -2
  12. package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
  13. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -2
  14. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -2
  15. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -2
  16. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -2
  17. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
  18. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -2
  20. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -2
  21. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -2
  22. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -2
  23. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
  24. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -2
  25. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -2
  26. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -2
  27. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -2
  28. package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
  29. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
  30. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +2 -2
  31. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -2
  32. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -2
  33. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -2
  34. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -2
  35. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -2
  36. package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
  37. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -2
  38. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -2
  39. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -2
  40. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -2
  41. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -2
  42. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -2
  43. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -2
  44. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -2
  45. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -2
  46. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -2
  47. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -2
  48. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -2
  49. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -2
  50. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
  51. package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
  52. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -2
  53. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -2
  54. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -2
  55. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -2
  56. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
  57. package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
  58. package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
  59. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
  60. package/dist/builtin-plugin/RuntimePlugin.d.ts +2 -2
  61. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -2
  62. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -2
  63. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
  64. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
  65. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -2
  66. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -2
  67. package/dist/builtin-plugin/base.d.ts +29 -5
  68. package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
  69. package/dist/builtin-plugin/index.d.ts +1 -1
  70. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -2
  71. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -2
  72. package/dist/exports.d.ts +3 -1
  73. package/dist/index.js +197 -348
  74. package/dist/lib/WebpackError.d.ts +1 -1
  75. package/dist/loader-runner/ModuleError.d.ts +7 -0
  76. package/dist/loader-runner/ModuleWarning.d.ts +7 -0
  77. package/dist/stats/StatsFactory.d.ts +2 -2
  78. package/dist/stats/statsFactoryUtils.d.ts +2 -2
  79. package/dist/util/index.d.ts +0 -2
  80. package/package.json +5 -3
  81. package/dist/ChunkGroup.d.ts +0 -33
@@ -1,4 +1,3 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export type LimitChunkCountOptions = {
3
2
  chunkOverhead?: number;
4
3
  entryChunkMultiplicator?: number;
@@ -6,7 +5,7 @@ export type LimitChunkCountOptions = {
6
5
  };
7
6
  export declare const LimitChunkCountPlugin: {
8
7
  new (options: LimitChunkCountOptions): {
9
- name: BuiltinPluginName;
8
+ name: string;
10
9
  _args: [options: LimitChunkCountOptions];
11
10
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
12
11
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const MergeDuplicateChunksPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const ModuleChunkFormatPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const ModuleInfoHeaderPlugin: {
3
2
  new (verbose: any): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [verbose: any];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const NamedChunkIdsPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const NamedModuleIdsPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const NoEmitOnErrorsPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const NodeTargetPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,7 @@
1
- import { BuiltinPluginName, type RawOccurrenceChunkIdsPluginOptions } from "@rspack/binding";
1
+ import { type RawOccurrenceChunkIdsPluginOptions } from "@rspack/binding";
2
2
  export declare const OccurrenceChunkIdsPlugin: {
3
3
  new (options?: RawOccurrenceChunkIdsPluginOptions | undefined): {
4
- name: BuiltinPluginName;
4
+ name: string;
5
5
  _args: [options?: RawOccurrenceChunkIdsPluginOptions | undefined];
6
6
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
7
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,8 +1,8 @@
1
- import { BuiltinPluginName, type RawProgressPluginOptions } from "@rspack/binding";
1
+ import { type RawProgressPluginOptions } from "@rspack/binding";
2
2
  export type ProgressPluginArgument = Partial<Omit<RawProgressPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
3
3
  export declare const ProgressPlugin: {
4
4
  new (progress?: ProgressPluginArgument): {
5
- name: BuiltinPluginName;
5
+ name: string;
6
6
  _args: [progress?: ProgressPluginArgument];
7
7
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
8
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,8 +1,7 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export type ProvidePluginOptions = Record<string, string | string[]>;
3
2
  export declare const ProvidePlugin: {
4
3
  new (provide: ProvidePluginOptions): {
5
- name: BuiltinPluginName;
4
+ name: string;
6
5
  _args: [provide: ProvidePluginOptions];
7
6
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
7
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const RealContentHashPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const RemoveDuplicateModulesPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const RemoveEmptyChunksPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,4 +1,4 @@
1
- import { BuiltinPluginName, type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from "@rspack/binding";
1
+ import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from "@rspack/binding";
2
2
  import * as liteTapable from "@rspack/lite-tapable";
3
3
  import { type Compilation } from "../Compilation";
4
4
  import type { Compiler } from "../Compiler";
@@ -12,7 +12,7 @@ export type RsdoctorPluginOptions = {
12
12
  };
13
13
  declare const RsdoctorPluginImpl: {
14
14
  new (c?: RsdoctorPluginOptions | undefined): {
15
- name: BuiltinPluginName;
15
+ name: string;
16
16
  _args: [c?: RsdoctorPluginOptions | undefined];
17
17
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
18
18
  raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,8 +1,8 @@
1
- import { BuiltinPluginName, type RawRslibPluginOptions } from "@rspack/binding";
1
+ import { type RawRslibPluginOptions } from "@rspack/binding";
2
2
  export type RslibPluginArgument = Partial<Omit<RawRslibPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
3
3
  export declare const RslibPlugin: {
4
4
  new (rslib: RawRslibPluginOptions): {
5
- name: BuiltinPluginName;
5
+ name: string;
6
6
  _args: [rslib: RawRslibPluginOptions];
7
7
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
8
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,8 +1,8 @@
1
- import { BuiltinPluginName, type RawRstestPluginOptions } from "@rspack/binding";
1
+ import { type RawRstestPluginOptions } from "@rspack/binding";
2
2
  export type RstestPluginArgument = Partial<Omit<RawRstestPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
3
3
  export declare const RstestPlugin: {
4
4
  new (rstest: RawRstestPluginOptions): {
5
- name: BuiltinPluginName;
5
+ name: string;
6
6
  _args: [rstest: RawRstestPluginOptions];
7
7
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
8
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,8 +1,8 @@
1
- import { BuiltinPluginName, type RawRuntimeChunkOptions } from "@rspack/binding";
1
+ import { type RawRuntimeChunkOptions } from "@rspack/binding";
2
2
  export type RuntimeChunkPluginOptions = RawRuntimeChunkOptions;
3
3
  export declare const RuntimeChunkPlugin: {
4
4
  new (options: RawRuntimeChunkOptions): {
5
- name: BuiltinPluginName;
5
+ name: string;
6
6
  _args: [options: RawRuntimeChunkOptions];
7
7
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
8
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,11 +1,11 @@
1
1
  import * as binding from "@rspack/binding";
2
2
  import * as liteTapable from "@rspack/lite-tapable";
3
- import { Chunk } from "../Chunk";
3
+ import type { Chunk } from "../Chunk";
4
4
  import { type Compilation } from "../Compilation";
5
5
  import type { CreatePartialRegisters } from "../taps/types";
6
6
  export declare const RuntimePluginImpl: {
7
7
  new (): {
8
- name: binding.BuiltinPluginName;
8
+ name: string;
9
9
  _args: [];
10
10
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
11
11
  raw(compiler: import("..").Compiler): binding.BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const SideEffectsFlagPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,4 +1,3 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const SizeLimitsPlugin: {
3
2
  new (options: {
4
3
  assetFilter?: (assetFilename: string) => boolean;
@@ -6,7 +5,7 @@ export declare const SizeLimitsPlugin: {
6
5
  maxAssetSize?: number;
7
6
  maxEntrypointSize?: number;
8
7
  }): {
9
- name: BuiltinPluginName;
8
+ name: string;
10
9
  _args: [options: {
11
10
  assetFilter?: (assetFilename: string) => boolean;
12
11
  hints?: false | "warning" | "error";
@@ -1,8 +1,8 @@
1
- import { BuiltinPluginName, type SourceMapDevToolPluginOptions } from "@rspack/binding";
1
+ import { type SourceMapDevToolPluginOptions } from "@rspack/binding";
2
2
  export type { SourceMapDevToolPluginOptions };
3
3
  export declare const SourceMapDevToolPlugin: {
4
4
  new (options: SourceMapDevToolPluginOptions): {
5
- name: BuiltinPluginName;
5
+ name: string;
6
6
  _args: [options: SourceMapDevToolPluginOptions];
7
7
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
8
8
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,4 +1,4 @@
1
- import { BuiltinPluginName, type RawSubresourceIntegrityPluginOptions } from "@rspack/binding";
1
+ import { type RawSubresourceIntegrityPluginOptions } from "@rspack/binding";
2
2
  import type { Compiler } from "../Compiler";
3
3
  export type SubresourceIntegrityHashFunction = "sha256" | "sha384" | "sha512";
4
4
  export type SubresourceIntegrityPluginOptions = {
@@ -18,7 +18,7 @@ export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegri
18
18
  */
19
19
  declare const NativeSubresourceIntegrityPlugin: {
20
20
  new (options: NativeSubresourceIntegrityPluginOptions): {
21
- name: BuiltinPluginName;
21
+ name: string;
22
22
  _args: [options: NativeSubresourceIntegrityPluginOptions];
23
23
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
24
24
  raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,4 +1,3 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  import type { AssetConditions } from "../util/assetCondition";
3
2
  type ExtractCommentsCondition = boolean | RegExp;
4
3
  type ExtractCommentsBanner = string | boolean;
@@ -204,7 +203,7 @@ export interface TerserMangleOptions {
204
203
  export type TerserManglePropertiesOptions = {};
205
204
  export declare const SwcJsMinimizerRspackPlugin: {
206
205
  new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
207
- name: BuiltinPluginName;
206
+ name: string;
208
207
  _args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
209
208
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
210
209
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const WarnCaseSensitiveModulesPlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,17 +1,41 @@
1
- import type * as binding from "@rspack/binding";
1
+ import * as binding from "@rspack/binding";
2
2
  import type { Compiler, RspackPluginInstance } from "..";
3
3
  type AffectedHooks = keyof Compiler["hooks"];
4
4
  export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
5
5
  export declare abstract class RspackBuiltinPlugin implements RspackPluginInstance {
6
6
  abstract raw(compiler: Compiler): binding.BuiltinPlugin | undefined;
7
- abstract name: binding.BuiltinPluginName;
7
+ abstract name: binding.BuiltinPluginName | CustomPluginName;
8
8
  affectedHooks?: AffectedHooks;
9
9
  apply(compiler: Compiler): void;
10
10
  }
11
- export declare function createBuiltinPlugin<R>(name: binding.BuiltinPluginName, options: R): binding.BuiltinPlugin;
12
- export declare function create<T extends any[], R>(name: binding.BuiltinPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
11
+ export declare function createBuiltinPlugin<R>(name: binding.BuiltinPluginName | CustomPluginName, options: R): binding.BuiltinPlugin;
12
+ type CustomPluginName = string;
13
+ export declare function create<T extends any[], R>(name: binding.BuiltinPluginName | CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
13
14
  new (...args: T): {
14
- name: binding.BuiltinPluginName;
15
+ name: string;
16
+ _args: T;
17
+ affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
18
+ raw(compiler: Compiler): binding.BuiltinPlugin;
19
+ apply(compiler: Compiler): void;
20
+ };
21
+ };
22
+ /**
23
+ * Create a wrapper class for builtin plugin.
24
+ *
25
+ * @example
26
+ * ```js
27
+ * const MyPlugin = createNativePlugin("MyPlugin", (options) => {
28
+ * return options;
29
+ * });
30
+ *
31
+ * new MyPlugin({
32
+ * foo: "bar"
33
+ * }).apply(compiler);
34
+ * ```
35
+ */
36
+ export declare function createNativePlugin<T extends any[], R>(name: CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
37
+ new (...args: T): {
38
+ name: string;
15
39
  _args: T;
16
40
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
17
41
  raw(compiler: Compiler): binding.BuiltinPlugin;
@@ -1,11 +1,11 @@
1
- import { BuiltinPluginName, type JsHtmlPluginTag } from "@rspack/binding";
1
+ import { type JsHtmlPluginTag } from "@rspack/binding";
2
2
  import type { Compilation } from "../../Compilation";
3
3
  import type { Compiler } from "../../Compiler";
4
4
  import { type HtmlRspackPluginHooks } from "./hooks";
5
5
  import { type HtmlRspackPluginOptions } from "./options";
6
6
  declare const HtmlRspackPluginImpl: {
7
7
  new (c?: HtmlRspackPluginOptions | undefined): {
8
- name: BuiltinPluginName;
8
+ name: string;
9
9
  _args: [c?: HtmlRspackPluginOptions | undefined];
10
10
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
11
11
  raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
@@ -1,4 +1,4 @@
1
- export { RspackBuiltinPlugin } from "./base";
1
+ export { RspackBuiltinPlugin, createNativePlugin } from "./base";
2
2
  export * from "./APIPlugin";
3
3
  export * from "./ArrayPushCallbackChunkFormatPlugin";
4
4
  export * from "./AssetModulesPlugin";
@@ -1,4 +1,3 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  import type { Module } from "../../Module";
3
2
  export declare const BuiltinLazyCompilationPlugin: {
4
3
  new (module: (args: {
@@ -9,7 +8,7 @@ export declare const BuiltinLazyCompilationPlugin: {
9
8
  data: string;
10
9
  client: string;
11
10
  }, cacheable: boolean, entries: boolean, imports: boolean, test?: RegExp | ((module: Module) => boolean) | undefined): {
12
- name: BuiltinPluginName;
11
+ name: string;
13
12
  _args: [module: (args: {
14
13
  module: string;
15
14
  path: string;
@@ -1,7 +1,6 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
1
  export declare const ModuleFederationRuntimePlugin: {
3
2
  new (): {
4
- name: BuiltinPluginName;
3
+ name: string;
5
4
  _args: [];
6
5
  affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
7
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
package/dist/exports.d.ts CHANGED
@@ -9,7 +9,7 @@ export { MultiCompiler } from "./MultiCompiler";
9
9
  import { RspackOptionsApply } from "./rspackOptionsApply";
10
10
  export { RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply };
11
11
  export type { Chunk } from "./Chunk";
12
- export type { ChunkGroup } from "./ChunkGroup";
12
+ export type { ChunkGroup } from "@rspack/binding";
13
13
  export type { ResolveData, ResourceDataWithData } from "./Module";
14
14
  export { MultiStats } from "./MultiStats";
15
15
  export { Module } from "./Module";
@@ -174,6 +174,7 @@ export { ContextReplacementPlugin } from "./builtin-plugin";
174
174
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
175
175
  export type { LoaderOptions as LightningcssLoaderOptions, FeatureOptions as LightningcssFeatureOptions } from "./builtin-loader/lightningcss/index";
176
176
  export type { SubresourceIntegrityPluginOptions } from "./builtin-plugin";
177
+ import { createNativePlugin } from "./builtin-plugin";
177
178
  import { minify, minifySync, transform, transformSync } from "./swc";
178
179
  interface Experiments {
179
180
  globalTrace: {
@@ -193,5 +194,6 @@ interface Experiments {
193
194
  minifySync: typeof minifySync;
194
195
  };
195
196
  CssChunkingPlugin: typeof CssChunkingPlugin;
197
+ createNativePlugin: typeof createNativePlugin;
196
198
  }
197
199
  export declare const experiments: Experiments;