vite.config.ts 868 B

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