refactor(build): 🎨 Make build routes automatically scanned rather than manually added

This commit is contained in:
Jesse Wierzbinski 2024-04-15 21:13:34 -10:00
parent 87d4473276
commit 59455f9ece
No known key found for this signature in database
2 changed files with 17 additions and 110 deletions

View file

@ -1,6 +1,6 @@
// Delete dist directory
import { $ } from "bun";
import { rawRoutes } from "~routes";
import { routes } from "~routes";
console.log(`Building at ${process.cwd()}`);
@ -11,7 +11,7 @@ await Bun.build({
`${process.cwd()}/index.ts`,
`${process.cwd()}/cli.ts`,
// Force Bun to include endpoints
...Object.values(rawRoutes),
...Object.values(routes),
],
outdir: `${process.cwd()}/dist`,
target: "bun",