LinuxCommandLibrary

zapier-build

Build Zapier integrations

TLDR

Create a build

$ zapier build
copy

Disable smart file inclusion (will only include files required by index.js)
$ zapier build --disable-dependency-detection
copy

Show extra debugging output
$ zapier build [[-d|--debug]]
copy

SYNOPSIS

zapier-build [options] [app_path]

PARAMETERS

app_path
    Optional. Specifies the path to the root directory of the Zapier app project. If omitted, the command defaults to the current working directory.

--clean
    When this option is used, the command will first remove the existing build output directory (typically .zapierapp) before creating a new build. This ensures a fresh build and helps prevent stale or cached files from being included.

--watch
    This option enables 'watch mode'. In watch mode, the command continuously monitors the project files for changes. Upon detecting a change, it automatically triggers a rebuild of the app, which is particularly useful for rapid development and testing cycles.

--help, -h
    Displays a help message for the zapier-build command, detailing its usage, available options, and arguments.

DESCRIPTION

The zapier-build command is a utility within the Zapier Platform CLI designed to compile the source code of a custom Zapier integration app into a deployable bundle. It processes the JavaScript or TypeScript files, resolves dependencies, and optimizes the code, typically minifying it, to create a production-ready package. This built output, usually placed in a .zapierapp directory, is then ready to be pushed or deployed to the Zapier platform using commands like zapier push or zapier deploy. It plays a crucial role in the development workflow of Zapier apps, transforming human-readable code into an efficient format for the Zapier runtime environment.

While often invoked as a subcommand of the main zapier executable (i.e., zapier build), the prompt refers to zapier-build, which can be directly invoked if the CLI is installed globally or from the node_modules/.bin directory.

CAVEATS

The zapier-build command is not a standard Linux utility; it is specific to the Zapier Platform CLI and requires Node.js to be installed on the system. It assumes a specific project structure for Zapier integration apps. Direct invocation as zapier-build might depend on how the Zapier CLI is installed (globally or locally) and the system's PATH configuration. Developers commonly use zapier build as part of the overall zapier CLI.

PREREQUISITES

To use zapier-build, you must have Node.js installed on your system, and the Zapier Platform CLI (zapier-platform-cli npm package) must be installed globally or locally within your project.

BUILD OUTPUT

Upon successful execution, zapier-build generates a new directory, typically named .zapierapp (configurable), within your project's root. This directory contains the compiled, minified, and optimized JavaScript bundle of your Zapier app, along with any necessary asset files and metadata. This packaged output is what Zapier reads when you publish or deploy your integration.

HISTORY

The Zapier Platform CLI was introduced to empower developers to build custom integrations programmatically, offering more flexibility and power than the web-based builder alone. The build command has been a foundational component of this CLI since its early versions, providing the essential step to compile JavaScript or TypeScript source code into the bundled format required for the Zapier platform. Its functionality has remained consistent, focusing on packaging and optimizing app code for efficient execution within Zapier's environment.

SEE ALSO

zapier(1), zapier-push(1), zapier-deploy(1), npm(1), node(1)

Copied to clipboard