wrangler.json or wrangler.toml. Wrangler supports both formats.
This documentation uses
wrangler.json (JSONC format with comments). All examples can be converted to TOML format.Configuration File
Location
Wrangler looks for configuration in:wrangler.jsonorwrangler.jsonc(JSON with comments)wrangler.toml- Custom path:
wrangler dev --config path/to/config.json
Basic Configuration
wrangler.json
Core Options
name
The name of your Worker (required for deployment):main
Entry point for your Worker:*.ts- TypeScript*.js- JavaScript*.mjs- ES modules*.tsx/*.jsx- JSX
compatibility_date
The compatibility date for the Workers runtime:compatibility_flags
Enable experimental or backward-compatible features:nodejs_compat- Node.js built-in modules and APIsnodejs_als- Node.js AsyncLocalStoragestreams_enable_constructors- Writable/Transform stream constructorstransformstream_enable_standard_constructor- Standard TransformStream
account_id
Your Cloudflare account ID:wrangler whoami.
workers_dev
Deploy to*.workers.dev subdomain:
false to only deploy to routes/custom domains.
Routes and Triggers
routes
Route patterns that trigger your Worker:route (single)
Define a single route:triggers.crons
Scheduled events (Cron Triggers):0 0 * * *- Daily at midnight UTC*/15 * * * *- Every 15 minutes0 */4 * * *- Every 4 hours0 9 * * MON-FRI- Weekdays at 9am UTC
Bindings
Bindings expose resources to your Worker via theenv parameter.
KV Namespaces
R2 Buckets
D1 Databases
Durable Objects
Queues
Service Bindings
Bind to other Workers:AI Bindings
Vectorize
Hyperdrive
Environment Variables
Define plain text variables:.dev.vars in development and wrangler secret put for production.
Build Configuration
no_bundle
Skip the build step:minify
Minify the bundled Worker:keep_names
Preserve function and class names:build.command
Custom build command:rules
Module rules for non-JS files:CompiledWasm- WebAssembly modulesText- Text filesData- Binary data as ArrayBufferESModule- ES modulesCommonJS- CommonJS modules
tsconfig
Custom TypeScript configuration:Development Configuration
dev
Development-specific settings:dev.ip
Bind address for the dev server:dev.port
Port for the dev server:dev.local_protocol
Protocol for the dev server:dev.persist_to
Persistence directory:Environments
Define environment-specific configurations:Assets
Workers Assets (Recommended)
Workers Sites (Legacy)
Advanced Options
unsafe
Unsafe bindings for advanced use cases:limits
Resource limits (Enterprise only):logpush
Enable Logpush:tail_consumers
Tail consumers for real-time logging:placement
Smart Placement:TypeScript Types
Generate TypeScript types from your configuration:worker-configuration.d.ts with type definitions for your bindings:
Configuration Validation
Wrangler validates your configuration and shows helpful error messages:Full Example
wrangler.json
See Also
Local Development
Run Workers locally with wrangler dev
Bindings
Learn about all available bindings
Environments
Manage multiple environments