Skip to content

Commit

Permalink
Merge pull request #214 from the-ress/watch-message
Browse files Browse the repository at this point in the history
Display message on watch compilation start
  • Loading branch information
shama committed Aug 31, 2021
2 parents 991d108 + 51a4a8b commit 3287835
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.js
Expand Up @@ -241,6 +241,19 @@ module.exports = function (options, wp, done) {
} else {
handleCompiler(compiler);
}

if (options.watch && !isSilent) {
const watchRunPlugin = compiler.hooks
// Webpack 4
? callback => compiler.hooks.watchRun.tapAsync('WebpackInfo', callback)
// Webpack 2/3
: callback => compiler.plugin('watch-run', callback);

watchRunPlugin((compilation, callback) => {
fancyLog('webpack compilation starting...');
callback();
});
}
});

// If entry point manually specified, trigger that
Expand Down

0 comments on commit 3287835

Please sign in to comment.