Skip to content

Commit 8830b85

Browse files
committed
Add compile progress indication
1 parent d8cf314 commit 8830b85

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/start.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,19 @@ function formatMessage(message) {
5757
.replace('./~/css-loader!./~/postcss-loader!', '');
5858
}
5959

60-
var compiler = webpack(config, handleCompile);
61-
compiler.plugin('done', function (stats) {
62-
// Clear the console and reset the cursor
60+
function clearConsole() {
6361
process.stdout.write('\x1B[2J\x1B[0f');
62+
}
6463

64+
var compiler = webpack(config, handleCompile);
65+
compiler.plugin('invalid', function () {
66+
clearConsole();
67+
console.log('Compiling...');
68+
});
69+
compiler.plugin('done', function (stats) {
70+
clearConsole();
6571
var hasErrors = stats.hasErrors();
6672
var hasWarnings = stats.hasWarnings();
67-
6873
if (!hasErrors && !hasWarnings) {
6974
console.log(chalk.green('Compiled successfully!'));
7075
console.log();

0 commit comments

Comments
 (0)