Skip to content

Commit

Permalink
chore: additional fixes for KiB / kB notation
Browse files Browse the repository at this point in the history
  • Loading branch information
naruaway committed Aug 16, 2023
1 parent 3b4904f commit 848f083
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Specify the directory to nest generated assets under (relative to `build.outDir`
## build.assetsInlineLimit
- **Type:** `number`
- **Default:** `4096` (4kb)
- **Default:** `4096` (4 KiB)
Imported or referenced assets that are smaller than this threshold will be inlined as base64 URLs to avoid extra http requests. Set to `0` to disable inlining altogether.
Expand Down Expand Up @@ -236,7 +236,7 @@ Enable/disable gzip-compressed size reporting. Compressing large output files ca
- **Type:** `number`
- **Default:** `500`
Limit for chunk size warnings (in kbs). It is compared against the uncompressed chunk size as the [JavaScript size itself is related to the execution time](https://v8.dev/blog/cost-of-javascript-2019).
Limit for chunk size warnings (in kB). It is compared against the uncompressed chunk size as the [JavaScript size itself is related to the execution time](https://v8.dev/blog/cost-of-javascript-2019).
## build.watch
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface BuildOptions {
assetsDir?: string
/**
* Static asset files smaller than this number (in bytes) will be inlined as
* base64 strings. Default limit is `4096` (4kb). Set to `0` to disable.
* base64 strings. Default limit is `4096` (4 KiB). Set to `0` to disable.
* @default 4096
*/
assetsInlineLimit?: number
Expand Down Expand Up @@ -234,7 +234,7 @@ export interface BuildOptions {
*/
reportCompressedSize?: boolean
/**
* Adjust chunk size warning limit (in kbs).
* Adjust chunk size warning limit (in kB).
* @default 500
*/
chunkSizeWarningLimit?: number
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
) {
config.logger.warn(
colors.yellow(
`\n(!) Some chunks are larger than ${chunkLimit} kBs after minification. Consider:\n` +
`\n(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider:\n` +
`- Using dynamic import() to code-split the application\n` +
`- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n` +
`- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`,
Expand Down

0 comments on commit 848f083

Please sign in to comment.