DEV Community

Discussion on: Lazy loading in Vue using Webpack's code splitting

Collapse
 
alexjoverm profile image
Alex Jover

I'd say there is no right answer for this. The best you can do is, when you consider it has grown and you wanna start splitting and chunking, benchmark the before and after of the splitting (first time load, initial load, navigating time...)

Said that, depends on which splitting:

  • For components, when they make sense to be lazy loaded (ej: Modals, Tooltip...)
  • Routes and Store: when you identify independent modules (ej: Products, Users management, ...) that they have not many dependencies aside from login token and so on
Collapse
 
onekiloparsec profile image
Cédric Foellmi

That's great tips, thanks a lot. Among the bazillions of things one needs to think about when building large stuff alone, this kind of comments help starts taking first decisions.