I'm currently working on a Next.js application with next version 13.4.13
. The app follows the traditional pages directory structure.
Within this setup, there are 2 main pages organized as follows:
/pages/light
/pages/heavy
The light page is quite basic, containing a simple form.
In contrast, the heavy page is quite large, utilizing about 10mb of babylonjs.
Upon logging in, users are directed to the light page, which loads almost instantly due to its small JS size. However, when trying to navigate to the heavy page using the navbar, there is an observable 2-3 second delay as the browser fetches the hefty JS file.
My question is: how can I modify the settings in Next.js so that the JS for the heavy page begins downloading immediately upon logging in or landing on the light page? This way, users won't have to endure a wait when moving to the heavy page.