The following TypeScript snippet will import the whole lodash library:
import * as _ from 'lodash';
So far so good, but TIL that this is not tree-shakeable by webpack. This means you always get everything included in your bundle. This is not nice.
The solution is to always import your functions explicitly, e.g.:
import map from 'lodash/map';
My recommendation is to ban the
'lodash' altogether, if you’re using tslint.
You can find some benchmarks here.