3 ms·
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
by yunyu 9y ago
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.
- Ralfp 9y agoBut isn't Rollup.js directed at libraries whereas Webpack aims for JS apps?
- moron4hire 9y agoI 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 https://capnmidnight.github.io/marigold-build
- finchisko 9y agoRollup 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...
- yunyu 9y agoYeah, 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.