/// import { defineConfig, configDefaults } from "vitest/config"; import react from "@vitejs/plugin-react-swc"; import path from "path"; import inject from '@rollup/plugin-inject'; import subresourceIntegrity from 'vite-plugin-subresource-integrity'; // Node globals some browser dependencies reference as free identifiers; see the file header. const nodeGlobals = path.resolve(__dirname, './src/lib/node-globals.ts'); // https://vitejs.dev/config/ export default defineConfig(({ command }) => ({ test: { globals: true, environment: 'jsdom', setupFiles: './src/tests/setup.ts', // supabase/** holds Deno tests (Deno.test + pglite) run via `deno test`, // not vitest — exclude them from the web (node/jsdom) test sweep. exclude: [...configDefaults.exclude, 'supabase/**'], }, server: { host: "::", port: 8082, strictPort: false, // Allow automatic port selection if 8082 is busy hmr: { protocol: 'ws', host: 'localhost', }, watch: { usePolling: true, }, }, plugins: [ react(), // SRI: production build sırasında