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
- Installing dependencies
- Checking for esbuild as a dev dependency
- Copying important files (
host.jsonandpackage.json) - Multi threading esbuild containers for each given function (folder with a
function.jsonfile) - Giving the size of the produced output directory
Example:
if my current directory is /home/cyncly/web_api
Running the following command
hulk 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
--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 ) |
-h, --help | bool | Print help information |
-q, --quiet | bool | Supress all warnings from the output |