angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

build and ng serve really slow on aot , is there any solution ?

Open jjlgjkkl opened this issue 9 years ago • 7 comments

I am using cli1.0.6 and angular4.0.3 and have developed 100+ lazy load modules. when enabled aot,
ng serve --aot=true can cause more than 10 min and even ng build --prod --aot=true spend more than 10 min

that means aot cannot be used both on dev and prod

is there any way can help me ?

jjlgjkkl avatar May 31 '17 06:05 jjlgjkkl

As it is stated in the official documentation:

"Today AOT compilation and tree shaking take more time than is practical for development. That will change soon. For now, it's best to JIT compile in development and switch to AOT compilation before deploying to production."

So it's better to develop your app in jit.

Source: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#jit-in-development-aot-in-production

echonax avatar Jun 01 '17 05:06 echonax

Closing as answered by @echonax, cheers!

filipesilva avatar Jun 01 '17 10:06 filipesilva

I have the same question, how do you solve it

lliukui avatar Apr 08 '18 09:04 lliukui

use "ng serve" That should solve your problem

anothershubham avatar Jun 07 '18 10:06 anothershubham

You can use this flag while compiling: ng serve --source-map=false

It take 10sec to compile now while previously it was taking 32sec. source-map is just used for debugging. So if not using debugger you can disable and compile.

anothershubham avatar Jun 22 '18 10:06 anothershubham

I have a same issue "ng serve" take 30 minutes tocompile same code used to work faster when used on angular2. Please assist. I am using windows7 @angular/cli: 1.0.4 node: 8.11.3 os: win32 x64 @angular/common: 4.4.7 @angular/compiler: 4.4.7 @angular/core: 4.4.7 @angular/forms: 4.4.7 @angular/http: 4.4.7 @angular/platform-browser: 4.4.7 @angular/platform-browser-dynamic: 4.4.7 @angular/router: 4.4.7 @angular/cli: 1.0.4 @angular/compiler-cli: 4.4.7

ShrutiSarode avatar Jul 19 '18 05:07 ShrutiSarode

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.