Skip to content

Instantly share code, notes, and snippets.

@codyromano
Created February 1, 2017 08:26
Show Gist options
  • Select an option

  • Save codyromano/fbb38f2dc3700737a2c855e872d75e17 to your computer and use it in GitHub Desktop.

Select an option

Save codyromano/fbb38f2dc3700737a2c855e872d75e17 to your computer and use it in GitHub Desktop.
Run this script to quickly set up a simple template for a React / Webpack project.
#!/bin/bash
# Exit if any command fails
set -e
echo "Choose a project name. Please use only letters, numbers & underscores:"
read projectName
# Clone Pete Hunt's React Webpack template repository
git clone https://github.com/petehunt/react-webpack-template $projectName
# Install dependencies
cd $projectName
npm install
# Run webpack
npm start &
# Open the project directory in Sublime
open -a /Applications/Sublime\ Text.app/ .
# Give the webpack server time to start
sleep 10
# Open the page in the browser
open -a /Applications/Google\ Chrome.app/ index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment