import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import AutoImport from 'unplugin-auto-import/vite'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), // 配置插件 AutoImport({ imports: ['vue', 'vue-router'] }) ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }, server: { host: true, // host: '192.168.11.102', port: '9999', proxy: { ['/prod-api']: { // target: 'http://120.26.86.247:9898/',//实际请求地址 // target: 'http://47.122.47.140:9898/',//实际请求地址 target: 'http://haijiacheng.com:80/prod-api', //实际请求地址 changeOrigin: true, // ws: true,// websocket支持 rewrite: (path) => path.replace('/prod-api', '') //替换实际请求后台地址 } }, https: false } })