JavaScript build hooks

Run custom JavaScript build scripts
Airplane allows you to run custom build scripts before and after dependencies are installed. This lets you to customize your task's environment and perform additional setup steps your tasks may require.

Build hooks in airplane.yaml configuration file

The simplest place to specify build hooks is in the airplane.yaml configuration file.
yaml
Copied
1
# airplane.yaml
2
3
javascript:
4
nodeVersion: "18"
5
preinstall: echo "preinstall"
6
postinstall: echo "postinstall"

Build hook files

You can also specify build hooks in their own files. This is useful for writing more complex build hooks that span multiple lines.
  • To run a script before dependency installation, create a file with the name airplane_preinstall.sh in the root directory of your project.
  • To run a script after dependency installation, create a file with the name airplane_postinstall.sh in the root directory of your project.
Airplane runs your custom build scripts as executables.