lodash supports custom builds with only a subset of the functionality / size. Creating a custom build is a breeze with lodash-cli
.
What's the recommended way to take this custom build and integrate it into the project? (using npm / browserify).
Do I create a custom build command that creates the custom build and places it somewhere? (where?)
Is there a canonical way to specify the dependency and integrate into the project?
There are several approaches you can take to use a subset of lodash:
_ = require('lodash'); _.each(...)
you would do each = require('lodash/collections/each')
)lodash-modularize
tool to create and maintain a custom lodash build for a given project and use lodash
as otherwise documented. This is essentially automating the two/three methods above.Each approach is 100% valid and has their pros and cons
Disclaimer, I'm the author of lodash-modularize
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With