Pre-bundle astro/fetch and astro/hono in Cloudflare optimizeDeps (#16914)
## Goal Eliminate the 'new dependencies optimized: astro/fetch' warning during dev in the Cloudflare adapter. The advanced routing feature (d69f858475, #16366) introduced astro/fetch and astro/hono exports, and the Cloudflare handler entry points (01aa1648ef, #16729) import from them — but neither commit added these to the optimizeDeps.include list. Vite discovers them at runtime and triggers a late re-optimization. ## Decisions - Added both astro/fetch and astro/hono: the Cloudflare adapter imports from both (hono.ts imports FetchState from astro/fetch, and astro/hono is used similarly). Pre-bundling both prevents the same issue for either entry point. ## Changes - packages/integrations/cloudflare/src/index.ts: added astro/fetch and astro/hono to the server environment optimizeDeps.include array, alongside the existing astro/app and astro/app/fetch/default-handler entries.
M
Matthew Phillips committed
4bdd240a6174b12ee9344d9b97456079aa5975ce
Parent: 17a0fbd
Committed by GitHub <noreply@github.com>
on 5/30/2026, 8:27:16 PM