1

currently i am using tsc compilet(JIT) to compile my angular 2 application. for performance improvisation i am trying to switch to Aot Compilation using compiler/Cli.

I am referring this blog for AoT in my Rc5 Application. but stuck due to error while installing

npm install @angular/compiler-cli @angular/platform-server --save

error

I am confused between versions to use and proper direction.

Please suggest me blog or post for Aot in Angular 2 RC5 ? or tell me what is version of angular/compiler-cli to use for rc5 Help is really appreciated

sachin kulkarni
  • 737
  • 1
  • 13
  • 26

1 Answers1

0

Even though this question is off-topic and will result in mostly opinion based answers, I would suggest upgrading so that your application to the latest version of Angular. There is no reason to stay on a Release Candidate version.

After that install the angular-cli and transfer your project.

You can then use ng build --aot to compile your project using Ahead of Time.

Poul Kruijt
  • 69,713
  • 12
  • 145
  • 149
  • I cannot migrate to stable version for now. we are planning it in future. But client in insisting on performance improvisation now. We have tried minification (html/js/css) and found that files are loading in about 2 seconds(max) but app is taking about 6 minutes to initilize – sachin kulkarni Jan 30 '17 at 03:42
  • @sachinkulkarni with the latest angular, and using the cli to minify, optimize, treeshake, and ahead of time compile you code, your will see another huge improvement. 6 minutes initialisation is very doubtful coming from the angular side though. More probable this delay is coming from your database connection – Poul Kruijt Jan 30 '17 at 08:25
  • Sorry my mistake, its 6 seconds – sachin kulkarni Jan 30 '17 at 08:43
  • @sachinkulkarni then my advice sticks. For actual performance improvements. Upgrade your angular app, and use the angular-cli to build it – Poul Kruijt Jan 30 '17 at 08:45