nex_docus/frontend/vite.config.js

32 lines
564 B
JavaScript
Raw Normal View History

2025-12-20 11:18:59 +00:00
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
2026-01-21 08:28:52 +00:00
build: {
target: 'es2015',
},
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,
},
})