nex_docus/frontend/vite.config.js

37 lines
771 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({
2026-01-22 10:00:54 +00:00
targets: ['chrome >= 64', 'safari >= 11', 'ios >= 11', 'android >= 9'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
modernPolyfills: true,
}),
2026-01-21 09:52:39 +00:00
],
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,
},
})