From 522480255982a22f233b26006a9a13e16a6b4b51 Mon Sep 17 00:00:00 2001 From: Trevor John Date: Mon, 27 Jan 2025 11:53:51 -0500 Subject: [PATCH] Do not throw errors if --watch flag is passed --- lib/install/bun/bun.config.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/install/bun/bun.config.js b/lib/install/bun/bun.config.js index 46f7647..02823d3 100644 --- a/lib/install/bun/bun.config.js +++ b/lib/install/bun/bun.config.js @@ -5,20 +5,16 @@ const config = { sourcemap: "external", entrypoints: ["app/javascript/application.js"], outdir: path.join(process.cwd(), "app/assets/builds"), + throw: !process.argv.includes('--watch'), }; const build = async (config) => { const result = await Bun.build(config); if (!result.success) { - if (process.argv.includes('--watch')) { - console.error("Build failed"); - for (const message of result.logs) { - console.error(message); - } - return; - } else { - throw new AggregateError(result.logs, "Build failed"); + console.error("Build failed"); + for (const message of result.logs) { + console.error(message); } } };