Skip to content

Commit

Permalink
fix(plugin-webpack): throw error if something bad happened in preload…
Browse files Browse the repository at this point in the history
… compilation (#2334)

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
  • Loading branch information
vhashimotoo and malept committed Jul 11, 2021
1 parent 597e263 commit 755a450
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ Your packaged app may be larger than expected if you dont ignore everything othe
for (const entryPoint of this.config.renderer.entryPoints) {
if (entryPoint.preload) {
await asyncOra(`Compiling Renderer Preload: ${entryPoint.name}`, async () => {
await this.runWebpack(
const stats = await this.runWebpack(
await this.configGenerator.getPreloadRendererConfig(entryPoint, entryPoint.preload!),
);

if (stats?.hasErrors()) {
throw new Error(`Compilation errors in the preload (${entryPoint.name}): ${stats.toString()}`);
}
});
}
}
Expand Down

0 comments on commit 755a450

Please sign in to comment.