12345678910111213141516171819202122 |
- import path from "path";
- import react from "@vitejs/plugin-react";
- import { defineConfig } from "vite";
- export default defineConfig({
- plugins: [react()],
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- },
- },
- server: {
- port: 3300,
- proxy: {
- '/api': {// 匹配所有以 '/api1'开头的请求路径
- target: 'http://localhost:8090',// 代理目标的基础路径
- changeOrigin: true,
- // pathRewrite: {'^/api1': ''}
- },
- }
- },
- });
|