Plain HTTP for actions and a websocket that only says "fetch again". A room is its append-only ledger replayed from the top; the engine is deterministic given the seed and the recorded inputs. Each seat sees a view filtered to what the rules let it know. Bot seats are filled at resolution time. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
28 lines
831 B
TypeScript
28 lines
831 B
TypeScript
import adapter from '@sveltejs/adapter-static';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
sveltekit({
|
|
compilerOptions: {
|
|
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
|
|
runes: ({ filename }) =>
|
|
filename.split(/[/\\]/).includes('node_modules') ? undefined : true
|
|
},
|
|
// A static build: the duel runs entirely in the browser, so Caddy serves files and nothing else.
|
|
adapter: adapter({ fallback: 'index.html' })
|
|
})
|
|
],
|
|
server: {
|
|
// In development the duel server runs beside Vite; in production Caddy does this.
|
|
proxy: {
|
|
'/api': 'http://localhost:8788',
|
|
'/ws': { target: 'ws://localhost:8788', ws: true }
|
|
}
|
|
},
|
|
test: {
|
|
include: ['src/**/*.test.ts']
|
|
}
|
|
});
|