This demo is going to show how to set up a ReactJS application in ES2015 with webpack.
- webpack -> moudle bundler
- Babel -> transpiles the code into standard ES5 code that can run in older JavaScript environments
install packages with npm:
npm install --save babel-core babel-loader babel-preset-es2015 babel-preset-react react react-dom webpack webpack-dev-server
Build for development:
webpack
Build for production:
webpack -p
Build for continuous incremental build in development:
webpack --watch
Run webpack server:
webpack-dev-server --progress --colors
open http://localhost:8080/webpack-dev-server/
I refered to Pete Hunt's webpack-how-to to build this application, hope that can be helpful to you.