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

chore(esm): purer ESM package #4

Merged
merged 1 commit into from
Feb 21, 2022
Merged

Conversation

louis-bompart
Copy link
Collaborator

@louis-bompart louis-bompart commented Feb 18, 2022

ESM support in Node is quite recent, which can cause some hiccups sometimes.
Here, this was due to bad local imports which resulted in the need to use an experimental specifier.
The issue is that specifier is not actively developed at this time: nodejs/node#41087 (comment)

I reevaluated the need for it, and it ain't cool for users to have to specify this kind of thing, it should just work ™️.
So, I read back what I would call "The Bible of howto ESM" and followed the advice listed in here: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Mainly, what changed:

An alpha release has been made with this code, it can be found on version 0.1.1-alpha1

For the users: just call node ./yourScriptThatDependsOnThisPackage.mjs, no flags whatsoever, and it will work.

Footnotes

  1. https://nodejs.org/api/esm.html#import-specifiers

@louis-bompart louis-bompart requested review from aiheon and GermainBergeron and removed request for aiheon February 18, 2022 22:48
Copy link
Member

@GermainBergeron GermainBergeron left a comment

Choose a reason for hiding this comment

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

Tested and validated with node@16.14.0 and pnpm@6.31.0 which was throwing errors previously! Thanks!

@louis-bompart louis-bompart merged commit d53d77d into main Feb 21, 2022
@louis-bompart louis-bompart deleted the chore/ts-esm-experimental branch March 30, 2022 17:37
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.

None yet

2 participants