Get the App
SLTechnology News&Howtos  ›  Development  › 

What is react-scripts?

Shulou Source: shulou.com Published: 2022-06-02 12:08:09 11月07日 Update

The main content of this article is to explain "what is react-scripts". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what react-scripts is.

React-scripts is a set of scripts in the create-react-app starter package; create-react-app can start the project without configuration; react-scripts start can set up the development environment and start the server, and hot modules can be reloaded.

This article operating environment: Windows7 system, react17.0.1 version, Dell G3 computer.

What is react-scripts?

React-scripts is a set of scripts in the create-react-app starter package. Create-react-app helps you start the project without having to configure it, so you don't have to set up the project yourself.

React-scripts start sets up the development environment and starts the server, as well as hot module reloading. You can read here to understand what it has done for you.

With create-react-app, you can use the following features immediately.

React,JSX,ES6 and Flow syntax support.

Languages other than ES6, such as object propagation operators.

CSS for automatic prefixes, so you don't need-webkit- or other prefixes.

Fast interactive unit test runner with built-in support for coverage reporting.

Real-time development server warns of common errors.

A build script that bundles JS,CSS and images with hashes and source mappings for production.

Offline priority service workers and Web application manifests that meet all progressive Web application standards.

The above tools can be easily updated with a single dependency.

Npm script

Npm start is a shortcut to npm run start.

Npm run is used to run the script that you defined in the scriptspackage.json object

If there is no key in the start script object, it defaults to node server.js

Sometimes you want to do more than the react script can provide, in which case you can do react-scripts eject. This transitions your project from a "managed" state to an unmanaged state, where you have full control over dependencies, build scripts, and other configurations.

At this point, I believe you have a deeper understanding of "what react-scripts is", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Scripts projects services objects servers environments programs development configuration content prefixes applications modules status learning application hosting support running utility Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Apple MySQL vpn OPPO Reno