Custom builds
Custom builds are a way for you to customize how your code is compiled, before being processed by Wrangler.
Custom builds are configured by adding a [build]
section in your Wrangler configuration file, and using the following options for configuring your custom build.
-
command
string optional- The command used to build your Worker. On Linux and macOS, the command is executed in the
sh
shell and thecmd
shell for Windows. The&&
and||
shell operators may be used. This command will be run as part ofwrangler dev
andnpx wrangler deploy
.
- The command used to build your Worker. On Linux and macOS, the command is executed in the
-
cwd
string optional- The directory in which the command is executed.
-
watch_dir
string | string\[] optional- The directory to watch for changes while using
wrangler dev
. Defaults to the current working directory.
- The directory to watch for changes while using
Example:
{ "build": { "command": "npm run build", "cwd": "build_cwd", "watch_dir": "build_watch_dir" }}
[build]command = "npm run build"cwd = "build_cwd"watch_dir = "build_watch_dir"
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark