From 3ad609fa3fb351a79a3f76d12c9db8e44a10e6d0 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 22 Nov 2024 21:12:01 +0800 Subject: [PATCH] docs: add JSDoc for `PrintFileSizeOptions` --- packages/core/src/types/config.ts | 13 +++++++++++++ .../docs/en/config/performance/print-file-size.mdx | 13 ++++++++----- .../docs/zh/config/performance/print-file-size.mdx | 11 +++++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/core/src/types/config.ts b/packages/core/src/types/config.ts index e743d81f9b..26fa54d157 100644 --- a/packages/core/src/types/config.ts +++ b/packages/core/src/types/config.ts @@ -443,8 +443,21 @@ export type BuildCacheOptions = { }; export type PrintFileSizeOptions = { + /** + * Whether to print the total size of all static assets. + * @default true + */ total?: boolean; + /** + * Whether to print the size of each static asset. + * @default true + */ detail?: boolean; + /** + * Whether to print the gzip-compressed size of each static asset. + * Disable this option can save some gzip computation time for large projects. + * @default true + */ compressed?: boolean; }; diff --git a/website/docs/en/config/performance/print-file-size.mdx b/website/docs/en/config/performance/print-file-size.mdx index 24f5c3f78f..97aa9ada01 100644 --- a/website/docs/en/config/performance/print-file-size.mdx +++ b/website/docs/en/config/performance/print-file-size.mdx @@ -4,21 +4,24 @@ ```ts type PrintFileSizeOptions = + | boolean | { /** - * whether to print total size + * Whether to print the total size of all static assets. + * @default true */ total?: boolean; /** - * whether to print size of each file + * Whether to print the size of each static asset. + * @default true */ detail?: boolean; /** - * whether to print gzip-compressed size + * Whether to print the gzip-compressed size of each static asset. + * @default true */ compressed?: boolean; - } - | boolean; + }; ``` - **Default:** `true` diff --git a/website/docs/zh/config/performance/print-file-size.mdx b/website/docs/zh/config/performance/print-file-size.mdx index f80aa415cc..ff8c6ede77 100644 --- a/website/docs/zh/config/performance/print-file-size.mdx +++ b/website/docs/zh/config/performance/print-file-size.mdx @@ -4,21 +4,24 @@ ```ts type PrintFileSizeOptions = + | boolean | { /** - * 是否输出所有静态资源文件的总体积 + * 是否输出所有静态资源的总体积 + * @default true */ total?: boolean; /** - * 是否输出每个静态资源文件的体积 + * 是否输出每个静态资源的体积 + * @default true */ detail?: boolean; /** * 是否输出 gzip 压缩后的体积 + * @default true */ compressed?: boolean; - } - | boolean; + }; ``` - **默认值:** `true`