Files
beoanswer_react/vite.config.js

32 lines
706 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
return {
plugins: [react()],
server: {
// Proxy nur für Development
proxy: mode === 'development' ? {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
} : {}
},
build: {
// Production Build Optimierungen
sourcemap: false,
minify: 'terser',
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom']
}
}
}
}
}
})