import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], // Use relative paths so the app works when served from any subdirectory base: './', build: { // Output to dist folder outDir: 'dist', // Generate assets with relative paths assetsDir: 'assets', // Emit a single index.html that can be served by the backend rollupOptions: { output: { // Use hash in filenames for cache busting entryFileNames: 'assets/[name]-[hash].js', chunkFileNames: 'assets/[name]-[hash].js', assetFileNames: 'assets/[name]-[hash].[ext]', }, }, }, server: { port: 3000, proxy: { '/api': { target: 'http://localhost:8080', changeOrigin: true, }, '/storage': { target: 'http://localhost:8080', changeOrigin: true, }, }, }, });