lodash-cherry-pick
See original GitHub issueHello!
We want to use mobx-react-form in our application, but we cannot because we use the old lodash version (3.x) globally on the whole site, so sooner or later we can clash with the some lodash breaking changes (3.x vs 4.x). I think that peer dependency on the lodash is very bad. Probably you need to drop the lodash dependency or include it in the library bundle (drop it from the webpack.config.babel.js/externals section).
Probably the best solution will be cherry picking individual lodash functions, for example:
import intersection from "lodash/intersection"
Also you can use this plugin https://github.com/lodash/babel-plugin-lodash.
I can help with the pull request if you approve.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Aggregating Cherry-Picked Lodash Methods In An Application ...
Ben Nadel demonstrates how to aggregate and package cherry-picked Lodash methods in an application module in JavaScript.
Read more >Lodash
Review the build differences & pick one that's right for you. ... Cherry-pick methods for smaller browserify/rollup/webpack bundles.
Read more >Lodash unable to use chain with cherry pick import
import chain from lodash/chain only works if there is a default export from the module. If you want to import a particular named...
Read more >ckotzbauer/lodash-loader - GitHub
This Webpack loader cherry-picks Lodash functions and require them explicitly to reduce the webpack bundle size. Installation. npm install lodash-loader ...
Read more >Correct, can probably 'cherry pick' the method npm i
can probably 'cherry pick' the method npm i --save lodash.uniqueid and import it in the file as so import uniqueId from 'lodash.uniqueid'
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I add the babel-plugin-lodash to the .babelrc then this line of code https://github.com/foxhound87/mobx-react-form/blob/master/webpack.config.babel.js#L29 become useless and imported lodash methods will be included in the umd build. Is this the desired result?
Thanks. I will create the PR tomorrow.
Yes, you are right. I am sorry for the confusion. But the cherry picking is the good thing anyway 😃