Install Nx Cloudflare
import { Steps } from ‘@astrojs/starlight/components’;
Prerequisites
Section titled “Prerequisites”- Node.js 22 or later — an active LTS release (Node 24 is the latest). Required by Nx and Wrangler.
- An existing Nx workspace. If you don’t have one, create it with
bunx create-nx-workspace@latest. - A package manager: bun, npm, yarn, or pnpm. Examples below use
bunx.
-
Add the plugin
The recommended way is
nx add, which installs the package and runs theinitgenerator to set up workspace-level dependencies and register the inference plugin:bunx nx add @naxodev/nx-cloudflareThis installs Wrangler v4,
@cloudflare/workers-types, and Vitest as devDependencies, and adds@naxodev/nx-cloudflare/pluginto thepluginsarray innx.jsonso Worker targets are inferred automatically. -
(Alternative) Install manually
If you prefer to control setup yourself, install the package and Wrangler separately, then register the plugin in
nx.json:bun add -D @naxodev/nx-cloudflare wranglerThen add the plugin to
nx.json:{ "plugins": ["@naxodev/nx-cloudflare/plugin"] }See Plugin options for the object form if you need to customize inferred target names.
-
Verify the plugin is registered
Confirm Nx recognizes the plugin by refreshing the project graph and inspecting a Worker project (once you have one):
bunx nx reset bunx nx show project <my-worker>The output should list
serve,deploy,typegen,version-upload, andtailtargets. If you don’t have a Worker yet, the Quick start walks through generating one.
Next steps
Section titled “Next steps”- Quick start — create, serve, and deploy your first Worker.
- application generator — scaffold a Worker application with C3.
- binding generator — add a KV, R2, D1, Durable Object, Queue, Workflow, or Service binding to a Worker.
- Plugin options — customize inferred target names.