mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
Add bait mode, fix bugs
This commit is contained in:
parent
d633116571
commit
480fcb363f
14 changed files with 1627 additions and 236 deletions
13
build.ts
13
build.ts
|
|
@ -1,12 +1,6 @@
|
|||
// Delete dist directory
|
||||
import chalk from "chalk";
|
||||
import { rm, cp, mkdir, exists } from "fs/promises";
|
||||
|
||||
console.log(
|
||||
chalk.red(
|
||||
"Warning: Build is currently broken due to a bug in Bun causing it not to parse dynamic imports"
|
||||
)
|
||||
);
|
||||
import { rawRoutes } from "~routes";
|
||||
|
||||
if (!(await exists("./pages/dist"))) {
|
||||
console.log("Please build the Vite server first, or use `bun prod-build`");
|
||||
|
|
@ -25,6 +19,8 @@ await Bun.build({
|
|||
process.cwd() + "/index.ts",
|
||||
process.cwd() + "/prisma.ts",
|
||||
process.cwd() + "/cli.ts",
|
||||
// Force Bun to include endpoints
|
||||
...Object.values(rawRoutes),
|
||||
],
|
||||
outdir: process.cwd() + "/dist",
|
||||
target: "bun",
|
||||
|
|
@ -47,4 +43,7 @@ await cp(process.cwd() + "/pages/dist", process.cwd() + "/dist/pages/", {
|
|||
recursive: true,
|
||||
});
|
||||
|
||||
// Copy the Bee Movie script from pages
|
||||
await cp(process.cwd() + "/pages/beemovie.txt", process.cwd() + "/dist/pages/");
|
||||
|
||||
console.log(`Built!`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue