I have recently been looking into rollup and seeing how it differs from Webpack and other bundlers. One thing I came across was that it is better for libraries because of "flat bundling". This is based on a tweet and from a recent PR for React to utilize Rollup.
In my experience, Rollup is better at building libraries due to better optimizations around flat bundling (e.g. hoisting). 1/2
Webpack 2 may be better for you if you're bundling apps with code-splitting etc though. 2/2
I'm not entirely sure I understand what that means though. What does flat bundling refer to? I know Rollup's documentation mentions treeshaking to help reduce bundle size but Webpack also has a way of doing this. Perhaps I just don't understand the concept entirely.
Please note this is NOT a comparison question regarding Rollup vs Webpack. For people interested in that, there is a comparison chart for that by Webpack. This is primarily asking what flat bundling is? And potentially what does Rollup do internally to achieve this?