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

fix: Add package exports to allow node16 projects to import module #611

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 4, 2023

For projects using node16 or nodeNext module resolution only the exports section is evaluated, as the section is missing only the main entry is used which is umd (even if your project uses ESM).

@susnux susnux added bug Something isn't working 3. to review labels Jul 4, 2023
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (8fcba42) 91.01% compared to head (90f7043) 91.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #611   +/-   ##
=======================================
  Coverage   91.01%   91.01%           
=======================================
  Files          57       57           
  Lines        2782     2782           
  Branches      507      507           
=======================================
  Hits         2532     2532           
  Misses        250      250           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test but looks good. Thanks, learnt something today.

More on the topic: https://nodejs.org/api/packages.html#conditional-exports

"module": "dist/index.esm.js",
"module": "dist/index.es.mjs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops 🙈

@st3iny st3iny merged commit c6e230a into main Jul 11, 2023
9 checks passed
@st3iny st3iny deleted the fix/node16-importable branch July 11, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants