Skip to content

Commit

Permalink
fix(plugin-webpack): throw an error if webpack generates compilation …
Browse files Browse the repository at this point in the history
…errors when packaging (#695)

ISSUES CLOSED: #579
  • Loading branch information
malept authored and MarshallOfSound committed Feb 26, 2019
1 parent 788412e commit 696b11d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ Your packaged app may be larger than expected if you dont ignore everything othe
}

if (err) return onceReject(err);
if (!watch && stats.hasErrors()) {
return onceReject(new Error(`Compilation errors in the main process: ${stats.toString()}`));
}

onceResolve();
};
if (watch) {
Expand All @@ -301,6 +305,10 @@ Your packaged app may be larger than expected if you dont ignore everything othe
await new Promise(async (resolve, reject) => {
webpack(await this.getRendererConfig(this.config.renderer.entryPoints)).run((err, stats) => {
if (err) return reject(err);
if (!watch && stats.hasErrors()) {
return reject(new Error(`Compilation errors in the renderer: ${stats.toString()}`));
}

resolve();
});
});
Expand Down

0 comments on commit 696b11d

Please sign in to comment.