Hacker News new | ask | show | jobs
by qmmmur 1663 days ago
How do you front load the whole svelte app?
1 comments

Disabling SSR and prerender within SvelteKit turns the output into an SPA, and the manualChunks option in vite-plugin-singlefile ensures the output is one file that includes every page of the site.
That's pretty nice. Surely if you have a big enough site with enough content loading all of it one go is not a pleasant experience on slow connections?
Depends on the site and content, for sure. This particular site is aggregating a subset of public profiles and posts from a social media network. To compare, the site I'm pulling the data from uses nearly 20MB to display a single uncached page of post titles and 2MB per subsequent page, while my site is able to display the entire userbase for a cost of 250kb and a single request for a ~5kb image on subsequent pages. The only difference is the choice of frameworks and component construction.
That's really great. Is it open source by any chance?
The existing code is rather specific to that site, but I've considered making a more generalized version that could work for any small app.