From 0ae08c86123b9de506854d8dcced67bd635b737a Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 7 Jan 2025 21:31:12 +0800 Subject: [PATCH] docs: only generate stats.json --- .../en/config/performance/bundle-analyze.mdx | 21 +++++++++++++++++++ .../zh/config/performance/bundle-analyze.mdx | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/website/docs/en/config/performance/bundle-analyze.mdx b/website/docs/en/config/performance/bundle-analyze.mdx index 9fc73e576b..95adb95b87 100644 --- a/website/docs/en/config/performance/bundle-analyze.mdx +++ b/website/docs/en/config/performance/bundle-analyze.mdx @@ -107,6 +107,27 @@ export default { }; ``` +In the output directory, you will see `stats.json` and `report-web.html` files. + +``` +└── dist + ├── stats.json + └── report-web.html +``` + +If you don't need the `report-web.html`, you can set `analyzerMode` to `disabled`. + +```js +export default { + performance: { + bundleAnalyze: { + analyzerMode: 'disabled', + generateStatsFile: true, + }, + }, +}; +``` + ## Notes 1. Enabling the server mode will cause the `build` process to not exit normally. diff --git a/website/docs/zh/config/performance/bundle-analyze.mdx b/website/docs/zh/config/performance/bundle-analyze.mdx index 0b70303761..05a8607299 100644 --- a/website/docs/zh/config/performance/bundle-analyze.mdx +++ b/website/docs/zh/config/performance/bundle-analyze.mdx @@ -107,6 +107,27 @@ export default { }; ``` +在产物目录下会生成 `stats.json` 和 `report-web.html` 文件。 + +``` +└── dist + ├── stats.json + └── report-web.html +``` + +如果你不需要 `report-web.html`,可以设置 `analyzerMode` 为 `disabled`。 + +```js +export default { + performance: { + bundleAnalyze: { + analyzerMode: 'disabled', + generateStatsFile: true, + }, + }, +}; +``` + ## 注意事项 1. 开启 Server 模式会导致 `build` 进程不能正常退出。