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 = {}) {