How do you optimize Angular application builds for production?
- Use the production flag with ng build:
ng build --prod
- This enables:
- AOT compilation (Ahead-of-Time)
- Minification and Uglification of code
- Tree shaking to remove unused code
- Bundling for fewer HTTP requests
- Enables optimizations in angular.json