Files
bibdle/vite.config.ts
T

22 lines
757 B
TypeScript

import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig(({ mode }) => {
// SvelteKit evaluates server modules during the build, and `$lib/server/db`
// requires DATABASE_URL at import time. Bun does not always surface the
// auto-loaded `.env` to Vite's build workers, so copy `.env` values into
// `process.env` here (without overriding a real environment variable).
const env = loadEnv(mode, process.cwd(), '');
for (const [key, value] of Object.entries(env)) {
if (process.env[key] === undefined) process.env[key] = value;
}
return {
plugins: [tailwindcss(), sveltekit()],
server: {
allowedHosts: ['bibdle.com']
}
};
});