Home > Web Front-end > Front-end Q&A > what is react-scripts

what is react-scripts

藏色散人
Release: 2021-11-22 16:53:16
Original
5682 people have browsed it

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, as well as hot Module reloaded.

what is react-scripts

The operating environment of this article: Windows 7 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 your project without configuration, 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 find out what it can do 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 the object spread operator.

  • Auto-prefixed CSS so you don't need -webkit- or other prefixes.

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

  • The real-time development server warns about common errors.

  • A build script for bundling JS, CSS and images with hashes and source maps for production.

  • Checklist of offline-first service workers and web applications that meet all Progressive Web Application criteria.

  • Easily update the above tools with a single dependency.

npm script

npm start is the shortcut of npm run start.

npm run is used to run the script you define 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 something beyond what react scripts can offer, in which case you can do react-scripts eject. This converts your project from a "managed" state to an unmanaged state, where you have full control over dependencies, build scripts, and other configurations.

Recommended learning: "react video tutorial"

The above is the detailed content of what is react-scripts. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template