Skip to content
Docs

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.

VariableWhen to use itValue
NPM_TOKENYour private packages are on the npm registry at registry.npmjs.orgAn npm access token with read access to the packages
NPM_RCYour packages are on another registry, such as GitHub Packages, or on several registriesThe 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:

.npmrc
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_here

Keep 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:

terminal
vercel env add NPM_RC --environment production < .npmrc

A 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:

package.json
{
  "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 providerToken to createDependency URL
GitHubPersonal access token with read-only repository accessgit+https://your_username:your_token@github.com/your_org/your_repo.git
GitHub Enterprise ServerPersonal access token with read-only repository accessgit+https://your_username:your_token@your_hostname/your_org/your_repo.git
GitLabDeploy token with the read_repository scopegit+https://your_token_username:your_token@gitlab.com/your_org/your_repo.git
GitLab self-managedDeploy token with the read_repository scopegit+https://your_token_username:your_token@your_hostname/your_org/your_repo.git
BitbucketRepository access token with read accessgit+https://x-token-auth:your_token@bitbucket.org/your_workspace/your_repo.git

The token is stored in package.json and your lockfile, so everyone who can read your project's repository can use it. Limit the token to read access on the one repository it installs. To keep credentials out of your repository, publish the package to a private registry and authenticate with NPM_TOKEN or NPM_RC instead.

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.

ignored-files
.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
CVS

A 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.

You do not need to add any of the above files and folders to your .vercelignore file because it is done automatically by Vercel.

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.

Build Logs and Source Protection is enabled by default.

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.

Last updated September 16, 2026

Was this helpful?

supported.