There are multiple issues surrounding tree-shaking of lodash. Minifiers, even with dead-code elimination, cannot currently solve this problem.
Plugins can reduce final bundle sizes with minimal or no manual code changes. See the example showing a 70% reduced bundle size for an example input.
A fast, lightweight plugin for Rollup bundling.
A expertimental plugin for esbuild bundling. (Experimental = esbuild is rapidly changing and unlike the Rollup plugin, this has not been used in a production code base.)
Code transforms for lodash imports. Used by bundler plugins for a consistent, well-tested, shared set of transforms.