import { defineConfig, type ViteUserConfig } from 'vitest/config'; export default defineConfig(async () => { const { default: tsconfigPaths } = await import('vite-tsconfig-paths'); return { plugins: [tsconfigPaths()], esbuild: { jsx: 'automatic' }, test: { globals: true, environment: 'jsdom', // For React components setupFiles: ['./vitest.setup.ts'], pool: 'forks', poolOptions: { forks: { maxForks: process.env.CI ? 1 : 8, minForks: process.env.CI ? 1 : 8 } }, include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], exclude: [ '**/node_modules/**', '**/dist/**', '**/.next/**', '**/playwright-tests/**', '**/coverage/**' ], coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], exclude: [ 'coverage/**', 'dist/**', '**/node_modules/**', '**/[.]**', 'packages/*/test{,s}/**', '**/*.d.ts', '**/virtual:*', '**/__x00__*', '**/\x00*', 'cypress/**', 'test{,s}/**', 'test{,-*}.{js,cjs,mjs,ts,tsx,jsx}', '**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}', '**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}', '**/tests/**', '**/__tests__/**', '**/.{eslint,mocha,prettier}rc.{js,cjs,yml}', '**/vitest.{workspace,projects}.[jt]s?(on)', '**/vitest.config.[jt]s', '**/playwright.config.[jt]s', '**/.storybook/**', '**/storybook-static/**' ] } }, css: { postcss: { plugins: [] } } } satisfies ViteUserConfig; });