React Playground

How was it setup?

Thanks to Jedai Saboteur for his tutorial. More info here.

Install nodejs and npm

sudo apt-get update
sudo apt-get install nodejs npm

Initialize npm and git

npm init
git init

Create project structure

mkdir public src
touch public/index.html
touch src/index.js
touch src/App.js
touch src/App.css

Create .gitignore and add common exclusions

cat <<EOF > .gitignore
node_modules
dist
EOF

Install dev dependencies, such as: babel, webpack and webpack loaders

npm install --save-dev \
    @babel/core \
    @babel/cli \
    @babel/preset-env \
    @babel/preset-react \
    webpack \
    webpack-cli \
    webpack-dev-server \
    style-loader \
    css-loader \
    babel-loader \
    react-hot-loader \
    @hot-loader/react-domgit stat

Create webpack config file

touch webpack.config.js

Install react

npm install react react-dom