19 lines
507 B
JavaScript
19 lines
507 B
JavaScript
import { defineConfig } from 'vite'
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [uni()],
|
|
server: {
|
|
proxy: {
|
|
// 在此处编写代理规则
|
|
'/api': {
|
|
target: 'http://192.168.0.38:8080', // 测试服务
|
|
changeOrigin: true,
|
|
rewrite: (path) => {
|
|
return path.replace(/\/api/, '')
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|