vite.config.ts 773 B

123456789101112131415161718192021
  1. import { defineConfig } from 'vite'
  2. import react from '@vitejs/plugin-react'
  3. import tailwindcss from '@tailwindcss/vite'
  4. import path from 'path'
  5. export default defineConfig({
  6. // Relative asset URLs so one build works both at the server root and behind a
  7. // subpath reverse proxy (e.g. nginx `location /rag/`). Safe because the app
  8. // uses hash routing: the document path is always the mount point itself.
  9. base: './',
  10. plugins: [react(), tailwindcss()],
  11. resolve: { alias: { '@': path.resolve(__dirname, './src') } },
  12. server: {
  13. port: 3000,
  14. proxy: {
  15. '/api': { target: 'http://localhost:8080', changeOrigin: true },
  16. '/ui': { target: 'http://localhost:8080', changeOrigin: true },
  17. },
  18. },
  19. build: { outDir: 'dist', sourcemap: false },
  20. })