49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
// Vite build konfiguráció
|
|
import { defineConfig } from 'vite';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
// Tailwind CSS Vite plugin - natív integráció, nem kell postcss
|
|
tailwindcss()
|
|
],
|
|
|
|
build: {
|
|
// Build output a szerver által kiszolgált public mappába
|
|
outDir: '../public',
|
|
emptyOutDir: true
|
|
},
|
|
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// API kérések proxyzása a backend szerverre fejlesztési módban
|
|
'/api': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true
|
|
},
|
|
// Socket.io WebSocket proxyzása
|
|
'/socket.io': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
ws: true
|
|
},
|
|
// Webhook kérések proxyzása (UUID formátumú path-ok)
|
|
'/': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
// Csak UUID-szerű path-okat proxyzunk, a Vite statikus fájljait nem
|
|
bypass(req) {
|
|
// Ha Accept fejlécben van text/html vagy a Vite HMR, ne proxyzza
|
|
if (req.headers.accept && req.headers.accept.includes('text/html')) {
|
|
return req.url;
|
|
}
|
|
if (req.url.startsWith('/@') || req.url.startsWith('/src') || req.url.startsWith('/node_modules')) {
|
|
return req.url;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|