/react-webpack-boilerplate

Simple production ready boilerplate for React, Webpack (SASS and React hot reloading), tests and coverage.

Primary LanguageJavaScript

react-webpack-boilerplate

Build Status Build Status Dependency Status

Simple production-ready boilerplate for React and Webpack (SASS and React hot reloading)

Install

# Clone repository
$ git clone https://github.com/srn/react-webpack-boilerplate.git && cd react-webpack-boilerplate

# Install dependencies
$ npm install

Development

$ node index

Go to http://localhost:3001 and see the magic happen.

Add entry point

  • Create new file in /client/entryPoints
  • Add a new view file in /views
  • Add a new entry in webpack.config.js
  • Restart the development server (required whenever you make changes to webpack.config.js)

Production

Run this command to output the current environment:

export | grep NODE_ENV

If you want to run the project in production, set the NODE_ENV environment variable to production.

export NODE_ENV=production

Run this command to generate the required bundles for production:

npm run-script bundle

Run this command to switch back to development environment:

export NODE_ENV=development

Tests

$ npm test

License

MIT © Søren Brokær