lodash / babel-plugin-lodash

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

Provide a default if pkg.main is missing #173

Closed albertogasparin closed 7 years ago

albertogasparin commented 7 years ago

I was trying to use babel-plugin-lodash with date-fns, however the plugin breaks badly because date-fns package.json does not have a main attribute.

Looking a the code, it already handles the case where package.json is missing. So, I'd like to propose to extend the check to the main attribute too, defaulting to index.js if missing so the plugin could be more resilient.

jdalton commented 7 years ago

👌 Would you be up for making a PR?

albertogasparin commented 7 years ago

Sure, will do