INSIGHT-MVP/packages/frontend/vite.config.ts
Thomas Reitz ad3a580d0b fix: resolve login loading loop caused by Vite HMR reconnects + rate limiting
- Add @SkipThrottle() to POST /auth/refresh so repeated silent-refresh calls
  from page reloads no longer exhaust the rate limit (HTTP 429)
- Configure Vite HMR explicitly with host/clientPort/protocol=wss so the
  WebSocket connects correctly through Traefik instead of reconnecting every ~1s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 11:35:18 +01:00

36 lines
698 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 8080,
host: true,
allowedHosts: ['.xinion.lan'],
hmr: {
host: 'insight.xinion.lan',
clientPort: 443,
protocol: 'wss',
},
proxy: {
'/api/v1/crm': {
target: 'http://localhost:3100',
changeOrigin: true,
},
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
});