diff --git a/src/server/index.js b/src/server/index.js index 443c457..3b48523 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -100,7 +100,7 @@ class Jarvis { bootJarvis(); } - compiler.plugin("watch-run", (c, done) => { + compiler.hooks.watchRun.tap("Jarvis", (c, done) => { if (this.options.watchOnly) { bootJarvis(); } @@ -108,23 +108,21 @@ class Jarvis { done(); }); - compiler.plugin("run", (c, done) => { + compiler.hooks.run.tap("Jarvis", (c, done) => { this.env.watching = false; done(); }); // report the webpack compiler progress - compiler.apply( - new webpack.ProgressPlugin((percentage, message) => { - this.reports.progress = { percentage, message }; - if (this.env.running) { - jarvis.io.emit("progress", { percentage, message }); - } - }) - ); + new webpack.ProgressPlugin((percentage, message) => { + this.reports.progress = { percentage, message }; + if (this.env.running) { + jarvis.io.emit("progress", { percentage, message }); + } + }).apply(compiler); // extract the final reports from the stats! - compiler.plugin("done", stats => { + compiler.hooks.run.tap("Jarvis", stats => { if (!this.env.running) return; const jsonStats = stats.toJson({ chunkModules: true }); diff --git a/src/server/reporter-util.js b/src/server/reporter-util.js index 1f42e63..27513e0 100644 --- a/src/server/reporter-util.js +++ b/src/server/reporter-util.js @@ -10,7 +10,7 @@ function configAnalyser(configs) { function _formattedError(errors = []) { const newFormat = { newline: true, escapeXML: true }; const formatter = new Formatter(newFormat); - return errors.map(error => formatter.toHtml(error)); + return errors.map(error => formatter.toHtml(error.message || '')); } const successFooter = `