sailfork / t3code-github / .repos/ alchemy-effect/ packages/ cloudflare-runtime/ src/ rolldown
.repos/alchemy-effect/packages/cloudflare-runtime/src/rolldown/README.md
@alchemy.run/cloudflare-runtime/rolldown
Rolldown plugin for Cloudflare Workers.
Install
bun add @alchemy.run/cloudflare-runtime rolldown Usage
import { rolldown } from "rolldown";
import cloudflare from "@alchemy.run/cloudflare-runtime/rolldown";
const bundle = await rolldown({
input: "./src/index.ts",
plugins: [
cloudflare({
// Node.js compatibility is default-on for this date.
compatibilityDate: "2026-08-31",
}),
],
});
await bundle.write({
file: "./dist/index.js",
format: "esm",
sourcemap: true,
}); What It Does
- Applies Cloudflare-friendly Rolldown defaults for resolution and output targeting.
- Treats supported
cloudflare:*imports as external. - Enables Node.js compatibility shims when
nodejs_compatis set or the compatibility date is2026-08-04or later. - Supports Cloudflare-style additional modules for
.wasm,.bin,.txt,.html, and.sql. - Supports
.wasm?initimports.
Options
compatibilityDate?: stringcompatibilityFlags?: string[]
License
MIT