This project is a template containing -
- express
- babel
- webpack
- hot-reloading dev config
- minimized prod config using
webpack.optimize.UglifyJsPlugin
- react
- standard linting
- husky to run linting and tests prepush
"dependencies": {
"body-parser": "^1.15.2",
"cors": "^2.8.1",
"dotenv": "^2.0.0",
"express": "^4.14.0",
"morgan": "^1.7.0",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"react-router": "^2.8.1"
}
"devDependencies": {
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"eslint": "^3.5.0",
"http-proxy": "^1.15.1",
"husky": "^0.11.7",
"snazzy": "^5.0.0",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.15.2"
}
- Clone the project with
git clone https://github.com/maael/simple-express-react.git
- Check node version is 6.0.0+. If not swap node version.
- Check npm version is 2+. 3 can be a bit slow. (TODO: Yarn?)
npm install
You should now be able to run npm start
and see Main Application at http://localhost:4242/
in your browser.
npm start
- Start the server and webpack dev server if in development.npm run lint
- Lint the code with snazzy (a pretty standard linter).npm run build
- Generate the development webpack bundle.npm run build-prod
- Generate the production webpack bundle and source map.npm run clean
- Remove any webpack bundle and source maps.