Bunflare v0.2.25 is a Bun bundler plugin that transforms Bun-native APIs (e.g., Bun.serve, bun:sqlite, Bun.password.hash) into Cloudflare Workers equivalents at build time. It targets developers who want Bun's DX but need to deploy to Cloudflare Workers. Key differentiators: zero runtime overhead (transform happens at build time), no code changes required for the developer, supports auto-discovery from wrangler.jsonc, and covers a wide range of Bun APIs including D1, KV, R2, Hyperdrive, WebCrypto, Workers Assets, and fullstack builds. Released as a dev dependency, it requires Bun >=1.0.0 and optionally integrates with Hono and Drizzle ORM. The package ships with TypeScript types. The project is actively maintained with recent commits.
npm install bunflareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal setup: install as devDep, create config with entrypoint, write standard Bun code, build with `bun bunflare`.
Upgrade Bun to >=1.0.0 and bunflare to latest.
Avoid TLS/unix socket options in Bun.serve. Use regular HTTP/HTTPS or omit options.
Use `bun bunflare` (if using Bun) or add a script in package.json: "build": "bun bunflare".
Ensure wrangler.jsonc exists with correct binding names. Use explicit config in bunflare.config.ts if needed.
Create global.d.ts with the snippet from the readme and run 'wrangler types' to generate worker-configuration.d.ts.
Install drizzle-orm: bun add drizzle-orm
Ensure your build step uses 'bun bunflare' or the Bunflare plugin, and deploy the output bundle (not the source).
Run 'bun add -d bunflare' and ensure your tsconfig includes node_modules/@types or the package types.
Switch to ESM (use import statements) or use a dynamic import: const bunflare = await import('bunflare')Verify the binding name in wrangler.jsonc and your config match. Also check that the D1 database is created and bound in Cloudflare dashboard.
Use import type { BunflareConfig } from 'bunflare' consistently and avoid re-exporting from other files.