Use of create-React-app scaffolding

    npm i -g create-react-app
    create-react-app my-app
    cd my-app
    npm run eject   // Expose the WebPack configuration file
    npm run start
Copy the code

Set up the project directory

run

    npm run start
Copy the code

2. Use serve to build a server

Pack 1.

    npm run build
Copy the code

2. Install the serve

    npm i -g serve
Copy the code

3. Hosting the build

    serve -s build
Copy the code

Start-up success

3. App. js rel=”noopener noreferrer” safety protection

Removing this will cause an error

4. Enable source-Map breakpoint debugging in development mode

1. Source-map is not open in either the default development mode or production mode

2. Effect after opening

devtool: isEnvProduction
      ? shouldUseSourceMap            // Change to true to open the production environment
        ? 'source-map'                // eval-source-map opens debugging in production environment
        : false
      : isEnvDevelopment && 'eval-source-map'.// eval-source-map
Copy the code

npm run start / / restart
Copy the code