lodash / babel-plugin-lodash

Modular Lodash builds without the hassle.
Other
1.96k stars 92 forks source link

How are methods available determined? #189

Closed egeriis closed 6 years ago

egeriis commented 6 years ago

Hey there!

When I installed your lib I was met with a bunch of these:

Module build failed: SyntaxError: The 'lodash' methodassignis not a known module.

Odd, I thought. I have now looked for each of the issues mentioning this error, and it is probably due to some legacy in the app I'm working with, that I get these errors.

But could you help me understand how it is determined which methods are available? The code is too abstract for me to quickly get an understanding of the mechanics.

Project is on lodash 2.4.1, which does have the methods causing errors, e.g. assign, isEqual, etc.

Thank you!

egeriis commented 6 years ago

It could appear that lodash v2 is not supported?

jdalton commented 6 years ago

Hi @egeriis!

babel-plugin-lodash crawls the package and looks for modules of a similar name. Lodash v4 v2 is not modular so it won't find any.

egeriis commented 6 years ago

I suppose you mean Lodash v2?

jdalton commented 6 years ago

Yep 😋