Skip to content

Commit 755a450

Browse files
vhashimotoomalept
andauthored
fix(plugin-webpack): throw error if something bad happened in preload compilation (#2334)
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
1 parent 597e263 commit 755a450

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/plugin/webpack/src/WebpackPlugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,13 @@ Your packaged app may be larger than expected if you dont ignore everything othe
277277
for (const entryPoint of this.config.renderer.entryPoints) {
278278
if (entryPoint.preload) {
279279
await asyncOra(`Compiling Renderer Preload: ${entryPoint.name}`, async () => {
280-
await this.runWebpack(
280+
const stats = await this.runWebpack(
281281
await this.configGenerator.getPreloadRendererConfig(entryPoint, entryPoint.preload!),
282282
);
283+
284+
if (stats?.hasErrors()) {
285+
throw new Error(`Compilation errors in the preload (${entryPoint.name}): ${stats.toString()}`);
286+
}
283287
});
284288
}
285289
}

0 commit comments

Comments
 (0)