这个“反应脚本弹出"是什么意思?命令吗? [英] What does this "react-scripts eject" command do?
问题描述
npm run eject
命令的作用是什么?我确实了解其他命令的功能,例如启动,构建,测试.但不知道弹出.
What does the npm run eject
command do? I do understand what other commands do like start, build, test. But no idea about eject.
推荐答案
create-react-app封装了它在内部使用的所有npm模块,因此您的package.json将非常干净简单,而您不必担心关于它.
create-react-app encapsulates all of the npm modules it is using internally, so that your package.json will be very clean and simple without you having to worry about it.
但是,如果您想开始做更复杂的事情并安装可能与在后台使用的create-react-app模块交互的模块,则这些新模块需要知道可用的内容,而不是可用的内容,这意味着您需要create-react-app不会对其进行抽象.
However, if you want to start doing more complex things and installing modules that may interact with modules create-react-app is using under the hood, those new modules need to know what is available and not, meaning you need to have create-react-app un-abstract them.
从本质上讲,这就是react-scripts eject
的作用.它将停止隐藏引擎盖下已安装的内容,而是将这些内容弹出到项目的package.json中,以供所有人查看.
That, in essence, is what react-scripts eject
does. It will stop hiding what it's got installed under the hood and instead eject those things into your project's package.json for everyone to see.
这篇关于这个“反应脚本弹出"是什么意思?命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!