Cloudflare Docs
Workers
Visit Workers on GitHub
Set theme to dark (⇧+D)

What’s new

wrangler 2.0 introduces a number of new features for developing and deploying a Worker. This document is to show previous users of wrangler 1.x what they can expect when they move to wrangler v2.

  • wrangler.toml isn’t mandatory
  • dev and publish accept cli arguments
  • tail can be run on arbitrary script names
  • init creates project boilerplate
  • service environments
  • json bindings for vars
  • local mode for wrangler dev
  • module system (for both modules and service worker format workers)
  • devtools
  • typescript support ootb
  • sharing dev environment on the internet
  • wider platform compat
  • dev hotkeys
  • better config validation

Wrangler 1.0 and 2.0 comparison table

Commands

Command1.x2.0Notes
publish
dev
previewRemoved, use dev instead.
init
generateRemoved, use git clone instead.
buildRemoved, invoke your own build script instead.
secret
routeRemoved, use publish instead.
tail
kv
r2🚧Introduced in wrangler 1.19.8.
pages
config
login
logout
whoami
subdomain
reportRemoved, error reports are made interactively.

Configuration

Property1.x2.0Notes
type = "webpack"Removed, look at this guide to migrate.
type = "rust"Removed, use workers-rs instead.
type = "javascript"🚧No longer required, can be omitted.

Features

Feature1.x2.0Notes
TypeScriptYou can give wrangler a TypeScript file, and it will automatically transpile it to JavaScript using esbuild under-the-hood.
Local modewrangler dev --local will run your Worker on your local machine instead of on our network. This is powered by Miniflare.