Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
medzPublic archive

About

Rewrites Nitro's Cloudflare server output into a builderless-style worker bundle.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nitro-wrangler

npm version Test License

nitro-wrangler is a Nitro module that rewrites Nitro's Cloudflare server output into a builderless-style worker bundle.

Archived status

This repository is a temporary workaround and is now superseded by the upstream Nitro alternative in nitrojs/nitro#4136, "fix(build): handle rolldown external requires in nodeless builds".

This repository is archived and will not receive further development.

It changes the final .output/server shape so that:

  • user code is emitted as relative imports instead of being bundled into Nitro output
  • Nitro runtime chunks stay in .output/server/_libs
  • generated wrangler.json is rewritten with "main": "index.mjs" and "no_bundle": false

Install

npm i nitro-wrangler

Also install Nitro in your app:

npm i nitro

Usage

import { defineConfig } from "nitro/config";
import nitroWrangler from "nitro-wrangler";

export default defineConfig({
  preset: "cloudflare-module",
  modules: [nitroWrangler],
});

After nitro build, the worker entry in .output/server/index.mjs will import your app code via relative paths, and Wrangler can bundle the user graph from there.

Local Development

Build the package:

bun run build

Run the example app from the playground package:

bun run --cwd playground build
bunx wrangler deploy -c playground/.output/server/wrangler.json --dry-run

About

Rewrites Nitro's Cloudflare server output into a builderless-style worker bundle.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages