import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' // Beim Entwickeln (außerhalb des Containers) läuft Vite unter :5173 und // erwartet das Backend (nginx + websockify) unter :8080. In der Produktion // liefert nginx das gebaute dist/ direkt aus, sodass keine Proxys nötig sind. export default defineConfig({ plugins: [vue()], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, server: { host: true, port: 5173, proxy: { '/api': { target: 'http://localhost:8080', changeOrigin: true }, '/websockify': { target: 'ws://localhost:8080', ws: true, changeOrigin: true, }, }, }, build: { outDir: 'dist', emptyOutDir: true, }, })