babel-plugin-lodash
babel-plugin-lodash copied to clipboard
Check for package key `module` in addition to main
Hi all!
It would be fantastic to have the ability to configure what "mainFields" to resolve similar to webpack.
Right now I have a main field that points to lib/index.js
. The lib directory is used when I publish to npm. However, internal to my monorepo I transpile my node_modules by using the module
key in package.json
. The key points to src/index.js
.
The code in question is here: https://github.com/lodash/babel-plugin-lodash/blob/3f9c8e48ba66ed68132f7c1ef40b5e1e4c466d6c/src/ModuleCache.js#L19-L21
Happy to provide additional context!
Hi @dan-kez!
Thanks for the suggestion. I'm open to a PR if you'd like to contribute!
Awesome! I'll take a look this week and write something up