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:
January 2, 2023, 8:30pm
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.
January 3, 2023, 11:02am
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.
January 8, 2023, 2:40pm
Didn’t work for me
The problem is with me using
Could you file your issue to the nanobundle repo?
January 8, 2023, 3:31pm
nanobundle worked fine. I’m just more of a specific case.
April 26, 2023, 12:08pm
Here’s the logic I wanted to have: