summaryrefslogtreecommitdiffhomepage
path: root/vite.config.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-06 22:08:16 +0900
committerAdam Malczewski <[email protected]>2026-06-06 22:08:16 +0900
commite1c8cf3257cb33457aa882c548f5195ecc0f9854 (patch)
treed355147cdab8eb77917ad02caedf26b3d8d0be57 /vite.config.ts
downloaddispatch-web-e1c8cf3257cb33457aa882c548f5195ecc0f9854.tar.gz
dispatch-web-e1c8cf3257cb33457aa882c548f5195ecc0f9854.zip
Slice 1: surface system + WS transport + composition root
Pure-core feature libraries assembled at the composition root: - core/protocol: pure reducer over surface catalog/spec/error messages - features/surface-host: generic field-kind interpreter (toggle/progress/ selector/stat/button) + pure plan logic; no surface-id special-casing - adapters/ws: injected WebSocket client (effects at the edge) - app: composition root store (Svelte 5 runes over the pure reducer), host-relative surface WS URL resolution (resolveWsUrl), root App.svelte Verified green: svelte-check 0/0, vitest 84 passed, biome clean, vite build ok.
Diffstat (limited to 'vite.config.ts')
-rw-r--r--vite.config.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..fab62a0
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,23 @@
+import { svelte } from "@sveltejs/vite-plugin-svelte";
+import { defineConfig } from "vitest/config";
+
+// Dev server on the reserved FRONTEND_PORT (24204). Vitest config lives here too
+// (jsdom + globals) so component tests run without extra config.
+export default defineConfig({
+ plugins: [svelte()],
+ // Bind all interfaces + accept any Host header so the dev server is reachable over a LAN /
+ // Tailscale. Safe for LOCAL-NETWORK-ONLY use (NOT internet-exposed): `allowedHosts: true`
+ // disables Vite's DNS-rebinding host check. (The WS URL still runs in the browser — set
+ // VITE_WS_URL to the backend's reachable host when browsing from another device.)
+ server: { port: 24204, host: true, allowedHosts: true },
+ test: {
+ environment: "jsdom",
+ globals: true,
+ setupFiles: ["./vitest-setup.ts"],
+ // Svelte 5's exports map resolves `svelte` → server build under the default
+ // condition; force the browser build so component tests can mount().
+ resolve: {
+ conditions: ["browser"],
+ },
+ },
+});