Build Features for Customizing Deployments
Vercel provides the following features to customize your deployments:
To install private npm packages during a build, add your registry credentials to your project as environment variables. Before Vercel installs your dependencies, it creates an .npmrc file from these variables, so you don't need to commit credentials to your repository.
| Variable | When to use it | Value |
|---|---|---|
NPM_TOKEN | Your private packages are on the npm registry at registry.npmjs.org | An npm access token with read access to the packages |
NPM_RC | Your packages are on another registry, such as GitHub Packages, or on several registries | The contents of an .npmrc file that configures each registry |
When a deployment has both variables, NPM_RC takes precedence over NPM_TOKEN.
To install packages from a registry other than npm, set NPM_RC to the contents of an .npmrc file. This example installs packages in the @acme scope from GitHub Packages and all other packages from the npm registry:
registry=https://registry.npmjs.org
@acme:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=your_npm_token_here
//npm.pkg.github.com/:_authToken=your_github_token_hereKeep registry.npmjs.org available in the file. Vercel installs its own runtimes from the npm registry during the build.
When your .npmrc file has more than one line, add it with Vercel CLI so that its line breaks are preserved. Run vercel env add once for each environment that needs the variable:
vercel env add NPM_RC --environment production < .npmrcA new variable applies to deployments that you create after you add it, so redeploy to use it.
You can also install a package from a private Git repository by referencing the repository in the dependencies of your package.json file. Create an access token that can only read that repository, and include it in the repository's HTTPS URL:
{
"dependencies": {
"private-package": "git+https://your_username:your_token@github.com/your_org/your_repo.git"
}
}The URL format depends on your Git provider:
| Git provider | Token to create | Dependency URL |
|---|---|---|
| GitHub | Personal access token with read-only repository access | git+https://your_username:your_token@github.com/your_org/your_repo.git |
| GitHub Enterprise Server | Personal access token with read-only repository access | git+https://your_username:your_token@your_hostname/your_org/your_repo.git |
| GitLab | Deploy token with the read_repository scope | git+https://your_token_username:your_token@gitlab.com/your_org/your_repo.git |
| GitLab self-managed | Deploy token with the read_repository scope | git+https://your_token_username:your_token@your_hostname/your_org/your_repo.git |
| Bitbucket | Repository access token with read access | git+https://x-token-auth:your_token@bitbucket.org/your_workspace/your_repo.git |
Vercel ignores certain files and folders by default and prevents them from being uploaded during the deployment process for security and performance reasons. These ignored files are only relevant when using Vercel CLI.
.hg
.git
.gitmodules
.svn
.cache
.next
.now
.vercel
.npmignore
.dockerignore
.gitignore
.*.swp
.DS_Store
.wafpicke-*
.lock-wscript
.env.local
.env.*.local
.venv
.yarn/cache
.pnp*
npm-debug.log
config.gypi
node_modules
__pycache__
venv
CVSA complete list of files and folders ignored by Vercel during the Deployment process.
If the directory that you deploy has a Cargo.toml file at its root, Vercel CLI also ignores the target directory at that root. To upload it, add !/target to your .vercelignore file.
The .vercel/output directory is not ignored when vercel deploy --prebuilt is used to deploy a prebuilt Vercel Project, according to the Build Output API specification.
During a prebuilt deploy, Vercel excludes a required function file from the upload if it also matches a rule in your .vercelignore (or .nowignore). The exceptions are files that match .pnp* and files in the node_modules, .next, .yarn/cache, .venv, venv, __pycache__, and root target directories. Vercel uploads these files when a prebuilt function needs them, even if your ignore file lists them.
Vercel provides special pathnames for accessing deployment source and build logs.
All deployment URLs have two special pathnames to access the source code and the build logs:
/_src/_logs
By default, these routes are protected so that they can only be accessed by you and the members of your Vercel Team.


By appending /_src to a Deployment URL or Custom Domain in your web browser, you will be redirected to the Deployment inspector and be able to browse the sources and build outputs.
By appending /_logs to a Deployment URL or Custom Domain in your web browser, you can see a real-time stream of logs from your deployment build processes by clicking on the Build Logs accordion.
If your project's Framework Preset is Other, this accordion is labeled Deploy Logs instead.
The pathnames /_src and /_logs redirect to https://vercel.com and require logging into your Vercel account to access any sensitive information. A third-party cannot access your source or build logs anonymously by crafting a deployment URL with one of these paths.
On Vercel, you can deploy Git submodules with a Git provider as long as the submodule is publicly accessible through the HTTP protocol. Git submodules that are private or requested over SSH will fail during the Build step. However, you can reference private repositories formatted as npm packages in your package.json file dependencies. Private repository modules require a special link syntax that varies according to the Git provider. For this syntax, see Install private Git repositories as dependencies.
Was this helpful?