How would you optimize the angular 2 application for better performance?

Well, optimization depends on the type and size of application and many other factors. But in general, I would consider the following points while optimizing the angular 2 app:

  1. Consider AOT compilation.
  2. Make sure the application is bundled, uglified, and tree shaking is done.
  3. Make sure the application doesn’t have un-necessary import statements.
  4. Make sure that any 3 rd party library, which is not used, is removed from the application.
  5. Have all dependencies and dev-dependencies are clearly separated.
  6. I would consider lazy loading instead of fully bundled app if the app size is more.

results matching ""

    No results matching ""