Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
Why Angular 9 has to pre-compile itself code?

I've just upgraded my project to Angular 9 and the first thing that I noticed is that the build time increased significantly in my CI (From 2 minutes to 4 minutes).

Analysing the logs, every time the tests or the build is performed, the CLI performs a pre-compilation. This is due to the new Ivy architecture, but from my understading, this compilation should only happen to code that isn't Ivy compatible.

So why I'm seeing lots of Compiling @angular/common : es2015 as esm2015 (Mostly from @angular packages) in my build ? Shouldn't Angular code itself be compatible with Ivy ?

Note: This also happens with a fresh project (Just with few libraries).

Update This happens with all commands that requires a build. Ex:

  • ng test --code-coverage=true --watch=false --browsers=ChromeHeadle
  • ng b -c=staging --aot

Update 2

I'm adding my builds for comparison: pre angular 9 and after angular 9 migration (The build still failing, but we can use the unit test as reference, from ~2 minutes to ~4 minutes of total execution)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This article helpfully explains why Angular 9 compiles dependencies with ngcc and the Ivy compilation road map.

In short, because Ivy instruction set will be stabilized in Angular 10 only, Angular team recommends not yet to publish packages compiled to Angular 9 Ivy. After Angular 10, package maintainers will be encouraged to publish Ivy packages; View Engine packages will still be supported, but not encouraged.

From this, I conclude some time after Angular 10 release, we will see significantly less ngcc compilation going on, in some cases none, depending on packages used by particular project. In Angular 9, ngcc compilation step is a necessary compromise you'll have hard time getting rid of.

As for CI speed, the official docs suggest ngcc can be executed explicitly. I think it might be possible to cache this step in CI, but not being aware of your particular setup, I can't suggest anything beyond research direction.

Update 1: Angular 9.1 promises ngcc build speed improvements.

Update 2: Angular 12 deprecates legacy compilation and View Engine rendering pipeline.

Update 3: Angular 13 has removed ViewEngine

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda