Skip to main content
Angular CLI - ng build

Angular CLI - ng build

Compile an Angular application or library into deployable build output.

Angular CLI - ng build illustration

How it works

ng build compiles an application or library using its configured builder. Production configurations typically enable optimizations and output hashing. Inspect warnings and output paths, and serve the built artifact in a deployment-like environment before release.

Good practice

  • Check the local Angular CLI version and run commands from the intended workspace.
  • Review angular.json targets and builders before assuming optional commands are configured.
  • Use the package manager and lockfile selected by the project.
  • Review generated files, configuration changes, and build output before committing or deploying.

Further reading: Tutorialspoint: Angular CLI - ng build · Current Angular CLI reference · Workspace configuration.