From edaca1a2999b9afbb644bb8763582305162a630c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 9 Mar 2023 09:19:02 +0000 Subject: [PATCH] fix(vite): allow disabling clear screen behaviour (#19531) --- packages/schema/src/config/vite.ts | 2 +- packages/vite/src/utils/logger.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/schema/src/config/vite.ts b/packages/schema/src/config/vite.ts index 9f5d0c3025..f4ace56354 100644 --- a/packages/schema/src/config/vite.ts +++ b/packages/schema/src/config/vite.ts @@ -62,7 +62,7 @@ export default defineUntypedSchema({ jsxFragment: 'Fragment', tsconfigRaw: '{}' }, - clearScreen: false, + clearScreen: true, build: { assetsDir: { $resolve: async (val, get) => val ?? withoutLeadingSlash((await get('app')).buildAssetsDir) diff --git a/packages/vite/src/utils/logger.ts b/packages/vite/src/utils/logger.ts index ff0d45fda2..cf7d2452bb 100644 --- a/packages/vite/src/utils/logger.ts +++ b/packages/vite/src/utils/logger.ts @@ -23,7 +23,7 @@ export const logLevelMapReverse: Record export function createViteLogger (config: vite.InlineConfig): vite.Logger { const loggedErrors = new WeakSet() - const canClearScreen = hasTTY && !isCI + const canClearScreen = hasTTY && !isCI && config.clearScreen const clearScreen = canClearScreen ? clear : () => {} function output (type: vite.LogType, msg: string, options: vite.LogErrorOptions = {}) {