vite.config.ts 506 B

12345678910111213141516171819202122
  1. import path from "path";
  2. import react from "@vitejs/plugin-react";
  3. import { defineConfig } from "vite";
  4. export default defineConfig({
  5. plugins: [react()],
  6. resolve: {
  7. alias: {
  8. "@": path.resolve(__dirname, "./src"),
  9. },
  10. },
  11. server: {
  12. port: 3300,
  13. proxy: {
  14. '/api': {// 匹配所有以 '/api1'开头的请求路径
  15. target: 'http://localhost:8090',// 代理目标的基础路径
  16. changeOrigin: true,
  17. // pathRewrite: {'^/api1': ''}
  18. },
  19. }
  20. },
  21. });