NodeJS React Development Environment Construction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.