Skip to content

Commit

Permalink
docs: correct onCloseDevServer example (#4464)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Jan 31, 2025
1 parent 9606c8e commit 6a19ff6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion website/docs/en/api/javascript-api/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createRsbuild } from '@rsbuild/core';

const rsbuild = await createRsbuild({
rsbuildConfig: {
// rsbuild configs
// Rsbuild configuration
},
});
```
Expand Down
8 changes: 6 additions & 2 deletions website/docs/en/plugins/dev/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,12 @@ import OnCloseDevServer from '@en/shared/onCloseDevServer.mdx';
- **Example:**

```ts
rsbuild.onCloseDevServer(async () => {
console.log('close dev server!');
const myPlugin = () => ({
setup: (api) => {
api.onCloseDevServer(async () => {
console.log('close dev server!');
});
},
});
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/api/javascript-api/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createRsbuild } from '@rsbuild/core';

const rsbuild = await createRsbuild({
rsbuildConfig: {
// rsbuild configs
// Rsbuild configuration
},
});
```
Expand Down
8 changes: 6 additions & 2 deletions website/docs/zh/plugins/dev/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,12 @@ import OnCloseDevServer from '@zh/shared/onCloseDevServer.mdx';
- **示例:**

```ts
rsbuild.onCloseDevServer(async () => {
console.log('close dev server!');
const myPlugin = () => ({
setup: (api) => {
api.onCloseDevServer(async () => {
console.log('close dev server!');
});
},
});
```

Expand Down

0 comments on commit 6a19ff6

Please sign in to comment.