Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lodash-es and lodash/fp #3247

Closed
mvanlonden opened this issue Jul 6, 2017 · 1 comment
Closed

lodash-es and lodash/fp #3247

mvanlonden opened this issue Jul 6, 2017 · 1 comment
Labels

Comments

@mvanlonden
Copy link

Hi! It seems like the fp variety of lodash isn't supported in the lodash-es package. Is this intentional?

I'm using CRA and would like to reduce my bundle size through tree shaking. I've read through this thread facebook/create-react-app#1069 and it seems like the CRA's lodash babel plugin implementation is waiting for lodash v5. Is there still a way to benefit from tree shaking using lodash/fp and something like lodash-es?

@jdalton
Copy link
Member

jdalton commented Jul 6, 2017

Hi @mvanlonden!

Tree-shaking is a bit of a lie. Tooling tends to be overly sensitive to potential side-effects, of which Lodash has none. I recommend using babel-plugin-lodash (it works for lodash/fp too) and if you're feeling adventurous combo it with lodash-webpack-plugin with the "currying" feature set enabled.

Update:

Webpack 4 will support the sideEffects field which will allow for better tree-shaking support.

@jdalton jdalton closed this as completed Jul 6, 2017
@lodash lodash deleted a comment from jscinoz Oct 28, 2017
@lodash lodash deleted a comment from exarus Dec 26, 2017
@lodash lodash locked as resolved and limited conversation to collaborators Dec 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants