diff --git a/lib/main.js b/lib/main.js index ede1a1e..ed97c7d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -21,6 +21,7 @@ export default function compile(root = '', isProd = false, es) { if (isProd) { fs.rm(DIST_DIR, true) } + let ready = false chokidar .watch(SOURCE_DIR) @@ -28,6 +29,10 @@ export default function compile(root = '', isProd = false, es) { let file = filePath.slice(SOURCE_DIR.length) let target = join(DIST_DIR, file) + if (ready) { + console.clear() + } + if (act === 'add' || act === 'change') { let ext = file.slice(file.lastIndexOf('.') + 1) @@ -65,6 +70,8 @@ export default function compile(root = '', isProd = false, es) { } }) .on('ready', () => { + console.clear() + ready = true if (isProd) { process.exit() }