I have built a reactJS application npx create-react-app.
Currently I have ejected the application because I need to use the copy webpack plugin. For that, I need to get access to the configuration files.
The question is,
:) 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!
In reality, experts do everything they can to avoid additional configuration, tools, and code. Before you eject, ask yourself, “Do I want to build something using React or do I want to fight with picky build tools when things stop working?” Don’t eject until you have a specific reason to do so.
When you run npm run eject command in your React application, you will be able to edit the configuration and script files. You also can upgrade or downgrade the dependencies version on the ejected package.json file. But the eject command comes with a price. Once you eject, you can’t go back and hide the configuration files.
When ejecting, you will gain access to the code from the react-scripts package. The same code can also be found on the CRA Github repo if you want to do some exploration before ejecting. The CRA repo also contains several other packages which you might also find interesting to investigate.
There is no real recommended practice for this. If you feel the need to override your configurations, then do it. Otherwise, there's no reason to do so.
There will be no harmful effects from ejecting. Your build is simply going from being wrapped in a single dependency to its actual component parts.
Usually you would run eject when you want to override something in the configuration. For example if you want to use your copy-webpack-plugin. Or want to use custom aliases. Or any other plugin/function/tweak to your configurations
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