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 ESM build #92

Merged
merged 1 commit into from
Oct 18, 2022
Merged

Fix ESM build #92

merged 1 commit into from
Oct 18, 2022

Conversation

Frando
Copy link
Contributor

@Frando Frando commented Oct 18, 2022

In ESM, other than in CJS, file endings are not automatically appended to import paths. The TypeScript compiler does not change this behavior; it emits the import statements exactly as written in the TypeScript source file. Imports without .js endings are only valid for either packages or named exports set in a package's package.json.

This PR fixes the few spots where currently imports without file names are used. This makes the package compatible with Node.js in ESM mode.

I did not yet change all test imports, as they are not included in the published bundle anyways.

Fixes #91

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

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

Great. thanks for catching this & submitting the PR 🙏

@dholms dholms merged commit 2d91246 into ucan-wg:main Oct 18, 2022
@achingbrain achingbrain mentioned this pull request Dec 21, 2022
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.

ESM build is incompatible with Node.js ESM
2 participants