File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @rspack/cli " : patch
3+ ---
4+
5+ add definePlugin helper
Original file line number Diff line number Diff line change 11export * from "./types" ;
2- export { RspackCLI , defineConfig } from "./rspack-cli" ;
2+ export { RspackCLI , defineConfig , definePlugin } from "./rspack-cli" ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616import { normalizeEnv } from "./utils/options" ;
1717import { loadRspackConfig } from "./utils/loadConfig" ;
1818import { Mode } from "@rspack/core/src/config" ;
19+ import { RspackPluginInstance , RspackPluginFunction } from "@rspack/core" ;
1920
2021type RspackEnv = "development" | "production" ;
2122export class RspackCLI {
@@ -252,3 +253,10 @@ export class RspackCLI {
252253export function defineConfig ( config : RspackOptions ) : RspackOptions {
253254 return config ;
254255}
256+
257+ // Note: use union type will make apply function's `compiler` type to be `any`
258+ export function definePlugin ( plugin : RspackPluginFunction ) : RspackPluginFunction
259+ export function definePlugin ( plugin : RspackPluginInstance ) : RspackPluginInstance
260+ export function definePlugin ( plugin : any ) : any {
261+ return plugin ;
262+ }
You can’t perform that action at this time.
0 commit comments