Deploying to Cloudflare Pages using Bun
Cloudflare v2 build system supports Bun out-of-the-box, nice!
Also, unlike v1, v2 supports any version of Node.js, Python, Go, Bun, Yarn, pnpm, you name it…
To enable v2 build system for the project, double check Build system version under the Builds & deployments section.
Build configurations:
- Build command:
bun run astro build - Build output directory:
/dist - Root directory:
- Build comments on pull requests:
Enabled
Variables and Secrets configs:
- Add
BUN_VERSIONaslatestto always use the latestbunpackage. Or specify a version if you want to fix it.
All configs:

Note: if your page flickers, refer to my previous post.
Viola. Happy days.