Update a Worker's configuration
The worker-config generator toggles opt-in production-readiness settings — Workers observability and Smart Placement — in an existing Worker’s wrangler.jsonc. It targets an existing Worker — scaffold one first with the application generator.
bunx nx g @naxodev/nx-cloudflare:worker-config --project=my-worker --observability
At least one of --observability or --smartPlacement is required.
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
project | string | (required) | The target Worker project to configure. Defaults to the project inferred from the current working directory. |
observability | boolean | false | Enable Workers observability (observability.enabled = true) so logs are retained. |
smartPlacement | boolean | false | Enable Smart Placement (placement.mode = "smart") so Cloudflare runs the Worker closest to your backend. |
skipFormat | boolean | false | Skip formatting files. |
- JSONC only. The generator edits
wrangler.jsonc/wrangler.jsonwhile preserving comments and formatting. A Worker onwrangler.tomlmust be converted first. - Passing neither
--observabilitynor--smartPlacementfails loudly — there is nothing for the generator to do. - The application generator exposes the same two flags at scaffold time, so
worker-configis only needed for Workers that already exist.
Verify
Section titled “Verify”{
"observability": { "enabled": true },
"placement": { "mode": "smart" }
}
Next steps
Section titled “Next steps”- Enable observability and Smart Placement — walkthrough of both flags
- application generator — scaffold a new Worker with these flags set from the start
- binding generator — add KV, R2, D1, and other bindings