Re:Webpack 3: Official Release
by yunyu on Tuesday June 20, 2017 @07:54AM
(#14593802)
Have you tried rollup? Webpack's tree shaking is broken and doesn't work properly with libraries structured like d3, while rollup's works properly. I've managed to get trivial 150kb minified size reductions by switching.
[ Parent
| on HN ]
But isn't Rollup.js directed at libraries whereas Webpack aims for JS apps?
Re:Webpack 3: Official Release
by moron4hire on Tuesday June 20, 2017 @08:10AM
(#14593911)
I use Rollup for both, though I don't remember exactly how, as I made a project out of my build setup: https://capnmidnight.github.io/marigold-build
Rollup looks nice too. As far I understand rollup, it's generating more human readable and shorter bundles, so it's more suitable for libraries. I didn't tried it yet, but I feel somehow that if I do, I will find bad parts there too. Like limited (comparing to webpack) module format support...
Yeah, it's pretty common (for the tree shaking case) to make a custom d3/whatever library bundle with Rollup and use it with Webpack for your app, but it's a formidable alternative to Webpack regardless.