Lodash can contribute a bug chunk of code to your bundle depending on how you import from it. For example:
// includes the entire package (very large)
import * as _ from 'lodash';
// depending on your buildchain, may still include the entire package
import { flatten } from 'lodash';
// imports only the code needed for `flatten`
import flatten from 'lodash-es/flatten'
Personally I still wanted smaller footprints from my utility functions. E.g. flatten
can contribute up to 1.2K
to your bundle, after minimization. So I've been building up a collection of simplified lodash functions. My implementation of flatten
contributes around 50 bytes
. You can check it out here to see if it works for you: https://github.com/simontonsoftware/micro-dash