Files
syops/frontend/vite.config.ts
T
sophie 61693d014d refactor: 重构前端骨架,及admin模块子路由和懒加载
refactor: 优化多次请求,并使用pinia状态管理
2026-06-03 10:30:16 +08:00

27 lines
638 B
TypeScript

import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const rootDir = path.dirname(fileURLToPath(import.meta.url))
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(rootDir, 'src'),
},
},
server: {
port: 8881, // 前端开发端口,实际上我们会用 Nginx 反代,但本地开发先改这个方便
allowedHosts: ['hx.benl.cn'],
proxy: {
'/api': {
target: 'http://127.0.0.1:5052',
changeOrigin: true
}
}
}
})