nex_docus/frontend/vite.config.js

35 lines
648 B
JavaScript
Raw Normal View History

2025-12-20 11:18:59 +00:00
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
2026-01-21 10:05:41 +00:00
import legacy from '@vitejs/plugin-legacy'
2025-12-20 11:18:59 +00:00
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
2026-01-21 09:52:39 +00:00
plugins: [
react(),
legacy({
targets: ['defaults', 'not IE 11'],
}),
],
2025-12-20 11:18:59 +00:00
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 5173,
open: true,
proxy: {
// 代理API请求到后端
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: false,
},
})