3 ms·
I'm not a web developer, though I still develop web apps regularly. What exactly is the point of a bundler in the rapid development cycle? If you want your web
by mgaunard 2y ago
I'm not a web developer, though I still develop web apps regularly.
What exactly is the point of a bundler in the rapid development cycle? If you want your web app to load up fast, it's better if you only need to redownload the parts that actually changed, so you're better off not bundling them.
- mikojan 2y agoYou need to use some kind of automation to fingerprint your files for optimal caching. Where applicable there simply does not exist a better caching strategy than fingerprint plus Cache-Control: immutable
- mgaunard 2y agoWell but I might have a hundred files, only one of which changed. The 99 other ones are still in the browser cache and don't need to be re-(down)loaded. If I bundle everything, then I have to scrap and reload everything, which is probably great for the final user, but not the developer actively modifying it.
- mikojan 2y agoA bundler does not necessarily produce a single file. I have not tried Mako. But from the docs it appears to do code splitting just like the others.
- aaaaaaabbbbbb 2y agoIf you have a lot of files, the initial (dev server) page load times increases linearly with the number of files you have. With a slow bundler, that tradeoff made sense, but with a fast bundler, it is suboptimal. Also, typically the application is split into multiple smaller bundles, so only a slice of the application is rebundled on change.
- 8n4vidtmkvmk 2y agoThe best solution (as always) is a hybrid. You want to bundle up a bunch of the small files, and split usually along loading boundaries such as page navs. For development, you don't need to "bundle" at all but you still need to transpile.
- chuckadams 2y agoIn a dev environment you can use the Vite dev server, which serves every module separately, compiles them on the fly as they’re requested, and hot-reloads them when they change. All at the granularity of single files. Bundling then only happens when building the final output.