yxdth5/vite.config.js

30 lines
700 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: {
2024-01-03 15:29:57 +08:00
host: '0.0.0.0', // 解决“vite use `--host` to expose”-- 0.0.0.0 将监听所有地址
proxy: {
// '/api': {
// target: 'https://qqzso.ydool.com/',//马顺华
// changeOrigin: true,
// },
'/srv': {
2024-01-12 11:27:37 +08:00
target: 'http://36.140.118.172:88',//沈涛
2024-01-03 15:29:57 +08:00
changeOrigin: true,
},
}
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)),
},
},
});