Commit 8830b85d authored by Dan Abramov's avatar Dan Abramov
Browse files

Add compile progress indication

parent d8cf3147
No related merge requests found
Showing with 9 additions and 4 deletions
+9 -4
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment