Skip to content

Commit

Permalink
chore(docs): add generate tile graph doc (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
easy1090 authored Jul 2, 2024
1 parent f454d2c commit 0f61a50
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/document/docs/en/config/options/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ This option is used to configure whether Rsdoctor enables support for certain de

```ts
type ISupport = {
banner: boolean;
banner?: boolean;
parseBundle?: boolean;
generateTileGraph?: boolean;
};
```

Expand All @@ -184,10 +186,16 @@ type ISupport = {
When enabling the analysis of BannerPlugin, Rsdoctor should not be used in production versions.
:::

- default: false.
- type: boolean.

If `supports.banner` is enabled, Rsdoctor will enable compatibility logic for BannerPlugin. For more details, please refer to: [Supports BannerPlugin](../../guide/usage/bundle-size#supports-bannerplugin)

#### parseBundle

- default: true.
- type: boolean.

In some large repositories, the execution time of parsing the bundle is too long. Since the Parse Bundle analysis utilizes AST parsing and processing, it can be time-consuming when there are a large number of output files.
If this capability is not necessary, it can be selectively disabled using the supports.parseBundle configuration. An example is shown below:

Expand Down Expand Up @@ -218,6 +226,18 @@ Disabling the Parse Bundle capability will only affect the visibility of the Bun
style={{ margin: 'auto' }}
/>
</div>
#### generateTileGraph

- default: true. The default value in rspack is false.
- type: boolean.

Whether to enable the ability to generate tile graphs, which affects whether the Bundle Size page has a tile graph from `webpack-bundle-analyzer`.

<img
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/docs/usage/bundle/bundle-size-tile-graph.png"
width="500px"
style={{ margin: 'auto' }}
/>

### port

Expand Down
20 changes: 20 additions & 0 deletions packages/document/docs/zh/config/options/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import FeaturesRspack from '@zh/shared/features-rspack.md';
type ISupport = {
banner?: boolean;
parseBundle?: boolean;
generateTileGraph?: boolean;
};
```

Expand All @@ -160,10 +161,16 @@ type ISupport = {
开启 BannerPlugin 分析时,请勿在生产版本中使用 Rsdoctor。
:::

- default: true.
- type: boolean.

如果开启 `supports.banner` 则会开启 Rsdoctor 对 BannerPlugin 的兼容逻辑。详细请看:[支持 BannerPlugin](../../guide/usage/bundle-size#%E6%94%AF%E6%8C%81-bannerplugin)

#### parseBundle

- default: true.
- type: boolean.

在部分大型仓库中,反解 Bundle 解析执行耗时过大,这是因为 Parse Bundle 的分析利用了 AST 解析与处理。当产物文件过多时,耗时也会增加。如果不需要此功能,可以通过 `supports.parseBundle` 配置进行选择性关闭。示例如下:

```ts
Expand Down Expand Up @@ -194,6 +201,19 @@ chain.plugin('Rsdoctor').use(RsdoctorRspackPlugin, [
/>
</div>

#### generateTileGraph

- default: true. 在 rspack 中默认值是 false。
- type: boolean.

是否开启生成瓦片图的能力,影响是 Bundle Size 页面中是否有 `webpack-bundle-analyzer` 的瓦片图。

<img
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/docs/usage/bundle/bundle-size-tile-graph.png"
width="500px"
style={{ margin: 'auto' }}
/>

### port

- **Type:** `number`
Expand Down

0 comments on commit 0f61a50

Please sign in to comment.