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

Allow ESM #33

Closed
Zamiell opened this issue Feb 8, 2023 · 10 comments
Closed

Allow ESM #33

Zamiell opened this issue Feb 8, 2023 · 10 comments

Comments

@Zamiell
Copy link

Zamiell commented Feb 8, 2023

Hello,

It appears that this package cannot be consumed by ESM projects. This is a shame, because it is relatively painless to publish libraries as dual CJS+ESM, so that they can be used by everybody. This blog goes into more detail:
https://antfu.me/posts/publish-esm-and-cjs

I propose that this package supports consumers who are using ESM.

@nebrelbug
Copy link
Owner

@Zamiell hmm, I thought that the package was working fine with ESM. Where are you running into problems?

@nebrelbug
Copy link
Owner

@Zamiell I think that's outdated. They are using an old version of the package.

@Zamiell
Copy link
Author

Zamiell commented Feb 9, 2023

  • The latest version of this package appears to be 1.2.1, from this page.
  • We can see that the version of the package that "docusaurus-remark-plugin-npm2yarn" uses is 1.2.1, from this page.

Thus, why do you think that they are using an old version of the package?

@nebrelbug
Copy link
Owner

@Zamiell you're right, they are using the current version of the package. I'll test out NodeNext resolution.

@Zamiell
Copy link
Author

Zamiell commented Feb 9, 2023

That's incorrect. If you clone the repo, install deps, and then remove the line, you will immediately get a compiler error.

@nebrelbug
Copy link
Owner

You may have been looking at my old comment.

@nebrelbug
Copy link
Owner

I just opened #35 to fix this issue. Any feedback? If not I'll merge it and release a new version today.

@Zamiell
Copy link
Author

Zamiell commented Feb 9, 2023

I'm not familiar enough with the intricates of ESM to double-check your work, but regardless thank you very much for the swift update!

@nebrelbug
Copy link
Owner

@Zamiell you're welcome! I just released the fix and opened a PR in the Docusaurus repo. I'll mark this as closed for now, unless further problems arise. I've tested in the Docusaurus repo and locally, though, so I don't expect that.

Thanks for the feedback!

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

No branches or pull requests

2 participants