4 ms·
Webpack's chunking (https://github.com/webpack/docs/wiki/optimization#multi-page-app https://github.com/webpack/docs/wiki/optimization#multi-page...) will help
by chowes 11y ago
Webpack's chunking (https://github.com/webpack/docs/wiki/optimization#multi-page-app https://github.com/webpack/docs/wiki/optimization#multi-page...) will help you get the "hybrid" approach easily. It lets you separate out common modules into JS files for you to load when needed.
- zackify 11y agoThat's what came to mind reading this. Why a whole post on this when you can literally just go look at the webpack docs and do this in 5 seconds.
- vectorpush 11y agoI love webpack and highly recommend it, but it is not trivial to integrate it into an existing project and pretty much nothing about webpack can be described as "done in 5 seconds".
- dustingetz 11y agoI did it in a big project it took a couple days, really wasn't that big a deal, and legacy JavaScript still goes through webpack and works unmodified, then a couple weeks to iron out any kinks in the CI scripts (but was still developing during this time)
- vectorpush 11y agoA couple days sounds about right and jives with my own experiences, but I feel like "do this in 5 seconds" is pretty misleading, especially for someone who may have never used webpack before. It's absolutely worth the effort, but I wouldn't want someone to be discouraged had they expected a "5 second" solution but then realized it's not quite that simple.
- muzmath 11y agoThis is typical programmer attitude. Standard estimates go like this: When trying to make themselves look good on online developer forums: 1/100th real development time When estimating time involved for co-worker: 1/10th real development time When estimating time involved for themselves at work: 1/2 real development time
- phleet 11y agoWebpack's algorithm for doing this is not black magic -- it has to consciously consider the same tradeoffs as were involved in this post. How many chunks should you have?