From 50dcf5f64e2397b50d3ab0c9a1fec347b3c0a6d5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 12 Oct 2024 00:15:24 +0500 Subject: [PATCH] fix(vite): dim repeat count in logs (#29392) --- packages/vite/src/utils/logger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/utils/logger.ts b/packages/vite/src/utils/logger.ts index 25a89551c3..92d9311e7d 100644 --- a/packages/vite/src/utils/logger.ts +++ b/packages/vite/src/utils/logger.ts @@ -1,5 +1,6 @@ import type * as vite from 'vite' import { logger } from '@nuxt/kit' +import { colorize } from 'consola/utils' import { hasTTY, isCI } from 'std-env' import clear from 'clear' import type { NuxtOptions } from '@nuxt/schema' @@ -61,8 +62,7 @@ export function createViteLogger (config: vite.InlineConfig): vite.Logger { const prevLevel = logger.level logger.level = logLevelMapReverse[config.logLevel || 'info'] - // TODO: colorize counter after https://github.com/unjs/consola/pull/166 - logger[type](msg + (sameAsLast ? ` (x${duplicateCount + 1})` : '')) + logger[type](msg + (sameAsLast ? colorize('dim', ` (x${duplicateCount + 1})`) : '')) logger.level = prevLevel }