2025-05-01 16:27:34 +02:00
|
|
|
import { $, build } from "bun";
|
2024-11-25 21:54:31 +01:00
|
|
|
|
2025-05-01 16:27:34 +02:00
|
|
|
console.log("Building...");
|
2024-11-25 21:54:31 +01:00
|
|
|
|
|
|
|
|
await $`rm -rf dist && mkdir dist`;
|
|
|
|
|
|
2025-03-30 23:06:34 +02:00
|
|
|
await build({
|
2025-04-06 22:11:18 +02:00
|
|
|
entrypoints: [
|
2025-04-14 17:13:36 +02:00
|
|
|
"worker.ts",
|
2025-04-06 22:11:18 +02:00
|
|
|
// HACK: Include to avoid cyclical import errors
|
|
|
|
|
"config.ts",
|
|
|
|
|
],
|
2024-11-25 21:54:31 +01:00
|
|
|
outdir: "dist",
|
|
|
|
|
target: "bun",
|
|
|
|
|
splitting: true,
|
|
|
|
|
minify: false,
|
|
|
|
|
});
|
|
|
|
|
|
2025-05-01 16:27:34 +02:00
|
|
|
console.log("Copying files...");
|
2024-11-25 21:54:31 +01:00
|
|
|
|
|
|
|
|
// Copy Drizzle migrations to dist
|
2025-04-14 17:13:36 +02:00
|
|
|
await $`cp -rL drizzle dist/drizzle`;
|
2024-11-25 21:54:31 +01:00
|
|
|
|
2025-01-06 19:30:51 +01:00
|
|
|
// Copy Sharp to dist
|
|
|
|
|
await $`mkdir -p dist/node_modules/@img`;
|
2025-04-14 17:13:36 +02:00
|
|
|
await $`cp -rL node_modules/@img/sharp-libvips-linux* dist/node_modules/@img`;
|
|
|
|
|
await $`cp -rL node_modules/@img/sharp-linux* dist/node_modules/@img`;
|
2025-01-06 19:30:51 +01:00
|
|
|
|
2025-04-14 17:13:36 +02:00
|
|
|
await $`cp -rL node_modules/detect-libc dist/node_modules/`;
|
2025-04-01 21:07:56 +02:00
|
|
|
|
2025-05-01 16:27:34 +02:00
|
|
|
console.log("Build complete!");
|