Skip to content

vercel build

Learn how to build a project locally or in your own CI environment.

The vercel build command can be used to build a project locally or in your own CI environment. Build artifacts are placed into the .vercel/output directory according to the Build Output API.

When used in conjunction with the vercel deploy --prebuilt command, this allows a Vercel Deployment to be created without sharing the Project's source code with Vercel.

This command can also be useful for debugging a Project, by receiving error messages for a failed build locally, or by inspecting the resulting build artifacts to get a better understanding of how Vercel will create the Deployment.

It is recommended to run the vercel pull command before invoking vercel build to ensure that you have the most recent Project Settings and Environment Variables stored locally.

vercel build

Using the vercel build command to build a project.

The following global options can be passed when using the vercel build command:

  • --cwd
  • --debug
  • --global-config
  • --help
  • --token

For more information on global options and their usage, refer to the options section.

These are options that only apply to the vercel build command, therefore, more information is provided.

The --prod option can be specified when you want to build the Project using Production Environment Variables. By default, the Preview Environment Variables will be used.

vercel build --prod

Using the vercel build command with the --prod option.

The --yes option can be used to bypass the confirmation prompt and automatically pull environment variables and project settings if not found locally.

vercel build --yes

Using the vercel build command with the --yes option.