Skip to content

Commit

Permalink
docs: update "getting started" guide section for Rsbuild (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Jan 29, 2025
1 parent 413aef4 commit 1ff7988
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 46 deletions.
24 changes: 1 addition & 23 deletions packages/document/docs/en/guide/start/quick-start-shared.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,7 @@ module.exports = {

### Rsbuild

Initialize the RsdoctorRspackPlugin in the [tools.rspack](https://rsbuild.dev/config/tools/rspack) of `rsbuild.config.ts`:

```js title="rsbuild.config.ts"
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';

export default {
// ...
tools: {
rspack(config, { appendPlugins }) {
// Only register the plugin when RSDOCTOR is true, as the plugin will increase the build time.
if (process.env.RSDOCTOR) {
appendPlugins(
new RsdoctorRspackPlugin({
// plugin options
}),
);
}
},
},
};
```

- **Options:** The plugin provides some configurations, please refer to [Options](../../config/options/options).
Rsbuild has built-in support for Rsdoctor, so you don't need to manually register plugins. See [Rsbuild - Use Rsdoctor](https://rsbuild.dev/guide/debug/rsdoctor) for more details.

### Webpack

Expand Down
24 changes: 1 addition & 23 deletions packages/document/docs/zh/guide/start/quick-start-shared.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,7 @@ module.exports = {

### Rsbuild 项目

`rsbuild.config.ts`[tools.rspack](https://rsbuild.dev/config/tools/rspack) 中初始化 RsdoctorRspackPlugin 插件,参考:

```js title="rsbuild.config.ts"
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';

export default {
// ...
tools: {
rspack(config, { appendPlugins }) {
// 仅在 RSDOCTOR 为 true 时注册插件,因为插件会增加构建耗时
if (process.env.RSDOCTOR) {
appendPlugins(
new RsdoctorRspackPlugin({
// 插件选项
}),
);
}
},
},
};
```

- **Options:** 插件提供了一些配置项,请参考 [Options](../../config/options/options)
Rsbuild 内置了对 Rsdoctor 的支持,不需要手动注册插件。详见 [Rsbuild - 使用 Rsdoctor](https://rsbuild.dev/zh/guide/debug/rsdoctor)

### Webpack 项目

Expand Down

0 comments on commit 1ff7988

Please sign in to comment.