Simple starter repository for ReasonML + React (webpack included)
Welcome Reason React Simple Starter! It's a project created to help you start your journey with React using ReasonML (duh). It uses webpack
.
Reason is a typed programming language created by Facebook. Technically speaking it's a front-end for Ocaml. One of the most important features of Reason is powerful and safe type inference. That's what makes ReasonML an interesting alternative to JavaScript, TypeScript or Flow.
You can read more about it here: https://reasonml.github.io/docs/en/what-and-why.html
This starter project is meant to solve the most common problems when creating a new Reason project:
npm
hassle-freeYou'll need node
and npm
. This project was tested on node 8
and npm 5
but any newer should be just fine!
Download the repository and run npm install
. This will install all dependencies and set everything up. You're ready to go!
Run npm start
. This command starts webpack-dev-server
which in turn:
bs-loader
webpack
in a watch modeEffectively, whenever you make any changes in Reason sources, they get automatically compiled to JS — webpack
picks the new files and bundles into a single file main.js
inside /bundledOutputs
dir. This file is ready to be used in the browser (see /index.html
).
Run npm run build
.
For faster and smaller bundle try running npm run prod
.