Lesson 30 / 30

Building for Production

Package the app for deployment with ng build.

ng build

ng build compiles, minifies, and bundles the app into static files under dist/, ready to serve from any static host.

ng build
# output goes to dist/my-app/

What production mode does

A production build enables ahead-of-time (AOT) compilation, tree-shaking, and minification — smaller bundles and faster startup than the dev server.

Quick check: What command packages an Angular app for deployment?

  • ng serve
  • ng build
  • ng test
Answer

ng build — `ng build` produces optimized static files in `dist/`, while `ng serve` is only for local development.