I am building the app with angular cli with aot=true and --prod so the app gets compiled with aot and bundle sizes are smaller, but how do I bootstrap the app in aot mode so that the bootstrap is faster like explained in this article?
Current code:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/app.module';
if (!environment.local) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
Code proposed by article:
import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
//** where is the following file generated by angular-cli? **
import { AppModuleNgFactory } from './app/app.module.ngfactory';
if (!environment.local) {
enableProdMode();
}
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
Where do I find app.module.ngfactory? Is this even needed? Or using platformBrowserDynamic with aot with angular cli still somehow results in aot bootstrap instead of jit bootstrap?