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. Also what are the ramifications of ejecting a create react app? Is it bad to do this, or?
npm run eject This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc.) into your project as dependencies in package.
The enact eject command will permanently eject an app from within the Enact CLI environment into a free-standing package with all development tools embedded. Ejection will expose all development tool config files and move all required npm dependencies into the app's local package.
Removes Create React App scripts and preset configurations and copies build dependencies, configuration files, and scripts into the app directory. If you do this, you can't go back to using Create React App on your project!
eject: is an advanced operation it allows you to customize the configuration under Create-React-App (react-scripts) Before do eject you need to understand the consequences: it is a one-way operation! The only reason I would encourage you to do eject is that: learn how the build process (create-react-app) works.
But the eject command comes with a price. Once you eject, you can’t go back and hide the configuration files. You will have to maintain your React app configuration on your own. This means: You need to update the dependencies and ensure its not broken when a new version is released
The benefit of Create React App is that the inner workings are hidden away. The last feature of CRA is the eject command. If you run this command, CRA rips down the curtain and shows you how everything works. Your CRA is now just a React app.
Unlike ejecting, these options are easy to back out of if necessary. React-app-rewired is one of the most popular approaches. Additionally, customize-cra is a package built on top of react-app-rewired with support for version 2 of CRA.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With