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.1.0-next.1 (2024-12-04)
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| f280467398 | fix | account for multiple generated namespace imports in HMR (#58924) |
core
| Commit | Type | Description |
| -- | -- | -- |
| e894a5daea | feat | set kind field on template and effect nodes (#58865) |
| 3b765367f3 | fix | Explicitly manage TracingSnapshot lifecycle and dispose of it once it's been used. (#58929) |
migrations
| Commit | Type | Description |
| -- | -- | -- |
| e31e52e177 | fix | class content being deleted in some edge cases (#58959) |
| 508d3a1b3b | fix | correctly strip away parameters surrounded by comments in inject migration (#58959) |
| 7191aa6e09 | fix | don't migrate classes with parameters that can't be injected (#58959) |
| a4924af6d5 | fix | inject migration aggressively removing imports (#58959) |
| 35165d152d | fix | inject migration dropping code if everything except super is removed (#58959) |
| 68e5ba7a3a | fix | preserve type literals and tuples in inject migrations (#58959) |
platform-server
| Commit | Type | Description |
| -- | -- | -- |
| 1cfbfc66d3 | fix | remove peer dependency on animations (#58997) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="19.0.2"></a>