Recompose: Use webpack's side-effects flag to enable tree shaking in Webpack 4

Created on 2 Mar 2018  路  6Comments  路  Source: acdlite/recompose

This library is missing the "sideEffects" : false in the package.json to enable Webpack 4 tree shaking.

Lodash-es example:
https://github.com/lodash/lodash/blob/master/package.json#L10

This would be a (better) alternative for:
https://github.com/acdlite/recompose#using-babel-plugin-lodash

Most helpful comment

Thanks for bringing this up!

All 6 comments

Thanks for bringing this up!

@TrySound why is it not relevant anymore? I realize that webpack can already tree-shake this package to some extent (thanks to your work! 馃槉) but can't adding sideEffects: false only help further?

Also, I notice that .size-snapshot.json never actually gets updated as e.g. a pre-commit hook, so the version in master corresponds to the snapshot when you made the initial rollup snapshot commit, despite changes that clearly affect bundle size and possibly tree-shaking having landed since then.

What is the mechanism by which you'd expect the snapshot to update? What's the purpose of having it in the repo?

It's usually should be updated by users. But there is also matchSnapshot option which will fail in ci.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

astanciu picture astanciu  路  3Comments

uriklar picture uriklar  路  4Comments

jeron-diovis picture jeron-diovis  路  4Comments

isubasti picture isubasti  路  3Comments

istarkov picture istarkov  路  3Comments