server/build-worker.ts
Jesse Wierzbinski 1d2ea36fac
refactor: 🔥 Remove old pre Bun 1.2 compile error check
Bun 1.2 now default to actually throwing an error instead of always succeeding
2025-01-29 17:25:04 +01:00

27 lines
639 B
TypeScript

import { $ } from "bun";
import ora from "ora";
const buildSpinner = ora("Building").start();
await $`rm -rf dist && mkdir dist`;
await Bun.build({
entrypoints: ["entrypoints/worker/index.ts"],
outdir: "dist",
target: "bun",
splitting: true,
minify: false,
});
buildSpinner.text = "Transforming";
// Copy Drizzle migrations to dist
await $`cp -r drizzle dist/drizzle`;
// Copy Sharp to dist
await $`mkdir -p dist/node_modules/@img`;
await $`cp -r node_modules/@img/sharp-libvips-linuxmusl-* dist/node_modules/@img`;
await $`cp -r node_modules/@img/sharp-linuxmusl-* dist/node_modules/@img`;
buildSpinner.stop();