ai_learn_node/frontend/vite.config.ts

24 lines
464 B
TypeScript
Raw Normal View History

2026-01-13 01:59:40 +00:00
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
2026-01-28 08:03:11 +00:00
base: './', // 设置基础路径为相对路径
2026-01-13 01:59:40 +00:00
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
2026-01-13 03:30:53 +00:00
host: '0.0.0.0',
2026-01-13 01:59:40 +00:00
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
});