Skip to content

Commit 31a6d14

Browse files
committed
docs: deprecate bundleAnalyze in favor of Rsdoctor
1 parent 957877d commit 31a6d14

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

packages/core/src/types/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,8 @@ export interface PerformanceConfig {
733733

734734
/**
735735
* Analyze the size of output files.
736+
* @default undefined
737+
* @deprecated Use Rsdoctor instead.
736738
*/
737739
bundleAnalyze?: BundleAnalyzerPlugin.Options;
738740

website/docs/en/config/performance/bundle-analyze.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# performance.bundleAnalyze
22

33
- **Type:** `Object | undefined`
4+
- **Default:** `undefined`
45

56
Used to enable the [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) plugin to analyze the size of the output.
67

8+
:::tip
9+
`performance.bundleAnalyze` has been deprecated and will be removed in Rsbuild 2.0. We recommend using [Rsdoctor](/guide/debug/rsdoctor) to analyze your bundle size instead.
10+
:::
11+
712
By default, Rsbuild does not enable `webpack-bundle-analyzer`. When this feature is enabled, the default configuration is as follows:
813

914
```js

website/docs/en/guide/optimization/optimize-bundle.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ npx yarn-deduplicate && yarn
4242

4343
We recommend using lightweight libraries in your project, such as replacing [moment](https://momentjs.com/) with [day.js](https://day.js.org/).
4444

45-
To find out the large libraries in the project, add the `BUNDLE_ANALYZE=true` environment variable when building:
46-
47-
```bash
48-
BUNDLE_ANALYZE=true pnpm build
49-
```
50-
51-
See the [performance.bundleAnalyze](/config/performance/bundle-analyze) configuration for details.
45+
To find out large third-party libraries in your project, use Rsdoctor to analyze the bundle size. For more details, see [Using Rsdoctor](/guide/debug/rsdoctor).
5246

5347
## Adjust browserslist
5448

website/docs/zh/config/performance/bundle-analyze.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# performance.bundleAnalyze
22

33
- **类型:** `Object | undefined`
4+
- **默认值:** `undefined`
45

56
用于开启 [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) 插件来分析产物体积。
67

8+
:::tip
9+
`performance.bundleAnalyze` 已被弃用,并将在 Rsbuild 2.0 移除,建议使用 [Rsdoctor](/guide/debug/rsdoctor) 来分析产物体积。
10+
:::
11+
712
默认情况下,Rsbuild 不会开启 `webpack-bundle-analyzer`。当开启该功能后,内部的默认配置如下:
813

914
```js

website/docs/zh/guide/optimization/optimize-bundle.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ npx yarn-deduplicate && yarn
4242

4343
建议将项目中体积较大的三方库替换为更轻量的库,比如将 [moment](https://momentjs.com/) 替换为 [day.js](https://day.js.org/)
4444

45-
如果你需要找出项目中体积较大的三方库,可以在执行构建时添加 `BUNDLE_ANALYZE=true` 环境变量:
46-
47-
```bash
48-
BUNDLE_ANALYZE=true pnpm build
49-
```
50-
51-
详见 [performance.bundleAnalyze](/config/performance/bundle-analyze) 配置项。
45+
如果你需要找出项目中体积较大的三方库,可以使用 Rsdoctor 来分析产物体积,详见 [使用 Rsdoctor](/guide/debug/rsdoctor)
5246

5347
## 提升 Browserslist 范围
5448

0 commit comments

Comments
 (0)