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.toml
, 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: