Arguments
The path to an entry point for your Worker
Options
Basic Options
Name of the Worker
Date to use for compatibility checks
Flags to use for compatibility checksAlias:
--compatibility-flagUse the latest version of the Workers runtimeDefault:
falseStatic assets to be served. Replaces Workers Sites.
Build Options
Skip internal build steps and directly deploy WorkerDefault:
falseOutput directory for the bundled Worker
Output file for the bundled worker
Minify the Worker
The function that is called for each JSX element
The function that is called for each JSX fragment
Path to a custom tsconfig.json file
Path to output build metadata from esbuild. If flag is used without a path, defaults to ‘bundle-meta.json’ inside the directory specified by —outdir.
Routing Options
Routes to uploadAlias:
--routeCustom domains to deploy toAlias:
--domainEnvironment Options
A key-value pair to be injected into the script as a variable
A key-value pair to be substituted in the script
A module pair to be substituted in the script
When not used (or set to false), Wrangler will delete all vars before setting those found in the Wrangler configuration. When used (and set to true), the environment variables are not deleted before the deployment. If you set variables via the dashboard you probably want to use this flag. Note that secrets are never deleted by deployments.Default:
falseTrigger Options
Cron schedules to attachAlias:
--schedule, --schedulesDeployment Options
Don’t actually deploy
Send Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically.
Include source maps when uploading this Worker
Expire old assets in given seconds rather than immediate deletion
Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)
Version Control Options
A tag for this Worker Version
A descriptive message for this Worker Version and Deployment
Advanced Options
Enables strict mode for the deploy command, this prevents deployments to occur when there are even small potential risksDefault:
falseExperimental: Enables framework detection and automatic configuration when deployingDefault:
trueAlias: --x-autoconfigRollout strategy for Containers changes. If set to immediate, it will override
rollout_percentage_steps if configured and roll out to 100% of instances in one step.Choices: immediate, gradualExamples
Deploy using configuration file
Deploy with specific entry point
Deploy with a custom name
Deploy to a specific route
Deploy with environment variables
Deploy with a version tag and message
Dry run deployment
Deploy with source maps
Deploy to custom domain
Deploy static assets only
Deployment Workflow
- Build: Wrangler bundles your Worker code and dependencies
- Upload: The bundled code is uploaded to Cloudflare
- Publish: The Worker is deployed to Cloudflare’s global network
- Verify: Routes and triggers are configured
Version Control
Use--tag and --message to track deployments:
Environment Variables
By default, Wrangler deletes all existing variables before setting new ones. Use--keep-vars to preserve variables set via the dashboard: