Skip to content

melange-re/melange-nextjs-starter

Repository files navigation

melange-nextjs-example

A minimal Next.js app where route files are written in Reason and compiled with Melange via Dune.

Stack

  • 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

How it works

  • Dune compiles .re files from app/ into JavaScript (dune build @melange).
  • melange.emit writes generated Next artifacts, with promotion handled by Dune auto-promote.
  • process-compose runs npm install first, then starts Next after install succeeds.
  • Generated page modules are promoted into the source app tree (for example app/page.js).
  • process-compose runs the Dune watcher and Next dev server together.
  • Next.js runs from the project root.

Commands

make dev

Then open http://localhost:3000.

make dev is one-click:

  • outside Nix: it enters nix develop automatically and starts process-compose.
  • inside Nix: it runs process-compose directly.
  • process-compose runs npm install first, then starts dependent processes.

For production build:

make build
make start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors