Managing a dependency-heavy app

Hi community,

I’m currently developing an ember app built with ember-cli. I’m wondering about a future solution to implement when the vendor dependencies are too heavy and will make our first page load very slow.

Currently the project JS file is about 34Kb and the vendor one 410Kb (both gzipped).

We would like to achieve this:

  • being able to lazy load some vendor scripts just in some pages
  • being able to lazy load custom components depending on the currently logged in user (maybe an enterprise customer with custom demands)
  • having different versions of the same library that has to be included depending of the user

Have someone ever tried something like this? Any pointer to start with?