How can I add a custom build step to my project?

Projects with advanced build requirements may demand several steps of execution before the final assets are output into the destination directory. Read on to learn how Vercel supports advanced project builds.

Custom Build Script

Projects on Vercel are built in an Amazon Linux 2 environment and are able to run custom scripts during the build. All that's required is a package.json file at the project root with a key like the following:

"scripts": {
"build": "wget;tar -zxvf ./custom-binary.tar.gz;./custom-binary.tar.gz;"
An example package.json file with a custom build script that fetches, unpacks, and executes a custom binary file.

You can also set a custom build command without creating a package.json file through your Project's settings in the dashboard.

You can find a list of frequently asked questions about the build environment in the documentation.

Couldn't find the guide you need?