-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I am building ESM module application and using CJS<->ESM has it's issues. One such I am facing when trying to use this library, the production build made with esbuild is reporting Error: Dynamic require of "buffer" is not supported ("buffer" is the first hit it has so it fails, but there are other imports).
The issue is that mdl library is being delivered only as CJS flavour bild, somewhere along the packaging the ESM contexts gets switched to CJS context and issues start to happend. CJS is being actively decommissioned from the JS ecosystem in favour ir ESM. Most libraries start to deliver ESM exclusively, while others deliver both ESM and CJS.
Imagining the @auth0@mdl library to be used mostly by actively maintained and cutting edge applications, it makes sense for it to be delivered only as ESM. But, it is your decision if you want to support also CJS.