unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

fix: add default field to subpath exports #2513

Closed 94726 closed 3 months ago

94726 commented 3 months ago

๐Ÿ”— Linked issue

https://github.com/unjs/nitro/issues/2512

โ“ Type of change

๐Ÿ“š Description

This adds the default field to each subpath export, so that these are correctly resolved by jiti, when used in modules.

Alternatively, nitro could export cjs builds, if that is preferred.

๐Ÿ“ Checklist

pi0 commented 3 months ago

Thanks for PR but i don't think this is the right solution.

jiti has an esmResolve option that enables esm compatibility. We need to add it here feel free to make a PR for this ๐Ÿ™๐Ÿผ