kyle-johnson / rollup-plugin-optimize-lodash-imports

10 stars 6 forks source link

Optimize lodash imports

GitHub Workflow Status Codecov

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.

Packages:

@optimize-lodash/rollup-plugin

npm node-current npm peer dependency version

A fast, lightweight plugin for Rollup bundling.

@optimize-lodash/esbuild-plugin

npm node-current npm peer dependency version

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.)

@optimize-lodash/transform

npm

Code transforms for lodash imports. Used by bundler plugins for a consistent, well-tested, shared set of transforms.