build: Prevent DB connection during building

This commit is contained in:
April Hall 2025-02-11 17:58:27 -05:00
parent e938e7e064
commit 9b0843405a
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@
"version": "0.0.1", "version": "0.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "vite build", "build": "BUILDING='true' vite build",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"checkformat": "prettier --check .", "checkformat": "prettier --check .",

View File

@ -118,7 +118,10 @@ class Db {
} }
const db = new Db(); const db = new Db();
if (process.env.BUILDING !== 'true') {
await db.init(); await db.init();
await db.createChannel('general'); await db.createChannel('general');
}
export { db, type Messages }; export { db, type Messages };