simple-react-gulp-webpack
The goal is to have yet another template with these features
Bundle all source codes and libraries into a statically deployable output
Two easy triggerable options for development mode or production mode
- npm init
- npm install express --save
Add Webpack and Babel modules as developer dependencies
- npm install webpack --save-dev
- npm install babel-core --save-dev // required by babel-loader
- npm install babel-loader --save-dev // required by webpack
- npm install babel-preset-react --save-dev // for babel to interpret JSX
- npm install babel-preset-es2015 --save-dev // for babel to transpile ES6 to ES5
Add React modules as application dependencies
- npm install react react-dom --save
Add Hot Reloading modules as developer dependencies
- npm install webpack-dev-middleware webpack-hot-middleware babel-plugin-react-transform react-transform-hmr --save-dev
Add React try/catch module
- npm install react-transform-catch-errors redbox-react --save-dev
gulp what - shows all the options.
gulp build - build development version into build folder
gulp run - start node server for development environment
gulp build-prod - build production version into production folder
gulp run-prod - start node server for production environment
gulp run-prod-static - start a simple http server to serve the production build statically