// Build the client-side hydration bundle for a Pylon SSR project. // // Phase 1.5e: code splitting with shared chunks. The bundler: // // 1. Discovers `app/**/page.tsx` + `app/**/layout.tsx` under cwd. // 2. Generates one tiny `client-runtime.ts` module containing the // hydration dispatcher + React imports (the *only* place that // pulls in react-dom/client). // 3. Generates one per-route entry — `client-entry-.tsx` — // that statically imports its page + its layout chain, then // calls into the runtime. // 4. Hands every per-route entry to `Bun.build` with // `splitting: true` + `metafile: true`. Bun's splitter sees // `client-runtime` (and thus React) imported by every entry // and extracts it into a shared chunk under `chunks/`. // 5. Walks `metafile.outputs` to emit a `manifest.json` keyed on // the project-relative component path the SSR side already // uses. The manifest lists the route's entry file + every // transitive `import` chunk so the SSR HTML head can emit the // right `