import { defineConfig } from 'vitest/config';
import path from 'path';
import react from '@vitejs/plugin-react';

const ReactCompilerConfig = {};

export default defineConfig({
    plugins: [
        react({
            babel: {
                plugins: [['babel-plugin-react-compiler', ReactCompilerConfig]],
            },
        }),
    ],
    test: {
        environment: 'jsdom',
        globals: true,
        setupFiles: ['./src/__tests__/setup.ts'],
        include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
        exclude: ['node_modules', 'dist'],
        coverage: {
            provider: 'v8',
            include: ['src/core/**', 'src/hooks/**', 'src/utils/**'],
            exclude: ['src/**/index.ts', 'src/**/*.test.*'],
        },
    },
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },
});
