[英]What do you lose by ejecting a React app that was created using create-react-app?
I'm interested in using Hot Module Replacement with a newly created React app. 我有兴趣使用热模块替换与新创建的React应用程序。
Facebook Incubator's create-react-app uses Webpack 2 which can be configured to support HMR, however in order to do so, one needs to "eject" the create-react-app project. Facebook Incubator的create-react-app使用可以配置为支持HMR的Webpack 2,但是为了做到这一点,需要“弹出”create-react-app项目。
As the documentation points out, this is a "one way" operation and cannot be reversed. 正如文档所指出的,这是一种“单向”操作,无法逆转。
If I'm to do this, I want to know what I might be giving up. 如果我要这样做,我想知道我可能会放弃什么。 I've been unable to locate any documentation that explains the potential drawbacks of ejecting. 我一直无法找到任何解释弹出的潜在缺点的文档。
The current configuration allows your project to get updates from create-react-app core team. 当前配置允许您的项目从create-react-app核心团队获取更新。 Once you eject you no longer get this. 一旦你弹出你不再得到这个。
It's kind of like pulling in bootstrap css via CDN as opposed to downloading the source code and injecting it directly into your project. 这有点像通过CDN引入bootstrap css而不是下载源代码并将其直接注入到项目中。
If you want more control over your webpack, there are ways to configure/customize it without ejecting: https://www.npmjs.com/package/custom-react-scripts 如果您想要更好地控制您的webpack,可以通过以下方式配置/自定义它而不会弹出: https ://www.npmjs.com/package/custom-react-scripts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.