import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; import { resolve } from "path"; export default defineConfig({ plugins: [react()], test: { environment: "jsdom", globals: true, setupFiles: ["./vitest.setup.ts"], include: ["**/*.{test,spec}.{ts,tsx}"], exclude: ["node_modules", ".next", "e2e/**"], }, resolve: { alias: { "@": resolve(__dirname, "."), // server-only throws if imported outside an RSC bundle; stub it in tests. "server-only": resolve(__dirname, "test/stub-empty.ts"), }, }, });