20 lines
400 B
TypeScript
20 lines
400 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server:{
|
|
proxy:{
|
|
//此处编写代理规则
|
|
"/api":{
|
|
target:"http://localhost:8080",
|
|
changeOrigin:true,
|
|
rewrite:path=>{
|
|
return path.replace(/\/api/,'api/');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|