📌  相关文章
📜  Create React App 提供的 react-scripts 包需要依赖:[1] [1] "webpack": "4.42.0" - TypeScript (1)

📅  最后修改于: 2023-12-03 15:00:03.488000             🧑  作者: Mango

Create React App Dependencies

If you are working with React, then Create React App is one of the most popular tools to bootstrap a new project in seconds. One of the primary dependencies of Create React App is the react-scripts package. This package provides a set of configuration and scripts to build, test, and run your React application.

Dependencies
Webpack

One of the essential dependencies of react-scripts is webpack. Webpack is a module bundler that helps you to manage your application's assets and dependencies. react-scripts rely on webpack to bundle and optimize your code for production.

TypeScript

react-scripts also comes with built-in support for TypeScript. TypeScript is a superset of JavaScript that adds optional static types to your code. It helps you to catch errors during development and makes your code more maintainable and scalable.

How to use react-scripts?

react-scripts is designed to work out-of-the-box with minimal configuration required. To use react-scripts, you need to install it as a development dependency in your project:

npm install react-scripts --save-dev

Then, you can run different scripts that come with react-scripts:

# Starts the development server
npm start

# Builds the production-ready app
npm run build

# Runs the tests
npm test
Conclusion

In conclusion, react-scripts is an essential dependency for any React project that helps you to build, test, and run your application faster and with less configuration. It relies on other popular tools such as webpack and provides built-in support for TypeScript.