import { defineConfig } from 'vitest/config'
import { loadEnv } from 'vite'

export default defineConfig(({mode}) => {
    const env = loadEnv(mode, process.cwd(), '')

    return {
        server: {
            port: 51204,
            host: '0.0.0.0',
            allowedHosts: env.VITEST_PUBLIC_URL ? [env.VITEST_PUBLIC_URL] : [],
        },
        test: {
            environment: 'jsdom',
            env: loadEnv(mode, process.cwd(), '')
        }
    }
});