Skip to content

Instantly share code, notes, and snippets.

@kosyfrances
Last active March 5, 2016 21:05
Show Gist options
  • Select an option

  • Save kosyfrances/a6c3d90290c973bb31d4 to your computer and use it in GitHub Desktop.

Select an option

Save kosyfrances/a6c3d90290c973bb31d4 to your computer and use it in GitHub Desktop.
Setting up a simple react project

#Setting up a simple react project

In the shell,
mkdir project_name Create new project directory.
cd project_name Step into the project directory created.

npm init This utility will walk you through creating a package.json file.
Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file.
npm install --save react react-dom
npm install --save-dev html-webpack-plugin webpack webpack-dev-server babel-{core,loader} babel-preset-react

mkdir app && cd app Make new app directory and step into it.
touch index.html Create html file.
touch index.js Create javascript file.
cd .. Step out of app directory back to project directory.
touch webpack.config.js Create webpack config file.

In webpack.config.js file you can configure it as you can see in this file -
https://github.com/andela-kanyanwu/github-battle/blob/master/webpack.config.js

next create a babelrc file touch .babelrc
https://github.com/andela-kanyanwu/github-battle/blob/master/.babelrc

And you are good to go I guess ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment