import { defineConfig } from 'vite' import uni from '@dcloudio/vite-plugin-uni' // https://vitejs.dev/config/ export default defineConfig({ transpileDependencies: ['uview-ui'], plugins: [ uni(), ], server: { host: "0.0.0.0", port: '8591', open: true, // 运行是否自动打开浏览器 proxy: { // 反向代理解决跨域 "/api": { target: 'https://test.metavatar.cc/C', // 线上接口地址 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), }, }, }, })