Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave conditional exports alone #197

Closed
dandv opened this issue Sep 7, 2020 · 5 comments · Fixed by #203
Closed

Leave conditional exports alone #197

dandv opened this issue Sep 7, 2020 · 5 comments · Fixed by #203
Labels

Comments

@dandv
Copy link

dandv commented Sep 7, 2020

https://nodejs.org/api/esm.html#esm_conditional_exports states

Within the "exports" object, key order is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. The general rule is that conditions should be from most specific to least specific in object order.

I found that default was sorted before node.

@fisker
Copy link
Collaborator

fisker commented Sep 7, 2020

You can fix it by removing this over from here

@Xunnamius
Copy link
Contributor

Xunnamius commented Oct 19, 2020

Just got bitten by this. This makes it hard to use this package in automated publish workflow. Any plan on a published fix?

Also (a related issue) perhaps the imports key should appear before (or after) exports, since they're related configuration options. Currently, the imports key is placed at the bottom below devDependencies.

Maybe something like this?

@keithamus
Copy link
Owner

PRs welcome!

@Xunnamius
Copy link
Contributor

Xunnamius commented Oct 19, 2020

@keithamus Sent! I'm not sure where all I need to add unit tests, let me know. I've been using npx Xunnamius/sort-package-json without issue for half a day now :)

@github-actions
Copy link

🎉 This issue has been resolved in version 1.46.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants