Mobx-state-tree: Switch from webpack to rollup for bundling

Created on 10 Jun 2017  路  8Comments  路  Source: mobxjs/mobx-state-tree

Does rollup support peer deps properly? Rollup will make the build smaller and faster, support tree shaking and more debugger friendly code

Most helpful comment

62.7KB with Webpack
44.5KB with Rollup

I think just for the heck of it I'm going to try webpack@3 with scope hoisting, see what that ends up looking like

All 8 comments

Out of curiosity, doesn't webpack2 support tree shaking? Is there a difference between the tree shaking support in webpack2 vs rollup?

Afaik webpack 2 was quite limited in this regard. Anyway rollup bundles are much cleaner; they inline all the sources, rather than webpack that tries to preserve the original source modules, which is totally not interesting for a library like this, and hampers the opportunities for minification

@rossipedia, interested to roll up this one as well? No legacy default exports here ;-)

sure, why not :)

62.7KB with Webpack
44.5KB with Rollup

I think just for the heck of it I'm going to try webpack@3 with scope hoisting, see what that ends up looking like

Roughly the same with webpack 3 and scope hoisting. Rollup definitely the clear winner re: size.

Released in 0.8.0. The standard export is now rolled-up as well :)

And added es6 module for the fancyness of it :

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mshibl picture mshibl  路  3Comments

misantronic picture misantronic  路  3Comments

A-gambit picture A-gambit  路  3Comments

donatoaz picture donatoaz  路  3Comments

mreed picture mreed  路  3Comments