import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import path from 'path' export default defineConfig({ plugins: [react()], server: { proxy: { // Backend API (dev): proxy to avoid CORS '/health': { target: 'http://localhost:8080', changeOrigin: true, }, '/api/agent': { target: 'http://localhost:8080', changeOrigin: true, }, // Kroki diagram service '/api/kroki': { target: 'https://kroki.io', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/kroki/, ''), }, }, }, resolve: { alias: { '@': path.resolve(__dirname, './src'), // Ensure PostCSS/Vite can resolve the shadcn tailwind CSS file 'shadcn/dist/tailwind.css': path.resolve( __dirname, 'node_modules/shadcn/dist/tailwind.css' ), // Optional: map the package to its dist for other imports shadcn: path.resolve(__dirname, 'node_modules/shadcn/dist'), } } })