File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
2626 const compress = promisify ( gzip )
2727 const chunkLimit = config . build . chunkSizeWarningLimit
2828
29+ const numberFormatter = new Intl . NumberFormat ( 'en' , {
30+ maximumFractionDigits : 2 ,
31+ minimumFractionDigits : 2 ,
32+ } )
33+ const displaySize = ( bytes : number ) => {
34+ return `${ numberFormatter . format ( bytes / 1000 ) } kB`
35+ }
36+
2937 const tty = process . stdout . isTTY && ! process . env . CI
3038 const shouldLogInfo = LogLevels [ config . logLevel || 'info' ] >= LogLevels . info
3139 let hasTransformed = false
@@ -322,13 +330,6 @@ function throttle(fn: Function) {
322330 }
323331}
324332
325- function displaySize ( bytes : number ) {
326- return `${ ( bytes / 1000 ) . toLocaleString ( 'en' , {
327- maximumFractionDigits : 2 ,
328- minimumFractionDigits : 2 ,
329- } ) } kB`
330- }
331-
332333function displayTime ( time : number ) {
333334 // display: {X}ms
334335 if ( time < 1000 ) {
You can’t perform that action at this time.
0 commit comments