Docs / Language Manual / Installation


Prerequisite: NPM, which comes with NodeJS. Yarn also works.

To install ReScript globally:

npm install -g bs-platform

New Project

git clone cd rescript-project-template npm install npm run build node src/

That compiles your ReScript into JavaScript, then uses NodeJS to run said JavaScript. We recommend you use our highly unique workflow of keeping a tab open for the generated .bs.js file, so that you can learn how ReScript transforms to JavaScript. Not many languages output clean JavaScript code you can manually inspect!

During development, instead of running npm run build each time to compile, use npm run start to start a watcher that recompiles automatically after file changes.

Alternatively, to start a ReasonReact app, follow the instructions here.

Integrate Into Existing JS Project

You can install the toolchain locally to an existing JS project, through the familiar command:

npm install --save-dev bs-platform

The rest is the same as above. Since we output clean .bs.js files, the rest of your existing toolchain (e.g. Babel and Webpack) should mostly just work. Nothing to learn on the bundling side!

See also our highly recommended guide to convert from JavaScript.