From 3784334b5763845b281e8bb6c3cc4824d5d9397b Mon Sep 17 00:00:00 2001 From: thjiang Date: Fri, 17 Feb 2023 16:41:45 +0800 Subject: [PATCH 1/2] :bug: fix: update compiler.plugin to compiler.hooks --- src/server/index.js | 6 +++--- src/server/reporter-util.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index 443c457..463b7e4 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,7 +108,7 @@ class Jarvis { done(); }); - compiler.plugin("run", (c, done) => { + compiler.hooks.run.tap("Jarvis", (c, done) => { this.env.watching = false; done(); }); @@ -124,7 +124,7 @@ class Jarvis { ); // 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 = `