Let's try to compile OCaml to JavasScript using Esy, Dune and BuckleScript.
NOTE: This an experimental package to test building BuckleScript projects with Dune. It won't work until Dune supports building with Bucklescript. You can follow along with progress in the BuckleScript issue in the Dune repo, and the bucklescript branch of Dune.
You will need to have esy
command installed:
npm install -g esy # or yarn global add esy
Then run esy
in this directory to install dependencies and attempt a build.
esy
Right now this build probably will not succeed as work is still underway to support BuckleScript in Dune. However, once the dependencies are installed we can build the project with BuckleScript.
esy build:bsb
This will produce some verbose build output,
some build artifacts in lib/
which may be of interest,
and the compiled JavaScript file bin/hello.bs.js
.