Modifying Webpack Configs Without Ejecting
If you are not familiar with the term “ejecting” in the framework sense, that’s good because it can be a bit terrifying. Ejecting is a term that was coined by the React.js community when referring to Webpack configs and their CLI, Create React App. In order to make Create React App “config-less” and updateable on the Webpack end, the Webpack configs are not accessible to the user. It’s not a bad thing because 1) Webpack is intimidating and can be confusing and 2) you do not have to manage the configuration files.
However, there are times, scratch that, there will be times where you want to modify Webpack yourself. You might want to create an alias to a node module that doesn’t have one. As soon as you want to touch configuration files, you need to run npm run eject
, and just hope for the best. The ejection process is irreversible and blocks you from being able to upgrade your scripts. Essentially...