This is a little experiment to use React to render static HTML. The React build process relies on a Babel config that has been simplified here.
To run the project install the npm dependencies and run the `start` command:
- Install
yarn install
- Run the main script
yarn start
- Also, see the other scripts from the `package.json`
yarn run [ babel-build | babel-run | react-build ]
- Get dev deps
yarn add @babel/cli @babel/core @babel/preset-env --dev
- Babel compile
./node_modules/.bin/babel --presets @babel/preset-env index.js -o build.js
- Run export
node build.js
- Install babel node
yarn add @babel/node --dev
- Install @babel/register to load jsx file (and others) and place the following in the main JS file
require("@babel/register");
- Run script with babe-node and the es2015 preset
/node_modules/.bin/babel-node --presets @babel/preset-env index.js
- Install react and react-dom
yarn add react react-dom
- Refer to Hello.jsx or the React Tutorial for usage