Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davesnx/melange-latest-esy-template
melange-re/melange-esy-template with latest melange/mel/meldep/dune
https://github.com/davesnx/melange-latest-esy-template
Last synced: 14 days ago
JSON representation
melange-re/melange-esy-template with latest melange/mel/meldep/dune
- Host: GitHub
- URL: https://github.com/davesnx/melange-latest-esy-template
- Owner: davesnx
- Created: 2023-02-06T12:05:56.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T16:20:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T17:26:17.114Z (2 months ago)
- Language: Reason
- Size: 107 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# melange-latest-esy-template
A simple project template using [Melange](https://github.com/melange-re/melange) and the [dune](https://dune.readthedocs.io) integration with [esy](https://esy.sh).
## Quick Start
```shell
npm install# In separate terminals:
npm run build:watch
npm run serve
```### React
React support is provided by
[`@rescript/react`](https://github.com/rescript-lang/rescript-react). The entry point of the sample React app is [`src/app.re`](src/app.re).## Commands
- `npm install` - installs the npm/JavaScript dependencies, including the `esy` package manager (see below)
- `npm run build:watch` - uses `esy` to:
- Install OCaml-based dependencies (e.g. OCaml and Melange)
- Symlink Melange's JavaScript runtime into `node_modules/melange`, so that
JavaScript bundlers like Webpack can find the files when they're imported
- Compile the project's ReasonML/OCaml/ReScript source files to JavaScript
- Rebuild files when changed (via dune's watch mode)
- `npm run serve` - starts a dev server to serve the frontend app## 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).