import { defineConfig } from 'vitest/config'; import react from '@vitejs/plugin-react'; import path from 'node:path'; export default defineConfig({ plugins: [react()], resolve: { alias: { '@': path.resolve(__dirname, './apps/web/src'), }, // Deduplicate React to avoid "multiple copies" errors when packages // installed in workspace sub-directories shadow the hoisted copies. dedupe: ['react', 'react-dom'], }, test: { // Enable test globals (describe, it, expect without imports) globals: true, env: { CW_LOG_LEVEL: 'silent', }, // Test file pattern include: ['**/*.test.ts', '**/*.test.tsx'], exclude: ['**/node_modules/**', '**/dist/**', 'packages/**'], environmentMatchGlobs: [ ['apps/web/**', 'happy-dom'], ], // TypeScript support uses tsconfig.json automatically // Coverage reporter (optional, for future use) coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], reportsDirectory: './apps/server/coverage', }, }, });