#How to set up script separation?
3 messages · Page 1 of 1 (latest)
hmm, that's a bit tricky, not sure even possible, but one thing get you the same result or even better, is "dynamic import" not only the page loads the needed js but even only when needed e.g. on event,...
I know that all bundled js come with the hoisted file that is loaded on any page, and dynamic import can reduce its size.
here an example how a library was shifted to be dynamically imported https://github.com/HomeSmartMesh/website/blob/2a3d26efa537dc56d267ce184415382785a6fbaa/src/components/panzoom/panzoommodal.js#L62