mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Co-authored-by: nektro <5464072+nektro@users.noreply.github.com> Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
20 lines
500 B
TypeScript
20 lines
500 B
TypeScript
import { BuildOutput, BuildConfig } from "bun";
|
|
|
|
/**
|
|
* Like Bun.build but doesn't throw like the old way because all the tests break and we have to ship bun 1.2 in 4 hours lol hahaha
|
|
*/
|
|
export async function buildNoThrow(config: BuildConfig): Promise<BuildOutput> {
|
|
let build: BuildOutput;
|
|
try {
|
|
build = await Bun.build(config);
|
|
} catch (e) {
|
|
const err = e as AggregateError;
|
|
build = {
|
|
outputs: [],
|
|
success: false,
|
|
logs: err.errors,
|
|
};
|
|
}
|
|
return build;
|
|
}
|