import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], server: { host: '0.0.0.0', port: 3000, proxy: { // 开发环境将 /api 代理到 YApi mock 服务器 // 实际请求 /api/v1/xxx 会被转发到 https://yapi.ttlv.zone/mock/19/api/v1/xxx '/api': { target: 'http://124.222.159.10:8090', changeOrigin: true, secure: false, rewrite: (path) => path.replace(/^\/api/, '/api/'), }, }, }, })