From d78a3568e259f9cdbc64c60290639af6ef6d3baf Mon Sep 17 00:00:00 2001 From: Jeroen Noten Date: Sat, 3 Sep 2016 10:23:16 +0200 Subject: [PATCH] No error event on compilation error when watching --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e9e0f7c..97bb636 100644 --- a/index.js +++ b/index.js @@ -139,7 +139,11 @@ module.exports = function (options, wp, done) { resultMessage += nextError.toString(); return resultMessage; }, ''); - self.emit('error', new gutil.PluginError('webpack-stream', errorMessage)); + var compilationError = new gutil.PluginError('webpack-stream', errorMessage); + if (!options.watch) { + self.emit('error', compilationError); + } + self.emit('compilation-error', compilationError); } if (!options.watch) { self.queue(null);