1, first need to install NODEJS environment, download NODEJS installation program can be installed. NodeJS: https://nodejs.org/en/download/
2. Install Nodejs Web frame Express npm install express-generator-g
3. Create a project
Express Studyreact
4. Add JSX engine support
NPM Install Express-react-views--save
5, modify the view directory Index.jade file suffix is jsx, the content is as follows:
6, write react components, need to install react React-dom
NPM Install react React-dom--save
7, the use of Webpack compiled packaging needs to install Webpack
NPM Install Webpack Babel Babel-loader--save
8, add the Webpack.config.js file in the project, the content is as follows:
9. The command line uses Webpack to compile the project, the following results appear after success:
10. Launch project, access in browser
NPM start
Access to HTTPS in the browser ://localhost:3000
The following results indicate that the environment has been successfully built
Note: Each modification in this example needs to be compiled manually using Webpack, and if you want to modify it, automatically compile and refresh the page using Webpack-dev-server.
Good luck to all of you.
NodeJS React Development Environment Construction