Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,29 @@ class Jarvis {
bootJarvis();
}

compiler.plugin("watch-run", (c, done) => {
compiler.hooks.watchRun.tap("Jarvis", (c, done) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should leave 'done' and 'done()' (in the next) in webpack5

compiler.hooks.watchRun.tap("Jarvis", (c) => {

image

if (this.options.watchOnly) {
bootJarvis();
}
this.env.watching = true;
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 => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be
compiler.hooks.done.tap("Jarvis"

if (!this.env.running) return;

const jsonStats = stats.toJson({ chunkModules: true });
Expand Down
2 changes: 1 addition & 1 deletion src/server/reporter-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<div class="stats-success-footer">
Expand Down