How would you make a lib support both ES6 and commonJS otherwise?
I have introduced it from Bundle ReScript libraries with dual-package exports. Applied to rescript-collection.
But since @rescript/core
doesn’t use bundling, there’s no easy solution. I wrote RFC: New package-spec `"dual"` · Issue #6209 · rescript-lang/rescript-compiler · GitHub to solve this.
A possible choice is to keep the @rescript/core package dedicated to ReScript and leave the build process to the end-users instead of providing prebuilt mjs files.