@rsdoctor/docs 1.2.3 → 1.2.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/docs/en/{_meta.json → _nav.json} +5 -0
  2. package/docs/en/blog/release/release-note-1_0.mdx +2 -2
  3. package/docs/en/config/options/_meta.json +13 -1
  4. package/docs/en/config/options/brief.mdx +35 -0
  5. package/docs/en/config/options/disableClientServer.mdx +11 -0
  6. package/docs/en/config/options/experiments.mdx +21 -0
  7. package/docs/en/config/options/features.mdx +70 -0
  8. package/docs/en/config/options/mode.mdx +20 -0
  9. package/docs/en/config/options/options-v2.mdx +40 -0
  10. package/docs/en/config/options/options.mdx +61 -266
  11. package/docs/en/config/options/output.mdx +162 -0
  12. package/docs/en/config/options/port.mdx +7 -0
  13. package/docs/en/config/options/supports.mdx +72 -0
  14. package/docs/en/config/options/term.mdx +35 -2
  15. package/docs/en/guide/more/faq.mdx +14 -14
  16. package/docs/en/guide/rules/rule-custom.mdx +1 -11
  17. package/docs/en/guide/start/cli.mdx +5 -5
  18. package/docs/en/guide/start/intro.mdx +1 -1
  19. package/docs/en/guide/start/quick-start-shared.mdx +1 -1
  20. package/docs/en/guide/usage/bundle-size.mdx +1 -1
  21. package/docs/en/guide/usage/module-analysis.mdx +1 -2
  22. package/docs/en/shared/mode-intro.md +2 -1
  23. package/docs/public/netlify.toml +12 -0
  24. package/docs/zh/{_meta.json → _nav.json} +5 -0
  25. package/docs/zh/blog/release/release-note-1_0.mdx +1 -1
  26. package/docs/zh/config/options/_meta.json +13 -1
  27. package/docs/zh/config/options/brief.mdx +35 -0
  28. package/docs/zh/config/options/disableClientServer.mdx +11 -0
  29. package/docs/zh/config/options/experiments.mdx +21 -0
  30. package/docs/zh/config/options/features.mdx +70 -0
  31. package/docs/zh/config/options/mode.mdx +20 -0
  32. package/docs/zh/config/options/options-v2.mdx +40 -0
  33. package/docs/zh/config/options/options.mdx +61 -265
  34. package/docs/zh/config/options/output.mdx +162 -0
  35. package/docs/zh/config/options/port.mdx +7 -0
  36. package/docs/zh/config/options/supports.mdx +71 -0
  37. package/docs/zh/config/options/term.mdx +33 -0
  38. package/docs/zh/guide/more/faq.mdx +12 -12
  39. package/docs/zh/guide/rules/rule-custom.mdx +1 -11
  40. package/docs/zh/guide/start/cli.mdx +5 -5
  41. package/docs/zh/guide/start/intro.mdx +1 -1
  42. package/docs/zh/guide/start/quick-start-shared.mdx +1 -1
  43. package/docs/zh/guide/usage/module-analysis.mdx +1 -2
  44. package/docs/zh/shared/mode-intro.md +1 -0
  45. package/package.json +17 -14
