yxdth5/vite.config.js

32 lines
694 B
JavaScript
Raw Normal View History

2023-12-08 09:44:23 +08:00
import { fileURLToPath, URL } from "node:url";
2023-12-07 09:39:34 +08:00
2023-12-08 09:44:23 +08:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
2023-12-07 09:39:34 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2023-12-08 09:44:23 +08:00
server: {
// ← ← ← ← ← ←
host: "0.0.0.0", // ← 新增内容 ←
2024-02-19 10:46:21 +08:00
hmr: true, // 自动热更新
proxy: {
"/test": {
target: "http://192.168.2.86:8003",
changeOrigin: true,
},
2024-02-19 11:03:17 +08:00
'/srv': {
target: 'http://36.140.118.172:88',//沈涛
changeOrigin: true,
},
2024-02-19 10:46:21 +08:00
},
2023-12-07 17:15:51 +08:00
},
2023-12-08 09:44:23 +08:00
base: "./", //生产环境路径
plugins: [vue()],
2023-12-07 09:39:34 +08:00
resolve: {
alias: {
2023-12-08 09:44:23 +08:00
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});