The Angular docs specify several reasons for using AOT compilation in favor of JIT:
- Faster rendering
- Fewer asynchronous requests
- Smaller Angular framework download size
- Detect template errors earlier
- Better security
However, when looking for arguments to use JIT I found none. Moreover, after upgrading from Angular 5.2 to Angular 8 I suddenly get a strange error when running a dev build (using JIT). The error is:
ERROR in ./src/app/shared/app-configuration/shared/app-configuration.model.ts 22:16-35
"export 'IMyComponents' was not found in '@mycompany/mypackage'
When running a prod build (using AOT) everything was fine. This surprised me as I never ran into an Angular compilation problem in which the prod build succeeded and the dev build failed.
So my assumption is that JIT is only suitable for development builds (i.e. speed). And adding the --aot flag can be done safely without any problem. Or am I missing something?