Simple production-ready boilerplate for React and Webpack (SASS and React hot reloading)
# Clone repository
$ git clone https://github.com/srn/react-webpack-boilerplate.git && cd react-webpack-boilerplate
# Install dependencies
$ npm install
$ node index
Go to http://localhost:3001 and see the magic happen.
- 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)
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
$ npm test
MIT © Søren Brokær