vite.config.ts 827 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import path from 'path'
  2. import { defineConfig } from 'vite'
  3. import react from '@vitejs/plugin-react-swc'
  4. import tailwindcss from '@tailwindcss/vite'
  5. import { tanstackRouter } from '@tanstack/router-plugin/vite'
  6. // https://vite.dev/config/
  7. export default defineConfig({
  8. plugins: [
  9. tanstackRouter({
  10. target: 'react',
  11. autoCodeSplitting: true,
  12. }),
  13. react(),
  14. tailwindcss(),
  15. ],
  16. resolve: {
  17. alias: {
  18. '@': path.resolve(__dirname, './src'),
  19. },
  20. },
  21. server: {
  22. host: '0.0.0.0',
  23. proxy: {
  24. '/api': {
  25. target: 'http://localhost:3000',
  26. changeOrigin: true,
  27. },
  28. '/mj': {
  29. target: 'http://localhost:3000',
  30. changeOrigin: true,
  31. },
  32. '/pg': {
  33. target: 'http://localhost:3000',
  34. changeOrigin: true,
  35. },
  36. },
  37. },
  38. })