Skip to content

psb/reason-react-hn-melange

Repository files navigation

Reason React Hacker News with Melange

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/

Running locally

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)

Commands

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 dependencies
  • make install: install OCaml, Melange and JavaScript dependencies
  • make watch: watch for the filesystem and have Melange rebuild on every change
  • make dev: serve the JS application with a local HTTP server
  • make bundle: bundles the JS into the dist folder
  • make preview: serve the bundled JS application with a local HTTP server

JavaScript output

_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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published