简体   繁体   English

弹出使用create-react-app创建的React应用程序会导致什么损失?

[英]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.

相关问题 Create-React-App中的启动画面 - Splash screen in Create-React-App 如何在 npx create-react-app 中修复此错误? - how to fix this error in npx create-react-app? create-react-app,安装错误(“找不到命令”) - create-react-app, installation error ("command not found") 如何使用 create-react-app 提供 SSL 证书? - How can I provide a SSL certificate with create-react-app? 有没有一种方法可以使用诸如create-react-app之类的信号命令来创建基于redux的reactJS应用 - Is there a way to create a redux based reactJS app with a signle command like create-react-app 将react-bootsrap组件导入FB Create-React-App Boilerplate后出现JSON错误 - Getting a JSON error after importing react-bootsrap components into FB Create-React-App Boilerplate 如何修复错误'FB'在create-react-app项目中没有定义no-undef? - How to fix error 'FB' is not defined no-undef on create-react-app project? Create-React-Native-App-使用本机模块 - Create-React-Native-App - using native modules 如何分叉为自定义构建创建React App - How To Fork Create React App For Custom Builds 你能在Ubuntu上构建React Native应用程序(Android应用程序)吗? - Can you build React Native apps (Android app) on Ubuntu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM