diff --git a/scripts/start.js b/scripts/start.js index 720ab102827518adb777e6baf12632bd5f83db70..3e64e6b6383a827a863e8f7cf6783d90afa0d9ee 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();