import path from 'node:path'; import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; // The reference app resolves `@/*` through the Base44 Vite plugin. This demo is // backend-free, so the alias is declared directly. export default defineConfig({ plugins: [react()], resolve: { alias: { '@': path.resolve(import.meta.dirname, './src'), }, }, build: { rollupOptions: { output: { // Split the heavy libraries out of the app bundle. They change far less // often than app code, so browsers keep them cached across deploys. manualChunks: { react: ['react', 'react-dom', 'react-router-dom'], charts: ['recharts'], motion: ['framer-motion'], markdown: ['react-markdown'], canvas: ['html2canvas'], }, }, }, }, server: { // Honor a port assigned by the environment; fall back to Vite's default. port: process.env.PORT ? Number(process.env.PORT) : 5173, }, });