What is @angular/compiler-cli?
The @angular/compiler-cli package provides command-line interfaces to perform Angular compilations. It is primarily used to compile Angular applications into JavaScript code that can be executed by browsers. It leverages the Angular Compiler (ngc) which is a superset of the TypeScript compiler (tsc) and includes Angular-specific metadata processing.
What are @angular/compiler-cli's main functionalities?
Ahead-of-Time (AOT) Compilation
Compiles Angular HTML and TypeScript code into efficient JavaScript code during the build process before the browser downloads and runs that code. This is the main feature of the compiler-cli which results in faster rendering, fewer asynchronous requests, smaller Angular framework download size, and better security.
ngc -p tsconfig.app.json
Incremental Builds
Supports incremental compilation by reusing the previous compilation results to speed up subsequent compilations. This feature is useful for large projects to reduce build times.
ngc --incremental
Link Time Code Generation
Processes libraries to generate Ivy-compatible code as part of the Angular Ivy compilation pipeline. This feature is used when compiling libraries with the Ivy renderer.
ngc --create-ivy-entry-points
Other packages similar to @angular/compiler-cli
typescript
The TypeScript compiler is similar to @angular/compiler-cli in that it compiles TypeScript code to JavaScript. However, it does not have Angular-specific metadata processing capabilities and is not tailored for Angular applications.
babel
Babel is a JavaScript compiler that can transform syntax, polyfill features that are missing in your target environment, and more. While it is not specific to Angular, it is often used in the JavaScript ecosystem for compiling next-generation JavaScript code down to a form that can be executed in current browsers.
webpack
Webpack is a module bundler that can also perform various optimizations and transformations on your code, including compiling TypeScript with the appropriate loader. It is more general-purpose compared to @angular/compiler-cli and is used in a wide variety of JavaScript applications, not just Angular.
19.0.1 (2024-11-26)
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| fb1fa8b0fc | fix | more accurate diagnostics for host binding parser errors (#58870) |
core
| Commit | Type | Description |
| -- | -- | -- |
| 502ee0e722 | fix | correctly clear template HMR internal renderer cache (#58724) |
| 99715104a1 | fix | correctly perform lazy routes migration for components with additional decorators (#58796) |
| 118803035f | fix | Ensure _tick is always run within the TracingSnapshot. (#58881) |
| 08b9452f01 | fix | Ensure resource sets an error (#58855) |
| 84f45ea3ff | fix | make component id generation more stable between client and server builds (#58813) |
| d3491c7cee | fix | Prevents race condition of cleanup for incremental hydration (#58722) |
forms
| Commit | Type | Description |
| -- | -- | -- |
| 4dfe5b6cef | fix | work around TypeScript 5.7 issue (#58731) |
language-service
| Commit | Type | Description |
| -- | -- | -- |
| a983865bff | fix | add fix for individual unused imports (#58719) |
| e6e7a4e22b | fix | allow fixes to run without template info (#58719) |
migrations
| Commit | Type | Description |
| -- | -- | -- |
| 5ce10264a4 | fix | fix provide-initializer migration when using useFactory (#58518) |
| d4f5c85f60 | fix | handle parameters with initializers in inject migration (#58769) |
| a6d2d2dc10 | fix | Mark hoisted properties as removed in inject migration (#58804) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="19.0.0"></a>