Backward compatibility to support CommonJS
mastepanoski opened this issue · 1 comments
mastepanoski commented
Description
Currently if I want to use this module in a project that has not implemented ESM support yet, I get the following error: Error [ERR_REQUIRE_ESM]: require() of ES Module ...someprj/node_modules/@keycloak/keycloak-admin-client/lib/index.js
So tsconfig.json and package.json could be modified to support ESM and CommonJS.
Discussion
No response
Motivation
It would be good to provide backward compatibility to commonjs projects until ESM is widely adopted.
Details
Implementation ideas: Using a hybrid approach https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html