From f3a34c77d76014095675db82a64ca9980e5979ab Mon Sep 17 00:00:00 2001 From: A O Date: Mon, 19 Oct 2020 21:01:56 +0500 Subject: [PATCH] fix(output): clear console on first start with `--clear` flag --- src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 130cab4..a6df49a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -103,6 +103,7 @@ export const runDev = ( */ let compileReqWatcher: chokidar.FSWatcher function start() { + if (cfg.clear) process.stdout.write('\u001bc') for (const watched of (opts.watch || '').split(',')) { if (watched) watcher.add(watched) } @@ -220,9 +221,7 @@ export const runDev = ( compiler.init() } compiler.clearErrorCompile() - - //if (cfg.clear) process.stdout.write("\u001b[2J\u001b[0;0H") - if (cfg.clear) process.stdout.write('\u001bc') + if (isManualRestart === true) { notify('Restarting', 'manual restart from user') } else {