diff --git a/packages/document/docs/en/config/options/options.mdx b/packages/document/docs/en/config/options/options.mdx index 10f8e27a..0e6b29ee 100644 --- a/packages/document/docs/en/config/options/options.mdx +++ b/packages/document/docs/en/config/options/options.mdx @@ -1,3 +1,5 @@ +import { Badge } from '@theme'; + # Options ## RsdoctorRspackPlugin @@ -137,18 +139,22 @@ import FeaturesRspack from '@en/shared/features-rspack.md'; ### mode + + - **Type:** `normal | brief | lite` - **Optional:** `true` - **Default:** `normal` Choose the Rsdoctor build report mode to use, which includes the following options: -- normal: Normal mode, which generates a '.rsdoctor' folder in the build output directory. It contains different data files and the report page displays code. The output directory can be configured using [reportDir](#reportdir). -- brief: Brief mode, which generates an HTML report file in the `.rsdoctor` folder of the build output directory. You can open this HTML file in a browser to view the report. Brief mode also has additional configuration options, see [brief](#brief). -- lite: Lite mode, which is a mode based on normal mode that does not display source code and bundles codes. It only displays information about the built codes. +import ModeIntro from '@en/shared/mode-intro.md'; + + ### reportDir + + - **Type:** string - **Optional:** `true` - **Default:** undefined @@ -157,6 +163,8 @@ The output directory for Rsdoctor reports. By default, it is the build output di ### brief + + - **Type:** [BriefType](#brieftype) - **Optional:** `true` - **Default:** undefined diff --git a/packages/document/docs/en/guide/start/cicd.mdx b/packages/document/docs/en/guide/start/cicd.mdx index 5a0250e0..eec30dd5 100644 --- a/packages/document/docs/en/guide/start/cicd.mdx +++ b/packages/document/docs/en/guide/start/cicd.mdx @@ -1,3 +1,5 @@ +import { Badge } from '@theme'; + # CI/CD Tutorial In CI/CD, there is often a desire to upload historical reports to the CDN as historical records. Because it's not convenient to achieve instant use in the standard mode, the **Brief** mode is supported. @@ -8,7 +10,9 @@ In Brief mode, data reports are integrated into a single HTML page, making it ea ### Enabling Brief Mode -You can enable Brief mode by configuring the `mode.brief` option in the Rsdoctor plugin. After the build, Brief mode will generate a report in the build output directory: `[outputDir]/.rsdoctor/report-rsdoctor.html`. You can view the build analysis summary by opening the HTML file in a browser. + + +You can enable Brief mode by configuring the [mode.brief](/config/options/options#mode) option in the Rsdoctor plugin. After the build, Brief mode will generate a report in the build output directory: `[outputDir]/.rsdoctor/report-rsdoctor.html`. You can view the build analysis summary by opening the HTML file in a browser. - In Brief mode, no code data is displayed to prevent the page from crashing due to large data sizes. - The report output directory and file name can be configured. Refer to: [Options](/config/options/options#brief). @@ -28,3 +32,11 @@ module.exports = { ].filter(Boolean), }; ``` + +### Differences between Brief Mode and Lite Mode + +Currently, Rsdoctor has several report modes: `Normal, Brief, and Lite`. + +import ModeIntro from '@en/shared/mode-intro.md'; + + diff --git a/packages/document/docs/en/shared/mode-intro.md b/packages/document/docs/en/shared/mode-intro.md new file mode 100644 index 00000000..17761df6 --- /dev/null +++ b/packages/document/docs/en/shared/mode-intro.md @@ -0,0 +1,4 @@ +- **normal:** Normal mode, which generates a `.rsdoctor` folder in the build output directory. It contains different data files and the report page displays code. The output directory can be configured using [reportDir](/config/options/options#reportdir). + +- **brief:** Brief mode, which generates an HTML report file in the `.rsdoctor` folder of the build output directory. All the build analysis data will be integrated and injected into this HTML file. You can open this HTML file in a browser to view the report. Brief mode also has additional configuration options, see [brief](/config/options/options#brief). +- **lite:** Lite mode, which is a mode based on normal mode that does not display source code and bundles codes. It only displays information about the built codes. diff --git a/packages/document/docs/zh/config/options/options.mdx b/packages/document/docs/zh/config/options/options.mdx index 81994735..024459f6 100644 --- a/packages/document/docs/zh/config/options/options.mdx +++ b/packages/document/docs/zh/config/options/options.mdx @@ -1,3 +1,5 @@ +import { Badge } from '@theme'; + # Options 配置 ## RsdoctorRspackPlugin 插件 @@ -139,18 +141,22 @@ import FeaturesRspack from '@zh/shared/features-rspack.md'; ### mode + + - **Type:** `normal | brief | lite` - **Optional:** `true` - **Default:** `normal` 选择使用的 Rsdoctor 构建报告模式,有以下几种: -- normal:普通模式,会在构建产物目录生成 '.rsdoctor' 文件夹,里面会有不同的数据文件,报告页面中会有代码展示。输出目录可配置:[reportDir](#reportdir). -- brief: 简报模式,会在构建产物目录的 '.rsdoctor' 文件夹中生成一个 HTML 报告文件,可通过在浏览器中打开这个 HTML 查看报告.brief 模式还有更多配置项,查看:[brief](#brief) -- lite: 轻量模式,这个模式是在普通模式基础下不展示源码和产物代码的模式,只展示打包后的代码信息。 +import ModeIntro from '@zh/shared/mode-intro.md'; + + ### reportDir + + - **Type:** string - **Optional:** `true` - **Default:** undefined @@ -159,6 +165,8 @@ Rsdoctor 报告输出目录,默认是构建产物输出目录。 ### brief + + - **Type:** [BriefType](#brieftype) - **Optional:** `true` - **Default:** undefined diff --git a/packages/document/docs/zh/guide/start/cicd.mdx b/packages/document/docs/zh/guide/start/cicd.mdx index 22a4b095..599fa857 100644 --- a/packages/document/docs/zh/guide/start/cicd.mdx +++ b/packages/document/docs/zh/guide/start/cicd.mdx @@ -1,3 +1,5 @@ +import { Badge } from '@theme'; + # CI/CD 使用教程 CI/CD 中,往往想要上报历史报告到 CDN 作为历史记录,因为普通模式下无法便捷的做到即开即用,所以支持了 **Brief** 模式。 @@ -8,7 +10,9 @@ Brief 模式中,会将数据报告整合到一个 HTML 页面中,方便用 ### 开启 Brief 模式 -通过配置 Rsdoctor 插件的 `mode.brief` 选项,即可开启 Brief 模式。Brief 模式会在构建后生成一份报告到构建产物目录中: `[outputDir]/.rsdoctor/report-rsdoctor.html`,通过浏览器打开 HTML 文件, + + +通过配置 Rsdoctor 插件的 [mode.brief](/config/options/options#mode) 选项,即可开启 Brief 模式。Brief 模式会在构建后生成一份报告到构建产物目录中: `[outputDir]/.rsdoctor/report-rsdoctor.html`,通过浏览器打开 HTML 文件, 即可看到构建分析简报。 - Brief 模式下是不展示任何的代码数据的,为了防止数据过大导致页面崩溃。 @@ -30,3 +34,11 @@ module.exports = { ].filter(Boolean), }; ``` + +### Brief 模式和 Lite 模式的区别 + +目前 Rsdoctor 有几种报告模式:`Normal、Brief 和 Lite`。 + +import ModeIntro from '@zh/shared/mode-intro.md'; + + diff --git a/packages/document/docs/zh/shared/mode-intro.md b/packages/document/docs/zh/shared/mode-intro.md new file mode 100644 index 00000000..692dd888 --- /dev/null +++ b/packages/document/docs/zh/shared/mode-intro.md @@ -0,0 +1,3 @@ +- **normal:** 普通模式,会在构建产物目录生成 `.rsdoctor` 文件夹,里面会有不同的数据文件,报告页面中会有代码展示。输出目录可配置:[reportDir](/config/options/options#reportdir). +- **brief:** 简报模式,会在构建产物目录的 `.rsdoctor` 文件夹中生成一个 HTML 报告文件,所有的构建分析数据会整合注入到这个 HTML 文件中,可通过在浏览器中打开这个 HTML 查看报告.brief 模式还有更多配置项,查看:[brief](/config/options/options#brief) +- **lite:** 轻量模式,这个模式是在普通模式基础下不展示源码和产物代码的模式,只展示打包后的代码信息。 diff --git a/packages/document/package.json b/packages/document/package.json index a7d8eed7..3924957f 100644 --- a/packages/document/package.json +++ b/packages/document/package.json @@ -38,6 +38,6 @@ "dependencies": { "react-markdown": "^9.0.1", "@rstack-dev/doc-ui": "^1.2.0", - "rspress": "^1.26.3" + "rspress": "^1.28.2" } }