diff --git a/vite.demo.config.ts b/vite.demo.config.ts index 7a440a3..afe0c6b 100644 --- a/vite.demo.config.ts +++ b/vite.demo.config.ts @@ -16,6 +16,12 @@ export default defineConfig(({ mode, command }) => { return { root: appRoot, + // Load `.env` / `.env.local` from the repo root. Vite's default is to + // read env files from `root`, which here points into `src/demo/apps/...` + // where no env files live — so without this VITE_GOOGLE_MAPS_API_KEY + // never reaches the built bundle and ProviderMap silently falls back + // to its "no API key" empty state in production. + envDir: __dirname, // Dev server uses absolute base so HMR/asset URLs work at the root; // production build prefixes assets with // so the bundle is // portable to any nginx location matching that path.