yunzer_go/front/vite.config.ts
2025-10-27 23:13:08 +08:00

29 lines
647 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
tailwindcss(),
],
resolve: {
// 使用别名
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
proxy: {
// 将 /api 前缀的请求代理到 Beego 后端(默认端口 8080
"/api": {
target: process.env.VITE_API_BASE_URL,
changeOrigin: true,
// 不需要去掉 /api 前缀,因为 Beego 路由已包含 /api
},
},
},
});