Production Mode¶
Rule¶
You can check this option in your angular.json file :
{
"projects": {
"{my-project}": {
"architect": {
"build": {
"configurations": {
"production": {
"outputHashing": "all",
"optimization": true
}
}
}
}
}
}
}
- Improved performance - Production mode disables development-specific checks and validations, resulting in faster runtime execution and better overall application performance.
- Reduced bundle size - Angular removes development-only code in production builds, eliminating debugging information and assertions that aren't needed in production.
- Disabled change detection warnings - Angular suppresses various developer warnings and extra change detection cycles that are helpful during development but unnecessary in production.
- Tree-shaking optimization - Production builds enable more aggressive tree-shaking, removing unused code to minimize the final bundle size.
- Ahead-of-Time (AOT) compilation - Production mode typically uses AOT compilation, which pre-compiles templates and components rather than compiling them at runtime, improving initial load time.
- Enhanced security - Some debug information that might expose internal details about your application structure is removed in production mode.
- Error handling - Production mode changes how errors are handled, providing more user-friendly error experiences rather than detailed developer-oriented messages.