This is a pretty decent default setup. But sometimes, we need much better control for loading modules. For example, have a look at the following scenario, where:
In this case, our main app bundle contains the
firebase module, simply because it is used in all of our pages. It is a pretty big module. (More than the size of react, react-dom and next.js all combined)
But when it comes to client side, we only need it when the user starts navigating into a different page. So, if we can load the
firebase module at that time, we can improve the initial loading of our app.
That is exactly what we are trying to do with this lesson.