import adapter from '@sveltejs/adapter-bun'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'vitest/config'; import Icons from 'unplugin-icons/vite'; import { enhancedImages } from '@sveltejs/enhanced-img'; export default defineConfig({ plugins: [ tailwindcss(), enhancedImages(), sveltekit({ // Consult https://svelte.dev/docs/kit/integrations#preprocessors // for more information about preprocessors preprocess: vitePreprocess(), // Production runs `bun ./build` behind Caddy, which terminates TLS. Without // paths.origin the server takes the host from the Host header and assumes // https, which is right for both staging and production from one image. adapter: adapter(), csrf: { // Allow form posts from the dev site, which Caddy also serves over https. trustedOrigins: ['https://dev.stanrunge.dev'] } }), Icons({ compiler: 'svelte' }) ], test: { include: ['src/**/*.{test,spec}.{js,ts}'] }, server: { host: '127.0.0.1', allowedHosts: ['dev.stanrunge.dev'], hmr: process.env.AUTH_E2E === '1' ? false : { host: 'dev.stanrunge.dev', protocol: 'wss', clientPort: 443 } } });