vercel build
The command can be used to build a Vercel Project locally or in your own CI environment. Build artifacts are placed into the directory according to the Build Output API.
When used in conjunction with the command, this allows a Vercel Deployment to be created without sharing the Vercel Project's source code with Vercel.
This command can also be helpful in debugging a Vercel 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 command before invoking to ensure that you have the most recent Project Settings and Environment Variables stored locally.
Using the vercel build command to build a Vercel
Project.
These are options that only apply to the command.
The option can be specified when you want to build the Vercel Project using Production Environment Variables. By default, the Preview Environment Variables will be used.
Using the vercel build command with the
--prod option.
The option can be used to bypass the confirmation prompt and automatically pull environment variables and Project Settings if not found locally.
Using the vercel build command with the
--yes option.
Use the option to define the environment you want to build against. This could be production, preview, or a custom environment.
The following global options can be passed when using the vercel build command:
For more information on global options and their usage, refer to the options section.
Was this helpful?