Skip to content

Set up the plugin

The init generator sets up workspace-level dependencies and plugin registration for Cloudflare Workers development with Nx, running automatically via nx add @naxodev/nx-cloudflare and from the library generator. The application generator does not run init — it registers the inference plugin itself and relies on a separate workspace-root install to reconcile its dependencies.

bunx nx g @naxodev/nx-cloudflare:init
Option Type Default Description
unitTestRunner vitest | jest | none vitest Test runner to use for unit tests.
js boolean false Use JavaScript instead of TypeScript.
skipFormat boolean false Skip formatting files.

The init generator runs @nx/js:init first, then adds the following packages:

PackageScopePinned version
tslibdependency^2.3.0
wranglerdevDependency^4.98.0
@cloudflare/workers-typesdevDependency^4.20260606.1
@cloudflare/vitest-pool-workersdevDependency^0.16.0
vitestdevDependency^4.1.0

It also registers @naxodev/nx-cloudflare/plugin in nx.json so that Worker lifecycle targets (serve, deploy, typegen, version-upload, tail) are inferred from Wrangler configs.

The init generator does not re-add @naxodev/nx-cloudflare itself to package.json — the plugin invoking the generator is already installed.

@naxodev/nx-cloudflare/plugin appears under plugins in nx.json, and wrangler is listed in your root package.json devDependencies.