Files
stock/frontend/vite.config.ts
2026-08-07 16:08:34 +08:00

17 lines
518 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 { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
},
server: {
port: 5173,
// 前端 /api 直接代理到后端,免去 CORS生产环境可用 VITE_API_BASE 指向真实后端)
proxy: { '/api': { target: 'http://localhost:8000', changeOrigin: true } },
},
});