From 8830b85d5eec9af084091c60a657890c2f8d3b5c Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Thu, 21 Jul 2016 16:44:41 +0100 Subject: [PATCH] Add compile progress indication --- scripts/start.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/start.js b/scripts/start.js index 720ab1028..3e64e6b63 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -57,14 +57,19 @@ function formatMessage(message) { .replace('./~/css-loader!./~/postcss-loader!', ''); } -var compiler = webpack(config, handleCompile); -compiler.plugin('done', function (stats) { - // Clear the console and reset the cursor +function clearConsole() { process.stdout.write('\x1B[2J\x1B[0f'); +} +var compiler = webpack(config, handleCompile); +compiler.plugin('invalid', function () { + clearConsole(); + console.log('Compiling...'); +}); +compiler.plugin('done', function (stats) { + clearConsole(); var hasErrors = stats.hasErrors(); var hasWarnings = stats.hasWarnings(); - if (!hasErrors && !hasWarnings) { console.log(chalk.green('Compiled successfully!')); console.log(); -- GitLab