February 2019
Beginner to intermediate
180 pages
4h 4m
English
To create a new ReasonReact project, run the following command:
bsb -init my-reason-react-app -theme reactcd my-reason-react-app
After opening our text editor, we see that a couple of things have changed. The package.json file lists the relevant React and webpack dependencies. Let's install them:
npm install
We also have the following webpack-related npm scripts:
"webpack": "webpack -w","webpack:production": "NODE_ENV=production webpack"
In bsconfig.json, we have a new field that turns on JSX for ReasonReact:
"reason": { "react-jsx": 2},
We have a simple webpack.config.js file:
const path = require("path");const outputDir = path.join(__dirname, "build/");const isProd = process.env.NODE_ENV === "production"; ...Read now
Unlock full access