yxdth5/vite.config.js

32 lines
694 B
JavaScript

import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
server: {
// ← ← ← ← ← ←
host: "0.0.0.0", // ← 新增内容 ←
hmr: true, // 自动热更新
proxy: {
"/test": {
target: "http://192.168.2.86:8003",
changeOrigin: true,
},
'/srv': {
target: 'http://36.140.118.172:88',//沈涛
changeOrigin: true,
},
},
},
base: "./", //生产环境路径
plugins: [vue()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});