WebStorm creates and runs React projects

premise:

Node and webstorm are already installed

 

1. Run the following command to install the create-react-app command

npm install -g create-react-app

2. Create a new React App project project in WebStorm

3. Click Run, in the run settings, set the command to run, and stcrip to run, as shown in the following figure:



 

4. Click the Run button to run the project

5. If it is set to build in stcrip in the third step, it is to build the project. After execution, a build directory will be generated in the project, including various generated compiled files. If you want to run, you need to copy the following directories or files in the build to the root directory of the drive letter, or the root directory of the web server, because all file references are based on absolute path references of the root directory.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326101931&siteId=291194637