简体   繁体   中英

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.

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.

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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM