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);