TraceStudio-dist/web/vite.config.ts

26 lines
615 B
TypeScript
Raw Normal View History

2026-01-13 16:41:31 +08:00
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
resolve: {
alias: {
react: path.resolve(__dirname, 'node_modules/react'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
},
},
plugins: [react()],
server: {
host: '0.0.0.0', // 监听所有网络接口,支持局域网访问
port: 5173,
// 开发环境代理配置(可选)
proxy: {
'/api': {
target: 'http://0.0.0.0:8000',
changeOrigin: true,
},
},
},
})