Santosh
Santosh

Reputation: 297

How to reduce initialization page loading time in webpack angular 2 ?

In my angular 2 application . i wanted to reduce the time of page loading . When i load the page for the first-time it takes 13 sec to load . Please help me with suggestions.

Upvotes: 1

Views: 402

Answers (3)

user8112829
user8112829

Reputation:

Also apply AOT on top of the Webpack it will make drastic change in performance.

Follow below instructions it may be help to you.

  • Build the application in production mode
  • Bundle the Js and CSS file
  • Load images with SubDomain
  • Implement lazy loading where possible

Upvotes: 1

Eduardo Vargas
Eduardo Vargas

Reputation: 9392

What is recommended is that when developing you don`t need to use the prod and aot flags because the compile time is way longer but when building the application for production try using

ng build -aot -prod 

it should make it a lot faster. Be aware that some errors may occur in this mode so make to sure to test your workflows before deploying.

Upvotes: 0

KrystianC
KrystianC

Reputation: 442

Upgrade to Angular 4. It is much faster

Upvotes: 0

Related Questions