JSL_OrganizeInternalOAWeb_A.../vite.config.js

25 lines
637 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": {
2023-12-24 23:02:58 +08:00
target: "https://jsl-oa.x-lf.com", // 后端服务器的地址
// target: "http://localhost:8080", // 后端服务器的地址
2023-12-24 20:41:55 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""), // 将请求路径中的 '/api' 前缀移除
},
},
},
});