import { svelte } from '@sveltejs/vite-plugin-svelte'; import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vitest/config'; export default defineConfig({ // Game fonts live in `static/` (copied to the build root, served by the // Dart server at /fonts/ in production). publicDir: 'static', plugins: [svelte()], resolve: { alias: { $lib: fileURLToPath(new URL('./src/lib', import.meta.url)), }, }, server: { port: 5173, proxy: { // Forward the game WebSocket to the Dart server in development. '/ws': { target: 'ws://localhost:4567', ws: true, }, // The Dart server owns the game data and artwork; the client // fetches them from /data/ and /images/ exactly as it will in // production (where the Dart server serves the built app too). '/data': 'http://localhost:4567', '/images': 'http://localhost:4567', // The session endpoint mints/returns the `x-haven-session` cookie // that the `/ws` upgrade relies on (seat persistence). '/session': 'http://localhost:4567', }, }, test: { include: ['test/**/*.test.ts'], }, });