diff --git a/packages/vite/src/node/logger.ts b/packages/vite/src/node/logger.ts index a9491c477f054a..8bfa027c61fcd2 100644 --- a/packages/vite/src/node/logger.ts +++ b/packages/vite/src/node/logger.ts @@ -50,6 +50,7 @@ export interface LoggerOptions { prefix?: string allowClearScreen?: boolean customLogger?: Logger + console?: Console } // Only initialize the timeFormatter when the timestamp option is used, and @@ -73,7 +74,11 @@ export function createLogger( } const loggedErrors = new WeakSet() - const { prefix = '[vite]', allowClearScreen = true } = options + const { + prefix = '[vite]', + allowClearScreen = true, + console = globalThis.console, + } = options const thresh = LogLevels[level] const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI