import { fileURLToPath, URL } from 'node:url' import babel from '@rolldown/plugin-babel' import tailwindcss from '@tailwindcss/vite' import { tanstackRouter } from '@tanstack/router-plugin/vite' import react, { reactCompilerPreset } from '@vitejs/plugin-react' import { defineConfig } from 'vite' export default defineConfig({ resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, server: { port: 9999, host: '0.0.0.0', allowedHosts: ['darlena-nonexpiring-cathie.ngrok-free.dev'], proxy: { '/api': { target: 'https://zihua-api.h55555game.top', changeOrigin: true, }, }, }, plugins: [ tanstackRouter({ target: 'react', autoCodeSplitting: true, }), tailwindcss(), react(), babel({ presets: [reactCompilerPreset()] }), ], build: { outDir: 'zihua-web', }, })