mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-10-22 05:54:10 -04:00
22 lines
757 B
TypeScript
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']
|
|
}
|
|
};
|
|
});
|