Skip to content

Commit

Permalink
docs: add JSDoc for PrintFileSizeOptions (#4043)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Nov 22, 2024
1 parent 50a1c99 commit e3350e3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
13 changes: 13 additions & 0 deletions packages/core/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
13 changes: 8 additions & 5 deletions website/docs/en/config/performance/print-file-size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
11 changes: 7 additions & 4 deletions website/docs/zh/config/performance/print-file-size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@

```ts
type PrintFileSizeOptions =
| boolean
| {
/**
* 是否输出所有静态资源文件的总体积
* 是否输出所有静态资源的总体积
* @default true
*/
total?: boolean;
/**
* 是否输出每个静态资源文件的体积
* 是否输出每个静态资源的体积
* @default true
*/
detail?: boolean;
/**
* 是否输出 gzip 压缩后的体积
* @default true
*/
compressed?: boolean;
}
| boolean;
};
```

- **默认值:** `true`
Expand Down

0 comments on commit e3350e3

Please sign in to comment.