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:

  1. Evaluating the current directory structure (checking for a valid Azure Function project)
  2. Determining which package manager is used
  3. Installing dependencies
  4. Checking for esbuild as a dev dependency
  5. Copying important files (host.json and package.json)
  6. Multi threading esbuild containers for each given function (folder with a function.json file)
  7. 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

KeyValueDescription
BUILD_DIR (required)filesystem pathThe directory where to produce the build

Options

NameValueDescription
-m, --minifyboolMinify each function bundles or not (defaults to true )
-h, --helpboolPrint help information
-q, --quietboolSupress all warnings from the output