import { configDefaults, defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; const host = process.env.TAURI_DEV_HOST; export default defineConfig({ base: "./", plugins: [react()], clearScreen: false, build: { rollupOptions: { // pet.html is a second entry so the pet webview can carry `pet-view` on // statically. Without listing it here the release bundle would not // contain it and the pet window would 404. input: { main: "index.html", pet: "pet.html", }, }, }, server: { host: host ?? "127.0.0.1", port: 1420, strictPort: true, hmr: host ? { protocol: "ws", host, port: 1421, } : undefined, watch: { ignored: ["**/src-tauri/**", "**/target/**"], usePolling: true, interval: 500, }, }, test: { exclude: [...configDefaults.exclude, "tests/e2e/**"], environment: "jsdom", setupFiles: "./src/test/setup.ts", restoreMocks: true, clearMocks: true, }, });