Does Rollup produce a more efficient bundle in your experience?
Does Rollup produce a more efficient bundle in your experience?
Minified (1.49kb) and gzipped (677b).
Whether lodash functions should be used instead of naive functions is up for debate. My opinion is if the lodash functions are 5x the size of the entire library, it's probably best to not include it, or to include it as a build option (if the user's project already includes lodash for example).
Assuming the current setup of babel+webpack the difference between your naive version is just ~0.5 kB.
You can generally get smaller bundles using `lodash/xyz` modules over the `lodash.xyz` packages because of plugins like:
https://github.com/lodash/babel-plugin-lodash
https://github.com/lodash/lodash-webpack-plugin
Though in the future lodash-webpack-plugin may support `lodash.xyz` packages too.
import throttle from 'lodash/throttle';
rather than import { throttle } from 'lodash';