@@ -0,0 +1,162 @@
1
+ import { Badge } from '@theme';
2
+
3
+ # output
4
+
5
+ ## mode
6
+
7
+ <Badge text="V1.2.4 Added" type="tip" />
8
+
9
+ - **Type:** `"normal" | "brief"`
10
+
11
+ Rsdoctor report mode, default is `normal`.
12
+
13
+ - **normal:** Generates a `.rsdoctor` folder in the build output directory, containing various data files and displaying code in the report page. The output directory can be configured via [reportDir](#reportdir).
14
+ - **brief:** Generates an HTML report file in the `.rsdoctor` folder of the build output directory. All build analysis data is integrated and injected into this HTML file, which can be opened in a browser to view the report. Brief mode has more configuration options, see [brief](#brief) for details.
15
+
16
+ :::tip
17
+ Mode does not have a lite configuration option. The lite mode will be deprecated. Refer to [lite mode deprecation notice](./options-v2.mdx#lite-mode-deprecation-notice).
18
+ :::
19
+
20
+ ## options
21
+
22
+ <Badge text="V1.2.4 Added" type="tip" />
23
+
24
+ - **Type:** `BriefModeOptions | NormalModeOptions`
25
+ - **Optional:** `true`
26
+ - **Default:** `undefined`
27
+ - **Description:**
28
+ Based on different `mode` configurations, `options` supports different configuration items:
29
+
30
+ ### mode: 'brief'
31
+
32
+ Brief mode is used to generate lightweight analysis reports, supporting both HTML and JSON output formats.
33
+
34
+ - **`type`**: Output type, supports `'html'` and `'json'` arrays, allowing multiple formats to be selected simultaneously
35
+ - **`htmlOptions`**: HTML output related configuration
36
+ - **`reportHtmlName`**: HTML report filename, defaults to `report-rsdoctor.html`
37
+ - **`jsonOptions`**: JSON output related configuration
38
+ - **`sections`**: Module configuration for JSON output
39
+ - **`moduleGraph`**: Whether to include module graph data, defaults to `true`
40
+ - **`chunkGraph`**: Whether to include Chunk graph data, defaults to `true`
41
+ - **`rules`**: Whether to include rules data, defaults to `true`
42
+
43
+ **Configuration Example:**
44
+
45
+ ```js
46
+ new RsdoctorRspackPlugin({
47
+ output: {
48
+ mode: 'brief',
49
+ options: {
50
+ // Output both HTML and JSON formats
51
+ type: ['html', 'json'],
52
+ htmlOptions: {
53
+ reportHtmlName: 'my-report.html',
54
+ },
55
+ },
56
+ },
57
+ });
58
+ ```
59
+
60
+ **Notes:**
61
+
62
+ - In Brief mode, the **`reportCodeType`** configuration item is invalid because only **`'noCode'`** is supported.
63
+ - In Brief mode, when **type is 'html'**, analysis data is directly injected into the HTML file, making it convenient for single-file sharing.
64
+ - In Brief mode, when **type is 'json'**, structured data files are generated, making it convenient for programmatic processing.
65
+
66
+ ### mode: 'normal'
67
+
68
+ In Normal mode, `options` is an empty object with no additional configuration items.
69
+
70
+ ### Type Definitions
71
+
72
+ #### BriefModeOptions
73
+
74
+ ```ts
75
+ interface BriefModeOptions {
76
+ /** Output type, supports HTML and JSON */
77
+ type?: Array<'html' | 'json'>;
78
+ /** HTML output related configuration */
79
+ htmlOptions?: BriefConfig;
80
+ /** JSON output related configuration */
81
+ jsonOptions?: JsonOptions;
82
+ }
83
+
84
+ interface BriefConfig {
85
+ /** HTML report filename, defaults to report-rsdoctor.html */
86
+ reportHtmlName?: string;
87
+ /** Whether to additionally generate JSON data files, defaults to false */
88
+ writeDataJson: boolean;
89
+ }
90
+
91
+ interface JsonOptions {
92
+ /** Module configuration for JSON output */
93
+ sections?: JsonSectionOptions;
94
+ }
95
+
96
+ interface JsonSectionOptions {
97
+ /** Whether to include module graph data, defaults to true */
98
+ moduleGraph?: boolean;
99
+ /** Whether to include Chunk graph data, defaults to true */
100
+ chunkGraph?: boolean;
101
+ /** Whether to include rules data, defaults to true */
102
+ rules?: boolean;
103
+ }
104
+ ```
105
+
106
+ #### NormalModeOptions
107
+
108
+ NormalModeOptions currently has an empty Object type.
109
+
110
+ ## reportCodeType
111
+
112
+ - **Type:** `"noModuleSource" | "noAssetsAndModuleSource" | "noCode" | { noModuleSource?: boolean; noAssetsAndModuleSource?: boolean; noCode?: boolean }`
113
+ - **In V2, only String type will be supported.**
114
+ - **Optional:** `true`
115
+ - **Default:** `undefined`, when undefined, outputs all complete data.
116
+ - **Description:**
117
+ Select the scope of output analysis data:
118
+ - **Default**: Output all complete data
119
+ - **`noModuleSource`**: Output data excluding module ([Module](https://rspack.rs/config/module#module)) code. Module code refers to the packaged module code of individual files within the Bundle.
120
+ - **`noAssetsAndModuleSource`**: Output data excluding module ([Module](https://rspack.rs/config/module#module)) code and Assets product code
121
+ - **`noCode`**: Output data excluding code, i.e., no code is output
122
+
123
+ ### Output Data Comparison Table
124
+
125
+ | Configuration | Included Data | Excluded Data | Use Cases | File Size |
126
+ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------- |
127
+ | **Default** (No Config) | **Complete build information:**<br/>• Module graph data and its bundled code<br/>• Assets code<br/>• Other analysis data | None | • Development debugging<br/>• Complete analysis | Largest |
128
+ | **noModuleSource** | • Build information<br/>• Module graph data and its bundled code<br/>• Assets code<br/>• Other analysis data | Module source code | • No need to view source code<br/>• Memory leak issues | Medium |
129
+ | **noAssetsAndModuleSource** | • Build information<br/>• Module graph data and its bundled code<br/>• Other analysis data | Module source code, Assets code | • Large projects<br/>• No need to view source code and Assets code<br/>• Memory leak issues | Smaller |
130
+ | **noCode** | • Build information<br/>• Module graph data<br/>• Other analysis data | All code (Module source code + Module bundled code + Assets code) | • Large projects<br/>• CI/CD<br/>• Memory leak issues | Smallest |
131
+
132
+ **Data output order from rich to simple:** `Default` > `noModuleSource` > `noAssetsAndModuleSource` > `noCode`
133
+
134
+ > For the explanation of Asset and Module, see [Term](./term).
135
+
136
+ - **Example:**
137
+
138
+ ```js
139
+ new RsdoctorRspackPlugin({
140
+ reportCodeType: { noModuleSource: true } // { noAssetsAndModuleSource: true }
141
+ }),
142
+ ```
143
+
144
+ ## reportDir
145
+
146
+ - **Type:** `string`
147
+ - **Optional:** `true`
148
+ - **Default:** `undefined`
149
+
150
+ The output directory for Rsdoctor reports. By default, it is the build output directory.
151
+
152
+ ## compressData
153
+
154
+ :::warning
155
+ Deprecated in V2, please use `output.mode: 'brief'` and `output.options.type: 'json'` instead. Refer to [compressData configuration migration](/config/options/options-v2#compressdata).
156
+ :::
157
+
158
+ - **Type:** `boolean`
159
+ - **Optional:** `true`
160
+ - **Default:** `true`
161
+
162
+ compressData is used to configure whether to compress the analysis data under `[outputDir]/.rsdoctor`.
@@ -0,0 +1,7 @@
1
+ # port
2
+
3
+ - **Type:** `number`
4
+ - **Optional:** `true`
5
+ - **Default:** `random(3000, 8999)`
6
+
7
+ Configure the port for the Rsdoctor server.
@@ -0,0 +1,72 @@
1
+ import { Badge } from '@theme';
2
+
3
+ # supports
4
+
5
+ - **Type:** [Supports Types](#supports-types)
6
+ - **Optional:** `true`
7
+ - **Default:** `undefined`
8
+
9
+ This option is used to configure whether Rsdoctor enables support for certain detailed feature analysis capabilities, such as whether to enable compatibility with BannerPlugin.
10
+
11
+ ## supportsTypes
12
+
13
+ ```ts
14
+ type ISupport = {
15
+ banner?: boolean;
16
+ parseBundle?: boolean;
17
+ generateTileGraph?: boolean;
18
+ };
19
+ ```
20
+
21
+ ## banner
22
+
23
+ :::danger
24
+ `supports.banner` option is only used for debugging, do not use it in production.
25
+ :::
26
+
27
+ - **Type:** `boolean`
28
+ - **Default:** `true`
29
+
30
+ 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)
31
+
32
+ ## ~~generateTileGraph [**Deprecated**]~~
33
+
34
+ <Badge text="Deprecated" type="warning" />
35
+
36
+ Rsdoctor supports generating Tree Map graphs by default, so this option does not need to be configured.
37
+
38
+ ## parseBundle
39
+
40
+ - **Type:** `boolean`
41
+ - **Default:** `true`
42
+
43
+ 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.
44
+ If this capability is not necessary, it can be selectively disabled using the supports.parseBundle configuration. An example is shown below:
45
+
46
+ ```ts
47
+ chain.plugin('Rsdoctor').use(RsdoctorRspackPlugin, [
48
+ {
49
+ supports: {
50
+ parseBundle: false,
51
+ },
52
+ },
53
+ ]);
54
+ ```
55
+
56
+ Disabling the Parse Bundle capability will only affect the visibility of the Bundled Size and Bundled Code of the modules in the bundle:
57
+
58
+ <div style={{ display: 'flex' }}>
59
+ <img
60
+ src="https://assets.rspack.rs/others/assets/rsdoctor/bundled-size.jpeg"
61
+ height="300px"
62
+ width="300px"
63
+ style={{ margin: 'auto' }}
64
+ />
65
+
66
+ <img
67
+ src="https://assets.rspack.rs/others/assets/rsdoctor/bundled-code.png"
68
+ height="300px"
69
+ width="400px"
70
+ style={{ margin: 'auto' }}
71
+ />
72
+ </div>
@@ -1,10 +1,43 @@
1
1
  # Terminology
2
2
 
3
- ## Common terminology
3
+ ## Common Terminology
4
4
 
5
5
  ### manifest.json
6
6
 
7
7
  When your project integrates with plugins provided by **Rsdoctor** (such as `@rsdoctor/webpack-plugin`, etc.), Rsdoctor will write **build-related data information** into a local JSON file:
8
8
 
9
9
  - The **filename is `manifest.json`**
10
- - The output path of this file is `output directory of the project/.rsdoctor/manifest.json`
10
+ - The output **path is `project output directory/.rsdoctor/manifest.json`**
11
+
12
+ ### Artifact Terminology Definitions
13
+
14
+ ### assets (Resources | Artifact Files)
15
+
16
+ **Definition:**
17
+ Refers to all static files in the project, such as images, fonts, CSS, JS, SVG, etc. They are files that are output to the target directory after build and will eventually be loaded and used by the browser.
18
+
19
+ **Examples:**
20
+
21
+ - `logo.png`, `main.css`, `app.js` are all assets.
22
+
23
+ ### chunk
24
+
25
+ **Definition:**
26
+ Rspack will package multiple modules (JS, CSS, etc.) into one or more files, and these files are bundles. A chunk may contain multiple Assets, for example: a chunk named index may contain two artifacts: index.js and index.css.
27
+
28
+ ### module
29
+
30
+ **Definition:**
31
+ In Rspack, any file can be considered a module. The most common are JS modules (via `import` or `require`), but they can also be CSS, images, etc. Modules are the smallest units in the build process, and Rspack organizes them through a dependency graph. Assets are composed of collections of Modules.
32
+
33
+ **Examples:**
34
+
35
+ - Third-party files or source files, such as `index.js`, `button.js`, `style.css`, are all modules. These files are not artifact files, but they participate in the packaging process of artifact files and may eventually be packaged into artifact files.
36
+
37
+ ### Summary Comparison
38
+
39
+ | English Name | Role in Rspack |
40
+ | ------------ | ---------------------------------------------------------- |
41
+ | assets | Final artifacts, static files |
42
+ | chunk | Output packaged files, a chunk may contain multiple assets |
43
+ | module | Smallest unit in build, source files |
@@ -12,9 +12,9 @@ new RsdoctorRspackPlugin({
12
12
  });
13
13
  ```
14
14
 
15
- ## Loader time-consuming data is inaccurate?
15
+ ## Loader timing data is inaccurate?
16
16
 
17
- The time-consuming data provided by Rsdoctor for loaders is an **estimated time**. Why can't it accurately measure the timing? It's because we know that loader execution can be both **asynchronous** and **synchronous**.
17
+ The timing data provided by Rsdoctor for loaders is an **estimated time**. Why can't it accurately measure the timing? It's because we know that loader execution can be both **asynchronous** and **synchronous**.
18
18
  Additionally, the bundler will **parallelize the execution** of multiple non-conflicting loader functions. Since JavaScript is single-threaded, multiple loader functions can **compete for the current task queue**.
19
19
  Furthermore, the asynchronous logic within loader functions cannot be recognized, causing a single loader function to potentially span across the execution of multiple other loaders. As a result, there are three possible cases, as shown in the following diagram:
20
20
 
@@ -96,19 +96,19 @@ export default {
96
96
  - In the rspeedy project, configure it in `rspeedy.config.ts`:
97
97
 
98
98
  ```js rspeedy.config.ts
99
- export default {
100
- tools: {
101
- rspack(config, { env }) {
102
- if (process.env.RSDOCTOR === 'true') {
103
- config.optimization = {
104
- ...config.optimization,
105
- concatenateModules: false,
106
- },
107
- return config
108
- }
109
- },
99
+ export default {
100
+ tools: {
101
+ rspack(config, { env }) {
102
+ if (process.env.RSDOCTOR === 'true') {
103
+ config.optimization = {
104
+ ...config.optimization,
105
+ concatenateModules: false,
106
+ };
107
+ return config;
108
+ }
110
109
  },
111
- };
110
+ },
111
+ };
112
112
  ```
113
113
 
114
114
  ## The loader of CssExtractRspackPlugin takes too long
@@ -72,7 +72,7 @@ When writing custom rules, in addition to installing the basic `@rsdoctor/rspack
72
72
 
73
73
  import { PackageManagerTabs } from '@theme';
74
74
 
75
- import { Tab, Tabs } from 'rspress/theme';
75
+ import { Tab, Tabs } from '@rspress/core/theme';
76
76
 
77
77
  <PackageManagerTabs command="add @rsdoctor/core -D" />
78
78
 
@@ -199,19 +199,15 @@ At the same time, Rsdoctor also has two components that can be used to display r
199
199
  [LinkRule Type](#linkrulestoredata)
200
200
 
201
201
  - Component Input
202
-
203
202
  - type
204
-
205
203
  - The type of the component.
206
204
  - value: 'link'.
207
205
 
208
206
  - title
209
-
210
207
  - The title of the rule.
211
208
  - type: string.
212
209
 
213
210
  - description
214
-
215
211
  - The description of the rule. The data comes from the `message` or `detail.description` in the `report` function:
216
212
  ```js
217
213
  report({
@@ -225,7 +221,6 @@ At the same time, Rsdoctor also has two components that can be used to display r
225
221
  - type: string.
226
222
 
227
223
  - level
228
-
229
224
  - The level of the rule.
230
225
  - type: warn | error.
231
226
 
@@ -266,19 +261,15 @@ report({
266
261
  [CodeViewRule Type](#codeviewrule)
267
262
 
268
263
  - Component Input
269
-
270
264
  - type
271
-
272
265
  - The type of the component.
273
266
  - value: 'code-view'.
274
267
 
275
268
  - title
276
-
277
269
  - The title of the rule.
278
270
  - type: string.
279
271
 
280
272
  - description
281
-
282
273
  - The description of the rule. The data comes from the `message` or `detail.description` in the `report` function:
283
274
  ```js
284
275
  report({
@@ -292,7 +283,6 @@ report({
292
283
  - type: string.
293
284
 
294
285
  - level
295
-
296
286
  - The level of the rule.
297
287
  - type: warn | error.
298
288
 
@@ -17,7 +17,7 @@ We provide `@rsdoctor/cli` for you to use Rsdoctor's features locally through th
17
17
 
18
18
  import { PackageManagerTabs } from '@theme';
19
19
 
20
- import { Tab, Tabs } from 'rspress/theme';
20
+ import { Tab, Tabs } from '@rspress/core/theme';
21
21
 
22
22
  <PackageManagerTabs command="add @rsdoctor/cli -D" />
23
23
 
@@ -76,18 +76,18 @@ We provide a Node.js API in `@rsdoctor/cli` that allows you to make calls during
76
76
 
77
77
  <Tabs>
78
78
 
79
- <Tab label="cjs">
79
+ <Tab label="esm">
80
80
 
81
81
  ```js
82
- const { execute } = require('@rsdoctor/cli');
82
+ import { execute } from '@rsdoctor/cli';
83
83
  ```
84
84
 
85
85
  </Tab>
86
86
 
87
- <Tab label="esm">
87
+ <Tab label="cjs">
88
88
 
89
89
  ```js
90
- import { execute } from '@rsdoctor/cli';
90
+ const { execute } = require('@rsdoctor/cli');
91
91
  ```
92
92
 
93
93
  </Tab>
@@ -4,7 +4,7 @@ Rsdoctor is a build analyzer tailored for the [Rspack](https://rspack.rs/) ecosy
4
4
 
5
5
  Rsdoctor is committed to being a one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable through visualization and smart analysis, helping development teams precisely identify bottlenecks, optimize performance, and improve engineering quality.
6
6
 
7
- Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://lib.rsbuild.rs/).
7
+ Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://rslib.rs/).
8
8
 
9
9
  <video
10
10
  src="https://assets.rspack.rs/others/assets/rsdoctor/rsdoctor-1.0-ui.mp4"
@@ -84,7 +84,7 @@ For projects using Modern.js's webpack mode, please register the `RsdoctorWebpac
84
84
 
85
85
  Initialize the [RsdoctorRspackPlugin](#rspack-projects)([RsdoctorWebpackPlugin](#webpack-projects)) plugin in the [Rspack Config](https://rspack.rs/guide/tech/next)([webpack config](https://nextjs.org/docs/pages/api-reference/config/next-config-js/webpack)) of `next.config.ts`.
86
86
 
87
- import { Tab, Tabs } from 'rspress/theme';
87
+ import { Tab, Tabs } from '@rspress/core/theme';
88
88
 
89
89
  <Tabs>
90
90
 
@@ -5,7 +5,7 @@
5
5
  **Rsdoctor** provides the `Bundle Size` module, which is mainly used to analyze the information of the build artifacts of **Webpack** or **Rspack**, including the **size of resources**, **duplicate packages**, and **module reference relationships**:
6
6
 
7
7
  - **Bundle Overview**: Displays the total number and size of artifacts, as well as the number and size of each file type. It also shows the duplicate packages and their reference chains.
8
- - **Bundle Analysis Module**: Analyzes the size and code information of the build artifacts' resources (**Assets**) and the included **Modules**. In this module, you can view the **actual code size of modules after packaging** in the Assets, as well as the original code or **packaged code segments** and **module reference relationships**.
8
+ - **Bundle Analysis Module**: Analyzes the size and code information of the build artifacts (**Assets**) and the included **Modules**. In this module, you can view the **actual code size of modules after packaging** in the Assets, as well as the original code or **packaged code segments** and **module reference relationships**.
9
9
 
10
10
  <img
11
11
  src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-size-overall.png"
@@ -46,9 +46,8 @@ The `Reasons Tree` displays the dependency chain of this `Module`, showing which
46
46
  - The `Usage` tag displays the purpose of various module tags.
47
47
 
48
48
  - The `Concatenated` tag:
49
-
50
49
  - The `Concatenated` tag indicates that the module is a concatenated sub-module. Hover over it to see which main module it is aggregated into. This type of aggregated module cannot be further unpacked, so the specific `Bundled Size` cannot be determined, only the size of the entire concatenated module can be known.
51
- - Glossary: A **concatenated module** is when multiple modules are promoted or **concatenated into a closure** during packaging. For an explanation of `Concatenated Module`, refer to the [Glossary](guide/usage/bundle-size#glossary).
50
+ - Glossary: A **concatenated module** is when multiple modules are promoted or **concatenated into a closure** during packaging. For an explanation of `Concatenated Module`, refer to the [Glossary](/guide/usage/bundle-size#glossary).
52
51
 
53
52
  - The `!` tag, hover over it to display the detailed path of the module.
54
53
 
@@ -1,5 +1,6 @@
1
1
  - **normal mode:** Generates a `.rsdoctor` folder in the build output directory, which contains various data files and displays code in the report page. The output directory can be configured via [reportDir](/config/options/options#reportdir).
2
2
 
3
- - **brief mode:** Generates an HTML report file in the `.rsdoctor` folder within the build output directory. All build analysis data will be consolidated into this HTML file, which can be viewed by opening it in a browser. Brief mode also has additional configuration options, detailed at: [brief](/config/options/options#brief).
3
+ - **brief mode:** Generates an HTML report file in the `.rsdoctor` folder within the build output directory. All build analysis data will be consolidated and injected into this HTML file, which can be viewed by opening it in a browser. Brief mode also has additional configuration options, detailed at: [brief](/config/options/options#brief).
4
4
 
5
5
  - **lite mode:** Based on the normal mode, this mode does not display source code and product code, only showing the information of the bundled code.
6
+ - lite mode will be deprecated in V2, refer to [lite mode deprecation notice](/config/options/options-v2#lite).
@@ -5,6 +5,18 @@ to = "https://rsdoctor.rs/:splat"
5
5
  status = 301
6
6
  force = true
7
7
 
8
+ [[redirects]]
9
+ from = "/preview/#/"
10
+ to = "https://rsdoctor.rs"
11
+ status = 302
12
+ force = true
13
+
14
+ [[redirects]]
15
+ from = "/zh/preview/#/"
16
+ to = "https://rsdoctor.rs"
17
+ status = 302
18
+ force = true
19
+
8
20
  [[redirects]]
9
21
  from = "/*"
10
22
  to = "/404.html"
@@ -13,5 +13,10 @@
13
13
  "text": "博客",
14
14
  "link": "/blog/release/release-note-1_2",
15
15
  "activeMatch": "/blog/"
16
+ },
17
+ {
18
+ "text": "Playground",
19
+ "link": "https://rsdoctor.rs/preview/#/resources/uploader",
20
+ "activeMatch": "/preview/"
16
21
  }
17
22
  ]
@@ -46,7 +46,7 @@ Rsdoctor 致力于成为一站式、智能化的构建分析工具,通过可
46
46
 
47
47
  我们为 Rsdoctor 设计了直观的用户界面,将构建数据可视化。同时,Rsdoctor 在结合多种工具的基础上,额外扩展了 loader 分析能力以更深入 loader 的编译行为,内置了产物及编译的扫描和检测规则,并支持用户自定义规则。
48
48
 
49
- Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://lib.rsbuild.rs/) 等。
49
+ Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://rslib.rs/) 等。
50
50
 
51
51
  Rsdoctor 可以被用于:
52
52
 
@@ -1 +1,13 @@
1
- ["options", "term"]
1
+ [
2
+ "options",
3
+ "term",
4
+ "disableClientServer",
5
+ "experiments",
6
+ "features",
7
+ "output",
8
+ "port",
9
+ "supports",
10
+ "brief",
11
+ "mode",
12
+ "options-v2"
13
+ ]
@@ -0,0 +1,35 @@
1
+ # brief
2
+
3
+ import { Badge } from '@theme';
4
+
5
+ :::warning
6
+ V2 中即将废弃,请使用 [output.mode: 'brief'](/config/options/output#mode) 代替。参考 [brief 配置迁移](/config/options/options-v2#brief)。
7
+ :::
8
+
9
+ - **类型:** [BriefType](#brieftype)
10
+ - **可选:** `true`
11
+ - **默认值:** `undefined`
12
+
13
+ Brief 模式的详细配置选项如下:
14
+
15
+ - **reportHtmlName:** 配置 Brief 模式下 HTML 报告的文件名称,默认值为 `report-rsdoctor.html`。
16
+ - **writeDataJson:** (已废弃,请使用 `output.options.type: ['json', 'html']`, 参考 [output.options.type](/config/options/options-v2#options)。)默认情况下,Brief 模式会将分析数据直接注入到 HTML 文件中,因此不会额外生成构建分析数据文件。如果需要额外在本地生成 JSON 数据文件,则需要配置 `writeDataJson: true`。
17
+
18
+ ## briefType
19
+
20
+ ```ts
21
+ interface BriefConfig {
22
+ reportHtmlName?: string | undefined;
23
+ writeDataJson: boolean;
24
+ }
25
+ ```
26
+
27
+ - **示例:**
28
+
29
+ ```js
30
+ new RsdoctorRspackPlugin({
31
+ output: {
32
+ mode: 'brief',
33
+ },
34
+ });
35
+ ```
@@ -0,0 +1,11 @@
1
+ # disableClientServer
2
+
3
+ - **类型:** `boolean`
4
+ - **可选:** `true`
5
+ - **默认值:** `false`,当 `process.CI` 为 true 时,默认值为 true,即在 CI 环境中默认不启动报告服务。
6
+
7
+ :::tip
8
+ 建议在 CI 环境下将 disableClientServer 设置为 true,否则启动的服务会卡住 pipeline 流程。
9
+ :::
10
+
11
+ 是否需要自动打开 Rsdoctor 报告页面。如果你不需要在浏览器内查看本次 Rsdoctor 提供的分析报告,则可以开启这个配置项。
@@ -0,0 +1,21 @@
1
+ import { Badge } from '@theme';
2
+
3
+ # experiments
4
+
5
+ <Badge text="Version: 1.0.0" type="warning" />
6
+
7
+ ## enableNativePlugin
8
+
9
+ - **类型:** `boolean`
10
+ - **可选:** `true`
11
+ - **默认值:** `false`
12
+
13
+ 通过 enableNativePlugin 选项开启 Rspack 原生插件,将 Rsdoctor 中耗时较大的数据处理逻辑前置到 Rspack 构建阶段,从而显著提升构建分析效率并大幅降低 Rsdoctor 自身的分析耗时。
14
+
15
+ - **示例:**
16
+
17
+ ```js
18
+ new RsdoctorRspackPlugin({
19
+ experiments: { enableNativePlugin: true }
20
+ }),
21
+ ```