JSL_OrganizeInternalOAWeb_A.../vite.config.js

23 lines
536 B
JavaScript
Raw Normal View History

2023-12-20 22:18:46 +08:00
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
2023-12-24 20:41:55 +08:00
plugins: [vue()],
2023-12-20 22:18:46 +08:00
resolve: {
alias: {
2023-12-24 20:41:55 +08:00
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
server: {
proxy: {
"/api": {
2024-01-19 02:08:29 +08:00
target: "http://nbxt.oa.x-lf.cn", // 后端服务器的地址
2023-12-24 20:41:55 +08:00
rewrite: (path) => path.replace(/^\/api/, ""), // 将请求路径中的 '/api' 前缀移除
},
},
},
});