Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion website/docs/en/api/javascript-api/instance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,23 @@ Get all the Rsbuild plugins registered in the current Rsbuild instance.
- **Type:**

```ts
function GetPlugins(): RsbuildPlugin[];
function GetPlugins(options?: {
/**
* Get the plugins in the specified environment.
* If environment is not specified, get the global plugins.
*/
environment: string;
}): RsbuildPlugin[];
```

- **Example:**

```ts
// get all plugins
console.log(rsbuild.getPlugins());

// get plugins in `web` environment
console.log(rsbuild.getPlugins({ environment: 'web' }));
```

## rsbuild.removePlugins
Expand Down
12 changes: 11 additions & 1 deletion website/docs/zh/api/javascript-api/instance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,23 @@ rsbuild.addPlugins([pluginFoo()], { environment: 'node' });
- **类型:**

```ts
function GetPlugins(): RsbuildPlugin[];
function GetPlugins(options?: {
/**
* Get the plugins in the specified environment.
* If environment is not specified, get the global plugins.
*/
environment: string;
}): RsbuildPlugin[];
```

- **示例:**

```ts
// get all plugins
console.log(rsbuild.getPlugins());

// get plugins in `web` environment
console.log(rsbuild.getPlugins({ environment: 'web' }));
```

## rsbuild.removePlugins
Expand Down
Loading