commands
Function Bundling
The func command provides subcommands to work with Azure Function Apps optimizations
Run this command to see the full api: hulk func --help
hulk-func
Azure Function (Node.js) bundler
USAGE:
hulk func [OPTIONS] <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
--no-update Skip update checks (useful for CI)
--quiet Suppress all warnings from the output
SUBCOMMANDS:
build
help Print this message or the help of the given subcommand(s)
build
This command is for creating optimized builds for Function Apps running in Node.js.
The DevOps team saw that multiple JavaScript function apps were not bundled correctly and introduced latency and timeout errors when shipped to the App Service runtime.
This command works by:
- Evaluating the current directory structure (checking for a valid Azure Function project)
- Determining which package manager is used
- Checking for esbuild as a dev dependency
- Copying important files (
host.jsonandpackage.json) - Running a bounded number of local esbuild processes for function folders
- Giving the size of the produced output directory
Dependencies are never installed implicitly. If node_modules is missing, install dependencies yourself or pass --install to request a frozen/locked install. Hulk invokes npx --no-install, so npx cannot download a package during the build.
Bundles are assembled in a temporary directory next to the target. Hulk replaces the target only after every function succeeds, so a failed build leaves the previous deployable output intact.
Example:
if my current directory is /home/cyncly/web_api
Running the following command
hulk func build ./dist
Would produce the output here: /home/cyncly/web_api/dist
Run this command to see the full api: hulk func build --help
hulk-func-build
USAGE:
hulk func build [OPTIONS] <BUILD_DIR>
ARGS:
<BUILD_DIR> The directory where to produce the build
OPTIONS:
-h, --help Print help information
-m, --minify Whether to minify the output or not
-j, --jobs <JOBS> Maximum concurrent esbuild processes (1-64)
--install Install locked dependencies when node_modules is missing
--no-update Skip update checks (useful for CI)
--quiet Suppress all warnings from the output
Arguments
| Key | Value | Description |
|---|---|---|
BUILD_DIR (required) |
filesystem path | The directory where to produce the build |
Options
| Name | Value | Description |
|---|---|---|
-m, --minify |
bool | Minify each function bundles or not (defaults to true ) |
-j, --jobs |
int | Bound concurrent esbuild processes (defaults to max 4) |
--install |
bool | Explicitly perform a locked dependency install |
-h, --help |
bool | Print help information |
-q, --quiet |
bool | Supress all warnings from the output |