lodash / lodash-webpack-plugin

Smaller modular Lodash builds.
Other
1.19k stars 63 forks source link

What are the benifits of using this plugin over using the babel-plugin-lodash #124

Closed Ilyes512 closed 7 years ago

Ilyes512 commented 7 years ago

Hey,

I was wondering what the benefits are from using this plugin instead of using the babel-plugin directly.

FYI I am using webpack2 with the babel-loader (vue-cli project generated using the webpack template).

jdalton commented 7 years ago

Hi @Ilyes512!

This plugin in a companion to babel-plugin-lodash that disables many feature sets by default, letting you opt-in to features to improve bundle size.

JSteunou commented 7 years ago

@jdalton I'm sorry I still dont get why this might be needed for. I though the babel plugin will transform import to make our build the right size by importing just the truly used lodash function. If this is the case, how can we remove more stuff without breaking our build?

jdalton commented 7 years ago

Hi @JSteunou

If this is the case, how can we remove more stuff without breaking our build?

This plugin removes feature sets through remapping of certain modules to noop implementations. When adopting for an existing project you'll want to enable all features and then turn off features as needed.

JSteunou commented 7 years ago

Does that mean babel-plugin-lodash is not efficient enough and let some part of lodash import entire feature sets?