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

build: setup build for cjs/esm #344

Closed
wants to merge 3 commits into from
Closed

Conversation

rhettjay
Copy link
Member

BREAKING CHANGE: build tooling for both esm and cjs imports.
This should fix issues where the applications building esm modules receive an error saying the default expression is not callable.

The adjustments accomplish this by explicitly exporting an esm module AND a cjs module. Additionally, by using only a default function export we prevent the issue of the IDE incorrectly inferring that the default module is not callable. This will break backwards compatibility and force users who are not importing the library as a default import to import it as such.

Additionally, because we are explicitly exporting an esm module where before we were relying on esmodule interoperability this will require a major version bump.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5b43ec8) 72.00% compared to head (da86f8e) 70.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #344      +/-   ##
==========================================
- Coverage   72.00%   70.83%   -1.17%     
==========================================
  Files           2        2              
  Lines          25       24       -1     
  Branches        6        6              
==========================================
- Hits           18       17       -1     
  Misses          7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhettjay
Copy link
Member Author

rhettjay commented Aug 1, 2024

Superseded by #345

@rhettjay rhettjay closed this Aug 1, 2024
@rhettjay rhettjay deleted the build/esmodule-interop branch August 1, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant