Disable Vite HMR for Production Environment

- Completely disable Hot Module Replacement in production
- HMR incompatible with reverse proxy setup
- Eliminates WebSocket connection errors in browser
- Cleaner production deployment without dev features
- No more 'failed to connect to websocket' messages
This commit is contained in:
DGSoft 2025-12-10 18:52:01 +01:00
parent f755b1bac1
commit 5966b9b3f3

View File

@ -1,6 +1,9 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
@ -11,7 +14,8 @@ export default defineConfig({
'192.168.0.12',
'localhost'
],
hmr: false, // HMR in Production-Umgebung deaktivieren
// HMR komplett deaktivieren - nicht kompatibel mit Reverse Proxy
hmr: false,
proxy: {
'/api': {
target: 'http://192.168.0.12:8000',