2 ms·
Not a hardcore JS-dev, but two things I noticed as someone who has optimized their JS output before: - I am surprised that this blog post advertises webpack tr
by hobofan 9y ago
Not a hardcore JS-dev, but two things I noticed as someone who has optimized their JS output before:
- I am surprised that this blog post advertises webpack tree-shaking, as it is completely broken right now, and has been for a year[0]
- More and more people are switching to date-fns[1] from moment.js, since it is much smaller and composable by default, and works better with tree-shaking in rollup (or webpack once it's fixed). Yes, their recommendation of ContextReplacementPlugin is valid, but in the case of moment.js, its probably better to just use a replacement.
[0] https://github.com/webpack/webpack/issues/2867 https://github.com/webpack/webpack/issues/2867
[1] https://github.com/date-fns/date-fns https://github.com/date-fns/date-fns
- jeeberz 9y agoAngular 5 has been using the webpack ModuleConcatenationPlugin to reduce bundle sizes by half. It does Rollup-like scope hoisting. Google for "angular build optimizer".