Skip to content
Open
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
17 changes: 4 additions & 13 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,11 @@ class WasmPackPlugin {
});
});

let first = true;

compiler.hooks.thisCompilation.tap('WasmPackPlugin', (compilation) => {
// Super hacky, needed to workaround a bug in Webpack which causes
// thisCompilation to be triggered twice on the first compilation.
if (first) {
first = false;

} else {
// This is needed in order to gracefully handle errors in Webpack,
// since Webpack has its own custom error system.
if (this.error != null) {
compilation.errors.push(this.error);
}
// This is needed in order to gracefully handle errors in Webpack,
// since Webpack has its own custom error system.
if (this.error != null) {
compilation.errors.push(this.error);
}
});
}
Expand Down