What Does Eject do in Create React App?

后端 未结 1 929
我在风中等你
我在风中等你 2020-12-14 15:20

I think it has something to do with using webpack directly and therefore gives more flexibility. But I\'m not completely sure if someone can explain what \"ejecting\" means.

相关标签:
1条回答
  • 2020-12-14 16:24

    To bootstrap a react project it will require for you to know about things like Webpack or Babel which might be a sticking point for people who do not want to learn about these.

    create-react-app provides a fully configured environment with reasonable defaults (and possible to extend). Most infrastructure-related work is hidden from you, and whenever there are changes in one of the dependent packages this is taken care of for you -- it will only be required to update react-scripts.

    I highly recommend this presentation by one of CRA authors it will give you a better idea of the project.

    Now eject means that all of the configuration will be exposed to you. You will see every package which runs your project. Now you are responsible for maintaining all of that configuration.

    This is not necessarily a bad thing; you are then left with more code to maintain, but you get full control in return.

    0 讨论(0)
提交回复
热议问题