I built a library bundler called
nanobundle that supports the imports/exports map in the
imports/exports map is quite important when building libraries in ReScript because the ReScript compiler only builds a module spec at once.
You may need some bundler features to support both CJS/ESM at once. For example:
That’s great! Do you have a write up or similar somewhere of a good approach for packaging a lib written in ReScript for multiple output formats etc? Essentially everything you need to think about when packaging a ReScript lib for consumption outside of ReScript. That would be quite valuable for the community to have I think.
Looks like the tool I wished for
I’ll try it out for rescript-struct and rescript-stdlib-vendorer and share feedback
I also have a draft of an article about creating a ReScript library for Js/Ts consumers. Will be a great addition if the tool works as I expect.
Didn’t work for me
The problem is with me using
Could you file your issue to the nanobundle repo?
nanobundle worked fine. I’m just more of a specific case.