问题描述
我是React的新手,正在学习如何正确创建新项目.然后,当我们使用以下命令创建新项目时,我遇到了-scripts-version
:
I am new to React and learning how to properly create new project. Then I came across --scripts-version
when we create new project with such command:
create-react-app new-project --scripts-version
我们为什么需要使用-scripts-version
?
推荐答案
The tool create-react-app is basically a wrapper around a number of tools and configuration options stored in an npm package called react-scripts.
当您使用 create-react-app
命令创建您的React应用时,它会使用 react-scripts
来设置您的项目.
When you use the create-react-app
command to create your React app, it uses react-scripts
to set up your project.
命令行选项-scripts-version
是一项高级功能,可以更改使用哪个版本的 react-scripts
.
The command line option --scripts-version
is an advanced feature to change which version of react-scripts
is used.
如果您对 create-react-app
设置项目的方式不满意,则可以派生 react-scripts
存储库,对其进行更改,然后使用您的版本来创建您的React应用.
If you are not happy with the way create-react-app
sets up your project, you can fork the react-scripts
repository, change it and then use your version to create your React apps.
这篇关于为什么在create-react-app中需要使用--scripts-version命令行选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!