New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@distilled.cloud/cloudflare-bundler

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@distilled.cloud/cloudflare-bundler

Effect-native bundler for Cloudflare Workers.

Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
5
-95.54%
Maintainers
3
Weekly downloads
 
Created
Source

@distilled.cloud/cloudflare-bundler

Effect-native Cloudflare Workers bundler built around a common core API and a rolldown implementation.

Support for other bundlers is coming soon.

Install

bun add @distilled.cloud/cloudflare-bundler effect@beta rolldown

Usage

import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
import * as NodePath from "@effect/platform-node/NodePath";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { Bundler } from "@distilled.cloud/cloudflare-bundler";
import { RolldownBundler } from "@distilled.cloud/cloudflare-bundler/rolldown";

const program = Effect.gen(function* () {
  const bundler = yield* Bundler;

  return yield* bundler.build({
    main: "./src/index.ts",
    rootDir: "/absolute/path/to/project",
    outDir: "/absolute/path/to/project/dist",
    minify: true,
    cloudflare: {
      compatibilityDate: "2026-03-10",
      compatibilityFlags: ["nodejs_compat"],
      additionalModules: {
        rules: [{ type: "CompiledWasm", globs: ["**/*.wasm"] }],
      },
    },
  });
});

const layer = Layer.provide(RolldownBundler, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer));

const result = await Effect.runPromise(Effect.provide(program, layer));
console.log(result.directory, result.main, result.modules);

build() returns an Output with:

  • directory: absolute output directory
  • main: relative path to the entry chunk within that directory
  • modules: all emitted modules, including the main ESM chunk and supported asset modules
  • format: always "esm" in v1
  • warnings: normalized build warnings

API

The public API is centered on:

  • Bundler in src/Bundler.ts
  • Output in src/Output.ts
  • Module in src/Module.ts

The current backend is:

  • RolldownBundler from @distilled.cloud/cloudflare-bundler/rolldown

Build Options

  • Required: main
  • Common options: rootDir, outDir, define, external, minify, keepNames, tsconfig, sourcemap
  • Cloudflare options: cloudflare.compatibilityDate, cloudflare.compatibilityFlags
  • Additional module support: cloudflare.additionalModules.rules, cloudflare.additionalModules.preserveFileNames

Current v1 Scope

  • Build-only
  • ESM-only
  • Rolldown-only
  • cloudflare:* externals
  • Node.js compatibility via unenv and Cloudflare presets
  • Additional modules for statically imported text, data, and wasm assets

Out Of Scope In v1

  • Watch mode
  • Service-worker / IIFE output
  • Rspack and esbuild adapters
  • Wrangler-specific __STATIC_CONTENT_MANIFEST
  • Filesystem scanning for dynamic import targets

Development

bun install
bun run format
bun run lint
bun run build
bun run test

License

MIT

Keywords

bundler

FAQs

Package last updated on 25 Mar 2026

Related posts