import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(function (_a) {
    var mode = _a.mode;
    var env = loadEnv(mode, process.cwd(), '');
    var apiTarget = env.VITE_DEV_API_TARGET || 'http://localhost:5090';
    return {
        plugins: [react()],
        server: {
            port: 5173,
            proxy: {
                '/api': { target: apiTarget, changeOrigin: true },
                '/openapi': { target: apiTarget, changeOrigin: true },
            },
        },
    };
});
