Skip to content

Commit

Permalink
chore: KiB instead of kb unit (#4493)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mesteery authored Aug 5, 2021
1 parent 8178628 commit 66060ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vite/src/node/plugins/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
}
return ` / brotli: ${(
(await size(typeof code === 'string' ? code : Buffer.from(code))) / 1024
).toFixed(2)}kb`
).toFixed(2)} KiB`
}

function printFileInfo(
Expand All @@ -56,12 +56,12 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
path.resolve(config.root, config.build.outDir)
)
) + '/'
const kbs = content.length / 1024
const sizeColor = kbs > chunkLimit ? chalk.yellow : chalk.dim
const kibs = content.length / 1024
const sizeColor = kibs > chunkLimit ? chalk.yellow : chalk.dim
config.logger.info(
`${chalk.gray(chalk.white.dim(outDir))}${writeColors[type](
filePath.padEnd(maxLength + 2)
)} ${sizeColor(`${kbs.toFixed(2)}kb${compressedSize}`)}`
)} ${sizeColor(`${kibs.toFixed(2)} KiB${compressedSize}`)}`
)
}

Expand Down Expand Up @@ -207,7 +207,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
) {
config.logger.warn(
chalk.yellow(
`\n(!) Some chunks are larger than ${chunkLimit}kb after minification. Consider:\n` +
`\n(!) Some chunks are larger than ${chunkLimit} KiB after minification. Consider:\n` +
`- Using dynamic import() to code-split the application\n` +
`- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks\n` +
`- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`
Expand Down

0 comments on commit 66060ea

Please sign in to comment.