vite.config.ts 774 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { resolve } from "path";
  2. import { defineConfig } from "vite";
  3. import react from "@vitejs/plugin-react-swc";
  4. const devProxyServer = "http://localhost:8081/";
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [react()],
  8. server: {
  9. host: "0.0.0.0",
  10. port: 3001,
  11. proxy: {
  12. "^/api": {
  13. target: devProxyServer,
  14. changeOrigin: true,
  15. },
  16. "^/o/": {
  17. target: devProxyServer,
  18. changeOrigin: true,
  19. },
  20. "^/u/\\d*/rss.xml": {
  21. target: devProxyServer,
  22. changeOrigin: true,
  23. },
  24. "/explore/rss.xml": {
  25. target: devProxyServer,
  26. changeOrigin: true,
  27. },
  28. },
  29. },
  30. resolve: {
  31. alias: {
  32. "@/": `${resolve(__dirname, "src")}/`,
  33. },
  34. },
  35. });