Create a project using Create-react-app

Source: Internet
Author: User

Before you create a react project, you need to install and configure tools such as Webpack and Babel, which are cumbersome to operate. By using Create-react-app to create projects, you can eliminate the installation and configuration of tools such as Webpack and Babel, making it much easier to create projects because they are pre-installed and configured.

Can't wait to experience it.

Below, let's go into the operation together. It's very simple, actually.

Before I use it, I'll start by default you installed the NODEJS and configured NPM, and then the NPM global installation Create-react-app

NPM install-g Create-react-app
Once installed, you can use the command line to create a react project.

Create a new folder:

mkdir React-project
CD React-project
Then create the REACT project with the Create-react-app command:

Create-react-app Hello
You can create a react project and automatically install and match tools such as Webpack and Babel, and you'll be able to quickly develop your project.

Warm tips:

Because the Create-react-app command pre-installs and configures the Webpack and Babel, it also initializes NPM (which can be initialized with NPM Init, After initialization there will be a Package.json file that specifically explains some basic information about your project and can set up NPM custom commands, so there are several custom NPM commands: NPM start: Start running server files NPM run Build: Package A static file with Webpack NPM test: Start testing npm Run Eject: Remove the tool and copy the build dependencies, configuration files

Related Article

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.