Skip to content

Netlify CLI build command

build

Build on your local machine

Usage

Terminal window
netlify build

Flags

  • context (string) - Specify a deploy context for environment variables read during the build (”production”, ”deploy-preview”, ”branch-deploy”, ”dev”) or branch:your-branch where your-branch is the name of a branch (default: value of CONTEXT or ”production”)
  • dry (boolean) - Dry run: show instructions without running them
  • filter (string) - For monorepos, specify the name of the application to run the command in
  • debug (boolean) - Print debugging information
  • auth (string) - Netlify auth token - can be used to run this command without logging in
  • offline (boolean) - Disables any features that require network access

Examples

Terminal window
netlify build
netlify build --context deploy-preview # Build with env var values from deploy-preview context
netlify build --context branch:feat/make-it-pop # Build with env var values from the feat/make-it-pop branch context or branch-deploy context