Home

Awesome

melange-esy-template

A simple project template using Melange with esy.

If you are looking for a template with opam, check melange-opam-template.

Quick Start

npm install

# In separate terminals:
npm run build:watch
npm run serve

React

React support is provided by reason/react. The entry point of the sample React app is src/ReactApp.re.

Commands

JavaScript output

Since Melange just compiles source files into JavaScript files, it can be used for projects on any JavaScript platform - not just the browser.

All ReasonML/OCaml/ReScript source files under src/ will be compiled to JavaScript and written to _build/default/src/* (along with some other build artifacts).

For example, src/Hello.ml (using OCaml syntax) and src/Main.re (using ReasonML syntax) can each be run with node:

node _build/default/src/node/src/Hello.js
node _build/default/src/node/src/Main.js