diff --git a/bincio/render/cli.py b/bincio/render/cli.py index b77917b..e3697d3 100644 --- a/bincio/render/cli.py +++ b/bincio/render/cli.py @@ -201,15 +201,23 @@ def render( return _ensure_npm(site) - _link_data(site, data) env = {**os.environ, "BINCIO_DATA_DIR": str(data)} if serve: + # Dev server needs to serve /data/ files at runtime from public/ + _link_data(site, data) console.print("Starting [cyan]astro dev[/cyan]…") subprocess.run(["npm", "run", "dev"], cwd=site, env=env) return + # Production build: BINCIO_DATA_DIR is already set so manifest.ts reads + # data directly; remove any leftover public/data symlink so Astro doesn't + # copy the full data directory (9+ GB) into dist/. + public_data = site / "public" / "data" + if public_data.is_symlink(): + public_data.unlink() + # Build cmd = ["npm", "run", "build"] if out_dir: