import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import packageJson from './package.json'; export default defineConfig({ plugins: [react()], define: { __APP_VERSION__: JSON.stringify(packageJson.version), __BUILD_TIME__: JSON.stringify(new Date().toISOString()), }, // 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, }, }, }, });