node-jwks-rsa icon indicating copy to clipboard operation
node-jwks-rsa copied to clipboard

Consider outputting ESM

Open acidoxee opened this issue 2 years ago • 2 comments

Checklist

  • [X] I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

The current package is CJS-only. The package itself isn't that heavy, but it being in CJS has the downside of also pulling all transitive dependencies as CJS, despite some of them providing ESM entrypoints (including the heaviest dependency, jose).

Describe the ideal solution

It would be great if jwks-rsa were a dual CJS/ESM package, with "real" entrypoints for each (not just a thin wrapper of the one around the other). ESM consumers would be able to leverage proper tree-shaking of not only jwks-rsa, but also of its transitive dependencies that provide ESM entrypoints like jose, which are incredibly heavy in CJS and would be way lighter in ESM.

Alternatives and current workarounds

No response

Additional context

No response

acidoxee avatar Oct 05 '23 20:10 acidoxee