standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

module field in 3rd party module being ignored #781

Closed dnalborczyk closed 5 years ago

dnalborczyk commented 5 years ago

esm does not seem to pick up the module field in package.json of a 3rd party module. I was under the impression that it did at some point in time. Is that intentional?

I looked through some issues, but couldn't find a definitive answer:

e.g. mentions only mjs files: https://github.com/standard-things/esm/issues/627

jdalton commented 5 years ago

Hi @dnalborczyk!

You have to configure the "mainFields" option to specify which module fields are picked up. If you're specifying the mainFields option and it's still not picking it up then you'll likely need to use the force option to override the default package option.

dnalborczyk commented 5 years ago

You have to configure the "mainFields" option to specify which module fields are picked up.

ah, cool. thank you! that works!