Created
February 1, 2017 08:26
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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