infrastructure//Cloudflare//Wrangler//.wrangler
The `.wrangler` directory is the hidden directory that Wrangler creates in the project root to hold the local state of all Cloudflare services: the *local cloud* on the developer's machine. It needs no configuration, since Wrangler creates and manages it automatically from the `wrangler.toml` bindings.
The .wrangler directory is the hidden directory that Wrangler creates in the project root to hold the local state of all Cloudflare services: the local cloud on the developer's machine. It needs no configuration, since Wrangler creates and manages it automatically from the wrangler.toml bindings.
The D1 SQLite files live here. A local write to D1 (--local) puts the rows into .wrangler/state/v3/d1/.../*.sqlite, and that file is the local database: no separate server, no daemon, only a file.
Workers KV local data and R2 local buckets are simulated here too, on the same pattern of local files that mimic the cloud service.
It lives in .gitignore, so GitHub never sees it. Code deploys (GitHub Actions, wrangler pages deploy) push only dist/ and functions/, and .wrangler/ stays local.
Deleting .wrangler/ loses all local data: the next wrangler dev recreates the directory structure, but the data is gone until it is pulled from remote again.
wrangler d1 export --local reads these SQLite files and generates a dump.sql, the transport file that can then be executed against the remote database:
1.wrangler/2dump.sql3Remote D1