Deploy using a specific config file

deploy & domains

// what it does

-c / --config points wrangler at a specific configuration file instead of the default wrangler.jsonc in the current directory. Reach for it in monorepos where several Workers each keep their own config, or when you split prod and staging into separate files. Combine it with --env to also select an environment inside that file.

// shell

$ wrangler deploy -c wrangler.staging.jsonc
$ wrangler deploy --config ./workers/api/wrangler.jsonc

// gotcha

Paths inside the chosen config (main, assets, migrations dir) resolve relative to the config file's location, not your shell's cwd — a hand-written relative main can break when run from elsewhere.