Eject

The last chapters will show you how to deploy your application to production. We will uncover more about how to deploy applications in the create-react-app in this lesson.

We'll cover the following

The following knowledge is not necessary to deploy your application to production, but it still bears mentioning. create-react-app comes with one feature to keep it extendable, but also to prevent a vendor lock-in. A vendor lock-in usually happens when you buy into a technology but there is no escape hatch from using it in the future. Fortunately, in create-react-app you have such an escape hatch with “eject”.

In your package.json you will find the scripts to start, test, and build your application. The last script is eject. However, it is important you know that it is a one-way operation. That means once you eject, you can’t go back! It is advisable to stay in the safe environment of create-react-app if you have just started creating applications in React.

If you feel comfortable enough to run npm run eject, the command copies all the configuration and dependencies to your package.json and a new config/ folder. It converts the whole project into a custom setup with tooling that includes Babel and Webpack, and grants full control over all these tools.

Its official documentation says create-react-app is suitable for small to middle sized projects, so you shouldn’t feel obligated to use the “eject” command until you’re ready.

Further Reading

Get hands-on with 1200+ tech skills courses.