@distilled.cloud/cloudflare-rolldown-plugin

中文文档
0.17.1发布于 2026/08/06MITTypeScriptES Module构建来源已验证近 30 天下载 16.4万

Rolldown plugin for Cloudflare Workers.

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录5 节
  1. Install
  2. Usage
  3. What It Does
  4. Options
  5. License

@distilled.cloud/cloudflare-rolldown-plugin

Rolldown plugin for Cloudflare Workers.

Install

bun add @distilled.cloud/cloudflare-rolldown-plugin rolldown

Usage

import { rolldown } from "rolldown";
import cloudflare from "@distilled.cloud/cloudflare-rolldown-plugin";

const bundle = await rolldown({
  input: "./src/index.ts",
  plugins: [
    cloudflare({
      compatibilityDate: "2026-04-01",
      compatibilityFlags: ["nodejs_compat"],
    }),
  ],
});

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_compat is set.
  • Supports Cloudflare-style additional modules for .wasm, .bin, .txt, .html, and .sql.
  • Supports .wasm?init imports.

Options

  • compatibilityDate?: string
  • compatibilityFlags?: string[]

License

MIT

版本与发布记录

@distilled.cloud/cloudflare-rolldown-plugin 共发布 67 个版本,首次发布于 2026/04/03;过去 12 个月发布了 67 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.17.1latest2026/08/063 个月前
0.17.02026/08/063 个月前
0.16.12026/08/063 个月前
0.16.02026/08/053 个月前
0.15.02026/07/313 个月前
0.14.02026/07/293 个月前

其他发布通道:beta → 0.4.1-beta.8。

关于 @distilled.cloud/cloudflare-rolldown-plugin 的常见问题

@distilled.cloud/cloudflare-rolldown-plugin 是什么?

Rolldown plugin for Cloudflare Workers.注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @distilled.cloud/cloudflare-rolldown-plugin?

在项目目录运行 npm install @distilled.cloud/cloudflare-rolldown-plugin,或使用 pnpm add / yarn add / bun add。

@distilled.cloud/cloudflare-rolldown-plugin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@distilled.cloud/cloudflare-rolldown-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@distilled.cloud/cloudflare-rolldown-plugin 可以商用吗?

@distilled.cloud/cloudflare-rolldown-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@distilled.cloud/cloudflare-rolldown-plugin 的下载量有多少?

根据 npm 官方下载统计,@distilled.cloud/cloudflare-rolldown-plugin 在 2026/10/13 – 2026/11/11 这 30 天内被下载 163,943 次,日均约 5,465 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@distilled.cloud/cloudflare-rolldown-plugin 还在维护吗?

最新版本 0.17.1 发布于 2026/08/06(3 个月前);至今共发布 67 个版本,其中过去 12 个月发布了 67 个;首次发布于 2026/04/03。作者已将其标记为弃用,新项目建议寻找替代方案。