-
Notifications
You must be signed in to change notification settings - Fork 821
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
Consider publishing as an ESM module only #3983
Comments
TODO: test that an ESM module can be required by a CommonJS module/app |
Here's a writeup from another author who moved all of his packages to ESM only: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c |
Thanks for the link. For now, I think the limitations are too severe for us. |
Here is some advice in the Node.js core docs: https://nodejs.org/api/packages.html#dual-commonjses-module-packages |
Originally posted by @dyladan in #3976 (comment)
Our dual publishing scheme has always been a little bit fragile and has caused unexpected issues in the past. I believe if we publish an ES Module with the package.json
"type"
of"module"
we should still be able to be required by users using commonjs since node supports mixed esm/commonjs runtime.The text was updated successfully, but these errors were encountered: