/// import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { readFileSync } from "fs"; const pkg = JSON.parse(readFileSync(path.resolve(__dirname, "package.json"), "utf-8")); export default defineConfig({ plugins: [react()], define: { __APP_VERSION__: JSON.stringify(pkg.version), }, resolve: { alias: { "@": path.resolve(__dirname, "./src") }, }, // Component tests run in jsdom. Kept minimal on purpose: this exists to // verify behaviour that typechecking cannot, not to chase coverage. test: { environment: "jsdom", globals: true, include: ["src/**/*.test.{ts,tsx}"], }, server: { host: true, port: 5173, proxy: { "/api": { target: "http://localhost:5008", changeOrigin: true }, "/ws": { target: "ws://localhost:5008", ws: true }, }, }, });