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: {
|
2024-03-06 15:33:32 +08:00
|
|
|
"/generate": {
|
2024-03-06 15:04:14 +08:00
|
|
|
// target: "http://192.168.2.86:8003",
|
2024-03-06 15:33:32 +08:00
|
|
|
target: "https://aiai.cityme.com.cn",
|
2024-02-19 10:46:21 +08:00
|
|
|
changeOrigin: true,
|
2024-03-06 15:33:32 +08:00
|
|
|
// rewrite: (path) => path.replace(/\/test/, ""), //重写真实路径,替换/api
|
2024-02-19 10:46:21 +08:00
|
|
|
},
|
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)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|