A react tutorial from scratch, with React+React Router+Relay+Webpack+Babel, step by step
mkdir react-tutorial
cd react-tutorial
mkdir src
mkdir dist
touch src/app.js
npm initThen answer the prompt questions It creates a package.json on root directory.
After, install React library
npm install --save react
npm install --save react-domAnd edit src/app.js (see git)
npm install webpack --save-dev
npm install html-webpack-plugin --save-devAnd add to package.json
"scripts": {
"build": "webpack src/app.js dist/bundle.js --color -p --progress --config internals/webpack/webpack.prod.babel.js",
}touch .babelrcfill with (see git) and
npm install babel-loader babel-preset-latest babel-preset-react babel-preset-stage-0 --save-dev npm run buildnpm install http-server -g
http-server dist/bundle.jsnpm install jest --save-dev