// Overlay for the cloud dev server: the repo's own vite.config.js plus what a shared, public // host needs. Every value comes from the environment (see deployment/cloud/README.md). import base from '/app/repo/vite.config.js' import { mergeConfig } from 'vite' const env = process.env export default async (e) => { const b = typeof base === 'function' ? await base(e) : base const hmr = env.HMR_CLIENT_PORT ? { clientPort: Number(env.HMR_CLIENT_PORT), protocol: env.HMR_PROTOCOL || 'wss' } : undefined return mergeConfig(b, { cacheDir: '/tmp/vite-cache', server: { host: env.VITE_HOST || '0.0.0.0', port: Number(env.VITE_PORT || 5173), strictPort: true, allowedHosts: true, ...(hmr ? { hmr } : {}), }, }) }