A minimal Next.js app where route files are written in Reason and compiled with Melange via Dune.
- Next.js App Router
- Melange + Dune (
using melange 1.0) - Nix dev shell (based on
nix-ocaml/nix-overlays) - Existing Next.js bindings from
next/next.re
- Dune compiles
.refiles fromapp/into JavaScript (dune build @melange). melange.emitwrites generated Next artifacts, with promotion handled by Dune auto-promote.process-composerunsnpm installfirst, then starts Next after install succeeds.- Generated page modules are promoted into the source app tree (for example
app/page.js). process-composeruns the Dune watcher and Next dev server together.- Next.js runs from the project root.
make devThen open http://localhost:3000.
make dev is one-click:
- outside Nix: it enters
nix developautomatically and startsprocess-compose. - inside Nix: it runs
process-composedirectly. process-composerunsnpm installfirst, then starts dependent processes.
For production build:
make build
make start