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

New in Wrangler v2

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

  • wrangler.toml is no longer mandatory.
  • dev and publish accept CLI arguments.
  • tail can be run on arbitrary Worker names.
  • init creates a project boilerplate.
  • JSON bindings for vars.
  • Local mode for wrangler dev.
  • Module system (for both modules and service worker format Workers).
  • Devtools.
  • Typescript support.
  • Sharing development environment on the Internet.
  • Wider platform compatibility.
  • Developer hotkeys.
  • Better configuration validation.

Prefer a video format? The following video describes some of the major changes in Wrangler v2, and shows you how it can help speed up your workflow.

​​ Wrangler v1 and v2 comparison table

​​ Commands

Command v1 v2 Notes
publish
dev
preview Removed, use dev instead.
init
generate Removed, use git clone instead.
build Removed, invoke your own build script instead.
secret
route Removed, use publish instead.
tail
kv
r2 🚧 Introduced in Wrangler v1.19.8.
pages
config
login
logout
whoami
subdomain
report Removed, error reports are made interactively.

​​ Configuration

Property v1 v2 Notes
type = "webpack" Removed, refer to this guide to migrate.
type = "rust" Removed, use workers-rs instead.
type = "javascript" 🚧 No longer required, can be omitted.

​​ Features

Feature v1 v2 Notes
TypeScript You can give wrangler a TypeScript file, and it will automatically transpile it to JavaScript using esbuild under-the-hood.
Local mode wrangler dev --local will run your Worker on your local machine instead of on our network. This is powered by Miniflare.