import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ import { resolve } from "path"; const pathSrc = resolve(__dirname, "src"); export default defineConfig(({ mode }) => { const config = loadEnv(mode, './') return { plugins: [ vue(), ], server: { port: 5000, proxy: { '/api': { target: 'http://192.168.11.77:8888', changeOrigin: true, rewrite: (path) => { return path.replace(/\/api/, '/api') } }, '/app': { target: 'http://192.168.11.77:8080', changeOrigin: true, rewrite: (path) => { return path.replace(/\/app/, '/api') } } } }, resolve: { alias: { "@": pathSrc, }, }, } })