Skip to content

Commit

Permalink
Do not throw errors if --watch flag is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrjohn committed Jan 29, 2025
1 parent 8b20363 commit da5c418
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/install/bun/bun.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
};
Expand Down

0 comments on commit da5c418

Please sign in to comment.