29 lines
802 B
TypeScript
29 lines
802 B
TypeScript
import solidPlugin from "@opentui/solid/bun-plugin";
|
|
|
|
export async function build() {
|
|
const results = await Promise.all([
|
|
Bun.build({
|
|
entrypoints: ["src/index.ts", "src/quota-rpc.ts"],
|
|
outdir: "dist",
|
|
target: "bun",
|
|
format: "esm",
|
|
}),
|
|
Bun.build({
|
|
entrypoints: ["src/tui.tsx"],
|
|
outdir: "dist",
|
|
target: "bun",
|
|
format: "esm",
|
|
external: ["@opencode/plugin/tui", "@opentui/solid", "solid-js"],
|
|
plugins: [solidPlugin],
|
|
}),
|
|
]);
|
|
|
|
for (const result of results) {
|
|
if (result.success) continue;
|
|
for (const log of result.logs) console.error(log);
|
|
throw new Error("Build failed");
|
|
}
|
|
}
|
|
|
|
if (import.meta.main) await build();
|