React ES6 Starter
Features
- Webpack 4
- Transpiles
.js
files using Babel 7 (settings in.babelrc
) - Transpiles
.scss
files using node-sass - ESLint - Lints
js
files on changes (rules in.eslintrc
) - Stylelint - Lints
scss
files on changes (rules in.stylelintrc
) - PostCSS plugins (settings in
postcss.config.js
)- Autoprefixer (supported browsers list in
browserslist
file) - cssnano - To compress the resulting CSS
- Autoprefixer (supported browsers list in
- Dynamic
index.html
generation - Dynamic build file names with hash for cache busting
- Automatically builds a
vendor
bundle with all packages imported fromnode_modules
- Transpiles
- React
- React Hot Loader v4 - Simplified hot reloading setup
- React Router v4
- HTML5 History API (non hash routes)
Getting Started
-
Install Node.js (choose Current)
- From nodejs.org (All platforms)
- Or using Homebrew (Mac)
- Or any other package manager
-
git clone
or Download this repo- If using clone, remove the
.git
folder and init a new Git repo (name it something else)
- If using clone, remove the
-
Update the README to your needs
-
Install dependencies (at the root of the repo):
npm install
Development
Run webpack-dev-server
npm start
- Open
http://localhost:8080
Build the project for deployment
npm run build
- Must use a server that serves missing routes as
index.html
To run the build locally
npm i -g serve
serve -s dist