A simple, somewhate opinionate boilerplate for Babel, React, EJS, Webpack, and SASS.
- Babel (transpiles ES2015 and JSX syntax into compatible JS)
- React (flexible and efficient DOM rendering with shades of MVC)
- EJS (JavaScript templating for HTML (here used to render pages at build rather than runtime))
- Webpack (all-in-wonder module bundler, task runner, and build tool)
- SASS (better than CSS in every way)
Also included are files for an app entry point and React root App component - basically index.ejs, index.jsx, index.scss, and App.jsx.
package.json already includes the necessary dependencies, and Webpack is preconfigured for development and production. This eliminates two of the major pain points when starting a new React project (installying npm dependencies and configuring Webpack). Webpack-dev-server and react-hot-loader recompile only parts of the app that have changed and facilitate rapid development iterations without having to reload the page (most of the time.)
Clone the project:
> $ git clone https://github.com/jereddanielson/brews.git
Then install the dependencies:
> $ npm install
For development mode (which will start webpack-dev-server and react-hot-reloader on localhost:3000):
> $ npm run dev
For production mode including clean directory, NODE_ENV flag, and minification:
> $ npm run build
To clean the public directory without running webpack:
> $ npm run clean
Inspired by Ali Al Dallal's react-webpack-babel boilerplate.