Thanks to
Jedai Saboteurfor his tutorial. More info here.
Install nodejs and npm
sudo apt-get update
sudo apt-get install nodejs npmInitialize npm and git
npm init
git initCreate project structure
mkdir public src
touch public/index.html
touch src/index.js
touch src/App.js
touch src/App.cssCreate .gitignore and add common exclusions
cat <<EOF > .gitignore
node_modules
dist
EOFInstall 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 statCreate webpack config file
touch webpack.config.jsInstall react
npm install react react-dom