I need to put a website in production soon and am looking into the AOT to improve performance (my app needs about 3-4 secs to load on Chrome, 8-10 secs on Firefox, which is just not possible for production).
I followed the guide on https://angular.io/docs/ts/latest/cookbook/aot-compiler.html but am stuck with the compiling part...
If I type : node_modules/.bin/ngc -p tsconfig-aot.json I will get a nice "Compilation failed" with a list of around 100 hundred errors, like this one :
Error at /myapp/aot/app/contact/admin/contact-list.component.ngfactory.ts:64:7: Supplied parameters do not match any signature of call target.
Error at /myapp/node_modules/@angular/core/src/di/reflective_provider.d.ts:88:165: Cannot find name 'Map'.
For those who are interested :
The compiler will fail if you have Typescript errors (even if you forgot to type a variable, for example myVar = 6 will throw an error, myVar: any = 6 will pass).
The angular errors shouldn't be appearing and it has been solved for me by adding this dependency in my package.json :