这个“反应脚本弹出"是什么?命令做什么? [英] What does this "react-scripts eject" command do?

查看:21
本文介绍了这个“反应脚本弹出"是什么?命令做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