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

10 stars 6 forks source link

missing information regarding `.chain()` optimizations #444

Open yairEO opened 1 month ago

yairEO commented 1 month ago

how does this plugin should be used with .chain and chained methods? I would expect some text regarding this and examples..

Thank you 😊

kyle-johnson commented 1 month ago

Hmm, there is no special in treatment of .chain(). My guess is using .chain() effectively bypasses the space-saving optimizations.

import { chain } from "lodash"; is simply transformed to import { chain } from "lodash/chain.js"; and then tree-shaking in rollup will be be responsible for any further optimizations in lodash/chain.js. It's unlikely that tree-shaking is able to do much in this case.