Cloudflare Workers
Develop Workers and manage bindings in an Nx workspace.
Connect Workers to the project graph using their Wrangler configuration. Megamono discovers wrangler.jsonc, wrangler.json, and wrangler.toml and adds development, deployment, type-generation, and log-tail tasks.
Add to your workspace
Check the Node.js and Nx requirements for this plugin before installing.
Install @megamono/nx-cloudflare as a development dependency using your workspace's package manager. Merge this entry into the existing plugins list in nx.json:
{
"plugins": [
"@megamono/nx-cloudflare"
]
}Run npm exec -- nx show projects to find your project, then npm exec -- nx show project <project> to see its tasks. Replace <project> with the name from the list.
Create or extend a Worker
- Create a Worker.
- Add a binding to connect a resource.
- Add a Durable Object.
Generators update project files; they do not deploy your Worker or create cloud resources. Configure resources and credentials separately.
Keep your deployment workflow
If you already wrap deployment in your own checks, set deployTargetName: false in the plugin options. You can also disable devTargetName while retaining type generation and dependency discovery. Inspect the project’s resolved targets before running a deployment command.