Back to results for “Build”
Angular › Angular Schematics & Custom Builders

What is an Angular CLI builder, and how does it differ from a schematic?

Intermediate

Answer

A schematic generates or modifies source code files, while a builder actually performs a task using your project's code, such as building it for production, running tests, or deploying it somewhere. Builders are what power commands like ng build and ng test behind the scenes.
// angular.json referencing a builder for the build target
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": { "outputPath": "dist/my-app" }
}
Real-world example A team writes a custom builder that automatically uploads their built app to a cloud storage bucket after every successful production build, extending the standard ng build process with their own deployment step.

Common follow-ups: How would you create your own custom builder from scratch?;What other built in builders does the Angular CLI provide besides build and test?