A simple project template using Melange.
You will need esy package manager to obtain OCaml and Melange sources. See esy
installation instructions here.
Once esy
is available, run
esy
to install all dependencies.
Then:
esy build
to build the project. This command, as constructed in esy.json
,
- generates a symbolically linked dir
bs-platform
innode_modules
, which is helpful when using JavaScript bundlers like Webpack that expect to find Melange stdlib JavaScript files undernode_modules/bs-platform
. - builds the project.
Now you should see a _build
folder with all generated files, you can run
esy x node _build/default/src/Main.bs.js
to see the result of the script running.