Skip to main content
Wrangler uses a configuration file (typically wrangler.json or wrangler.toml) to define your Worker’s settings, bindings, and deployment options.

Configuration File Formats

Wrangler supports two configuration formats:
  • JSONC (.json or .jsonc): JSON with comments
  • TOML (.toml): Tom’s Obvious Minimal Language
For new projects, we recommend using JSONC format for better IDE support and validation.

Core Configuration

name

string
required
The name of your Worker. This is used in the Workers dashboard and CLI output.

main

string
Path to the entry point of your Worker.

compatibility_date

string
required
A date in the form yyyy-mm-dd that specifies which version of the Workers runtime to use.

compatibility_flags

string[]
Flags that enable or disable specific runtime features.

account_id

string
Your Cloudflare account ID.

Build Configuration

rules

Rule[]
Module import rules for non-JavaScript files.

minify

boolean
Whether to minify the Worker script.

define

Record<string, string>
Replace global identifiers with constant expressions.

tsconfig

string
Path to a custom TypeScript config file.

Bindings

vars

Record<string, string>
Environment variables available in your Worker.

kv_namespaces

KVNamespace[]
KV namespace bindings.

durable_objects

object
Durable Object bindings.

r2_buckets

R2Bucket[]
R2 bucket bindings.

d1_databases

D1Database[]
D1 database bindings.

queues

object
Queue bindings for producers and consumers.

services

Service[]
Service bindings to other Workers.

analytics_engine_datasets

AnalyticsEngine[]
Analytics Engine dataset bindings.

Routing

routes

Route[]
Routes that trigger your Worker.

route

string
Single route pattern (alternative to routes).

Static Assets

assets

object
Configuration for Workers Assets.

site

object
Configuration for Workers Sites (legacy).

Development

dev

object
Local development configuration.

Migrations

migrations

Migration[]
Durable Object migrations.

Observability

logpush

boolean
Enable Logpush for this Worker.

tail_consumers

TailConsumer[]
Workers to send tail logs to.

Limits

limits

object
Resource limits for your Worker.

Environment Overrides

You can define environment-specific overrides:
Deploy to staging: