Skip to content

Commit bc5dc9d

Browse files
authored
docs: change options document (#777)
1 parent 831c5b4 commit bc5dc9d

File tree

2 files changed

+103
-59
lines changed

2 files changed

+103
-59
lines changed

packages/document/docs/en/config/options/options.mdx

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ This is the options for the [RsdoctorWebpackPlugin](#rsdoctorwebpackplugin) and
7777
- [disableClientServer](#disableclientserver)
7878
- [features](#features)
7979

80+
### brief
81+
82+
<Badge text="Version: 0.4.0" type="warning" />
83+
84+
- **Type:** [BriefType](#brieftype)
85+
- **Optional:** `true`
86+
- **Default:** undefined
87+
88+
More configurations for Brief mode are as follows:
89+
90+
- **reportHtmlName:** Configures the name of the HTML report for Brief mode. The default value is `report-rsdoctor.html`.
91+
- **writeDataJson:** By default, in Brief mode, the analysis data is injected into the HTML file, so no additional build analysis data is generated. If you want to generate additional local data, you need to configure `writeDataJson: true`.
92+
93+
#### briefType
94+
95+
```ts
96+
interface BriefConfig {
97+
reportHtmlName?: string | undefined;
98+
writeDataJson: boolean;
99+
}
100+
```
101+
80102
### disableClientServer
81103

82104
- **Type:** `boolean`
@@ -151,39 +173,19 @@ import ModeIntro from '@en/shared/mode-intro.md';
151173

152174
<ModeIntro />
153175

154-
### reportDir
176+
### output
155177

156-
<Badge text="Version: 0.4.0" type="warning" />
178+
<Badge text="Version 1.0.0" type="warning" />
179+
180+
#### reportDir
157181

158182
- **Type:** string
159183
- **Optional:** `true`
160184
- **Default:** undefined
161185

162186
The output directory for Rsdoctor reports. By default, it is the build output directory.
163187

164-
### brief
165-
166-
<Badge text="Version: 0.4.0" type="warning" />
167-
168-
- **Type:** [BriefType](#brieftype)
169-
- **Optional:** `true`
170-
- **Default:** undefined
171-
172-
More configurations for Brief mode are as follows:
173-
174-
- **reportHtmlName:** Configures the name of the HTML report for Brief mode. The default value is `report-rsdoctor.html`.
175-
- **writeDataJson:** By default, in Brief mode, the analysis data is injected into the HTML file, so no additional build analysis data is generated. If you want to generate additional local data, you need to configure `writeDataJson: true`.
176-
177-
#### briefType
178-
179-
```ts
180-
interface BriefConfig {
181-
reportHtmlName?: string | undefined;
182-
writeDataJson: boolean;
183-
}
184-
```
185-
186-
### reportCodeType
188+
#### reportCodeType
187189

188190
- Type: `{ noModuleSource?: boolean; noAssetsAndModuleSource?: boolean }`
189191
- Optional: true
@@ -206,6 +208,34 @@ new RsdoctorRspackPlugin({
206208
}),
207209
```
208210

211+
#### compressData
212+
213+
- **Type:** boolean
214+
- **Optional:** `true`
215+
- **Default:** true
216+
217+
compressData is used to configure whether to compress the analysis data under [outputDir]/.rsdoctor.
218+
219+
### port
220+
221+
- **Type:** `number`
222+
- **Optional:** `true`
223+
- **Default:** `random(3000, 8999)`
224+
225+
Configure the port for the Rsdoctor server.
226+
227+
### ~~reportCodeType [**Deprecated**]~~
228+
229+
<Badge text="Deprecated" type="warning" />
230+
231+
Please use [output.reportCodeType](#reportcodetype)
232+
233+
### ~~reportDir [**Deprecated**]~~
234+
235+
<Badge text="Deprecated" type="warning" />
236+
237+
Please use [output.reportDir](#reportDir)
238+
209239
### supports
210240

211241
- **Type:** [Supports Types](#supports-types)
@@ -282,11 +312,3 @@ Whether to enable the ability to generate tile graphs, which affects whether the
282312
width="500px"
283313
style={{ margin: 'auto' }}
284314
/>
285-
286-
### port
287-
288-
- **Type:** `number`
289-
- **Optional:** `true`
290-
- **Default:** `random(3000, 8999)`
291-
292-
Configure the port for the Rsdoctor server.

packages/document/docs/zh/config/options/options.mdx

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,16 @@ import ModeIntro from '@zh/shared/mode-intro.md';
153153

154154
<ModeIntro />
155155

156-
### reportDir
156+
#### banner
157157

158-
<Badge text="Version: 0.4.0" type="warning" />
158+
:::danger
159+
开启 BannerPlugin 分析时,请勿在生产版本中使用 Rsdoctor。
160+
:::
159161

160-
- **Type:** string
161-
- **Optional:** `true`
162-
- **Default:** undefined
162+
- default: true.
163+
- type: boolean.
163164

164-
Rsdoctor 报告输出目录,默认是构建产物输出目录。
165+
如果开启 `supports.banner` 则会开启 Rsdoctor 对 BannerPlugin 的兼容逻辑。详细请看:[支持 BannerPlugin](../../guide/usage/bundle-size#%E6%94%AF%E6%8C%81-bannerplugin)
165166

166167
### brief
167168

@@ -185,7 +186,11 @@ interface BriefConfig {
185186
}
186187
```
187188

188-
### reportCodeType
189+
### output
190+
191+
<Badge text="Version: 1.0.0" type="warning" />
192+
193+
#### reportCodeType
189194

190195
- Type: `{ noModuleSource?: boolean; noAssetsAndModuleSource?: boolean }`
191196
- Optional: true
@@ -205,6 +210,42 @@ new RsdoctorRspackPlugin({
205210
}),
206211
```
207212

213+
#### reportDir
214+
215+
- **Type:** string
216+
- **Optional:** `true`
217+
- **Default:** undefined
218+
219+
Rsdoctor 报告输出目录,默认是构建产物输出目录。
220+
221+
#### compressData
222+
223+
- **Type:** boolean
224+
- **Optional:** `true`
225+
- **Default:** true
226+
227+
compressData 用于配置是否将 [outputDir]/.rsdoctor 下的分析数据进行压缩处理。
228+
229+
### port
230+
231+
- **Type:** `number`
232+
- **Optional:** `true`
233+
- **Default:** `random(3000, 8999)`
234+
235+
配置 Rsdoctor 服务的端口。
236+
237+
### ~~reportCodeType [**Deprecated**]~~
238+
239+
<Badge text="Deprecated" type="warning" />
240+
241+
请使用 [output.reportCodeType](#reportcodetype)
242+
243+
### ~~reportDir [**Deprecated**]~~
244+
245+
<Badge text="Deprecated" type="warning" />
246+
247+
请使用 [output.reportDir](#reportDir)
248+
208249
### supports
209250

210251
- **Type:** [Supports Types](#supports-types)
@@ -223,17 +264,6 @@ type ISupport = {
223264
};
224265
```
225266

226-
#### banner
227-
228-
:::danger
229-
开启 BannerPlugin 分析时,请勿在生产版本中使用 Rsdoctor。
230-
:::
231-
232-
- default: true.
233-
- type: boolean.
234-
235-
如果开启 `supports.banner` 则会开启 Rsdoctor 对 BannerPlugin 的兼容逻辑。详细请看:[支持 BannerPlugin](../../guide/usage/bundle-size#%E6%94%AF%E6%8C%81-bannerplugin)
236-
237267
#### parseBundle
238268

239269
- default: true.
@@ -281,11 +311,3 @@ chain.plugin('Rsdoctor').use(RsdoctorRspackPlugin, [
281311
width="500px"
282312
style={{ margin: 'auto' }}
283313
/>
284-
285-
### port
286-
287-
- **Type:** `number`
288-
- **Optional:** `true`
289-
- **Default:** `random(3000, 8999)`
290-
291-
配置 Rsdoctor 服务的端口。

0 commit comments

Comments
 (0)