A port of the original Reason React Hacker News using Melange to compile Reason to JS. Also using Vite and Tailwind.
The port was pretty straight forward and only a small amount of code had to be changed to get the app up and running. The app is running at: https://reason-react-hn-melange.netlify.app/
After getting up and running with OCaml, clone this repo and:
make init #(setup local opam switch; install OCaml and npm packages)
# In separate terminals:
make watch #(compile the Reason files to JS and watch for changes)
make dev #(runs 'npm run dev', i.e., the vite dev server)
You can see all available commands by running make help
or just make
. Here
are a few of the most useful ones:
make init
: set up opam local switch and download OCaml, Melange and JavaScript dependenciesmake install
: install OCaml, Melange and JavaScript dependenciesmake watch
: watch for the filesystem and have Melange rebuild on every changemake dev
: serve the JS application with a local HTTP servermake bundle
: bundles the JS into thedist
foldermake preview
: serve the bundled JS application with a local HTTP server
_build/default/src/output/
is the output directory for the JS.
_build/default/src/output/src/Index.js
in the index.html
is used as the entry point for Vite.