From 51a4a8bc7ddbfd60325e2f342071a3c3ae90d3ae Mon Sep 17 00:00:00 2001 From: Tereza Tomcova Date: Fri, 15 Feb 2019 12:29:16 +0100 Subject: [PATCH] display message on watch compilation start --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index 9edc6ea..d28a699 100644 --- a/index.js +++ b/index.js @@ -223,6 +223,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