@distilled.cloud/cloudflare-rolldown-plugin
Cloudflare工人的滚动插件.
安装
bun add @distilled.cloud/cloudflare-rolldown-plugin rolldown
使用量
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,
});
它会做什么
- 应用 Cloudflare 方便的滚动默认,用于分辨率和输出瞄准.
- 已支持的处理
cloudflare:* 作为外部进口.
- 启用节点.js 兼容shims 当
nodejs_compat 已经设定.
- 支持 Cloudflare 风格的额外模块
.wasm, (中文(简体) ), .bin, (中文(简体) ), .txt, (中文(简体) ), .html,以及 .sql。 。 。 .
- 支助
.wasm?init 进口.
选项
compatibilityDate?: string
compatibilityFlags?: string[]
许可证
麻省理工学院
关于 @distilled.cloud/cloudflare-rolldown-plugin 的常见问题
@distilled.cloud/cloudflare-rolldown-plugin 是什么?
Cloudflare工人的滚动插件.注意:该包已被作者标记为弃用——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。作者已将其标记为弃用,新项目建议寻找替代方案。