Hi,
I am trying to create a React component/module based on ReasonML, which can be built / transpiled / published as an ES5 module, so that any JS-based project can import it and use it.
Ideally I would be able to do:
yarn build
…and get a “dist” folder with ES5 code inside.
What I have so far is here: https://github.com/dmaksimovic/reasonml-clock
Basically I’m trying to make it two-step, so that BuckleScript first converts Reason files into .bs.js files, then webpack bundling all that into a single output file. At least that’s the idea. But the end-product above doesn’t give me like “module.exports = Clock” or anything, instead all those “make”, “component”, etc. are exported and the target application throws errors, like “expected React element, but got object instead”.
Anybody knows what I need to do?