You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll also see a bar in your terminal with hotkeys for some added functionality-
B to open a browser
D to open devtools (relevant issue: TODO)
S to start a tunnel to the internet, and copies a url to your clipboard that you can share with anyone (relevant issue: TODO)
X (or Q) to quit
You'll note that you do NOT have to specify an account id. wrangler dev will infer your account id automatically (unless you provide it in your wrangler.toml or via CF_ACCOUNT_ID)
Notably, we aim to provide a default experience that's immediately useful, so you shouldn't have to setup a bundler/compiler for most usecases. So, you can use modules from npm, create separate modules, use react (todo: --jsx <reference> for other libraries), use typescript, and it should all Just Work.
This is currently powered by esbuild, but we may/may not change that in the future. We're not planning on exposing all the configuration options, or even the plugin interface yet. We have ideas for how we'll do this, and will share details when we have some clarity.
A notable miss is being able to 'polyfill' node's builtins (like crypto, path, etc) to provide compatibility with a number of libraries in the ecosystem. We'll do this soon (and perhaps for Deno libs as well?)
Similarly, we should probably also enable http imports for module.
That said, you're not blocked on setting up your own build pipeline, you can indeed use any tools you like (like, webpack, parcel, etc), and point wrangler to the output as an entry point. We'll document this properly soon.
We'd like to move away from custom build configuration, instead passing it directly in the cli, so you should be able to do, for example wrangler dev script.js -- webpack --watch (and similarly for publish) Custom builds implemented in implement custom builds, for dev and publish #149
wrangler dev will automatically infer whether you're using the service-worker format or the newer ES modules format.
This doesn't currently support wasm, workers-rs well, and we'll fix that soon. Done.
And finally, we haven't implemented all the other flags for dev yet. --port works, but we have yet to do --ip, --host, --local-protocol, --upstream-protocol.
This is the parent issue tracking the implementation of
wrangler dev.Usage
In it's simplest form, you can write a worker, say at
index.js, and run:wrangler dev index.js, and -Bto open a browserDto open devtools (relevant issue: TODO)Sto start a tunnel to the internet, and copies a url to your clipboard that you can share with anyone (relevant issue: TODO)X(orQ) to quitwrangler devwill infer your account id automatically (unless you provide it in yourwrangler.tomlor viaCF_ACCOUNT_ID)todo:for other libraries), use typescript, and it should all Just Work.--jsx <reference>We'd like to move away from custom build configuration, instead passing it directly in the cli, so you should be able to do, for exampleCustom builds implemented in implement custom builds, forwrangler dev script.js -- webpack --watch(and similarly for publish)devandpublish#149wrangler devwill automatically infer whether you're using theservice-workerformat or the newer ESmodulesformat.This doesn't currently supportDone.wasm,workers-rswell, and we'll fix that soon.--portworks, but we have yet to do--ip,--host,--local-protocol,--upstream-protocol.