create-react-app building project process

Facebook officially launched the Create-React-App scaffolding, which can be configured to build zero-based webpack of React development environment, built-in hot update functions.

Since the create-react-app command pre-installed and configured webpack and babel, also initialized npm
(can be initialized by npm init, there will be a complete initialization file package.json, specifically to illustrate some basic information about your project and You can set a custom command npm), so there are several custom npm command:

 

First, how to install
1, first ensure that you have installed node.js, you can go to the official website https://nodejs.org/en/ node.js download the installation package, download a good fool-step installation place.


2, according to the following steps to install, gitBush recommended to use command-line tools

( 1 ) npm install -g the Create-react- App global installation 

( 2 ) the Create-react- App project and react name of the new project name (Note: The project name can not have capitalized) 

( 3 where the files) cd project folder from the command into the folder inside, ready to run the project 

( 4 ) Start to run the project npm

3, the above command can react quickly build a project, this time to see the structure of the following items

 

 

4, the project can be seen, there is no configuration webpack, because the create-react-app scaffolding has helped us a good package.

But if you want to webpack set, you can use the command npm run eject the exposed webpack files, this operation is not reversible .

npm run eject

At this point there will be a configuration webpack of our project in the

 

Guess you like

Origin www.cnblogs.com/SRH151219/p/11137216.html