4 ms·
There's a good middle ground of bundling your SPA into chunks of related files (I prefer to name them the SHA hash of the content), and giving them good cache l
by Klathmon 4y ago
There's a good middle ground of bundling your SPA into chunks of related files (I prefer to name them the SHA hash of the content), and giving them good cache lifetimes.
You can have a "vendor" chunk (or a few) which just holds all 3rd party dependencies, a "core components" chunk which holds components which are likely used on most pages, and then individual chunks for the rest of the app broken down by page or something.
It speeds up compilation, gives better caching, no need for a stateful mapping file outside of the HTML file loaded (which is kind of the point of the <link> tag anyway!), and has lots of knobs to tune if you want to really squeeze out the best load times.