Skip to content

jchavarri/hello-jsoo-esy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hello-jsoo-esy

A project that includes the minimum configuration for a js_of_ocaml project using Reason and Esy.

It also includes an example showing how to integrate existing js_of_ocaml bindings: jsoo-is-sorted.

Usage

You need Esy, you can install the beta using npm:

npm install -g esy

Install the project dependencies and build the project:

esy # ocaml dependencies
yarn # js dependencies (can use npm too)
esy build:watch
# in another tab
yarn webpack

After you see the webpack compilation succeed (the yarn webpack step), open up build/index.html (no server needed!). Then modify Hello.re file in src and refresh the page to see the changes.

Run Project with Server

To run with the webpack development server run yarn server and view in the browser at http://localhost:8000. Running in this environment provides hot reloading and support for routing; just edit and save the file and the browser will automatically refresh.

To use a port other than 8000 set the PORT environment variable (PORT=8080 yarn server).

Build for Production

yarn clean
esy build:prod # without sourcemaps, minified
yarn webpack:production

This will replace the development artifact build/Index.js for an optimized version as well as copy src/index.html into build/. You can then deploy the contents of the build directory (index.html and Index.js).

About

A simple js_of_ocaml workflow with Reason and esy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published