4 ms·
I totally agree. If you need access to one config variable CRA doesn't support out of the box, your only option is to eject. I really wish there were the option
by hn_throwaway_99 6y ago
I totally agree. If you need access to one config variable CRA doesn't support out of the box, your only option is to eject. I really wish there were the option of just providing an "overlay" file that only had your changes from the CRA defaults, rather than being forced to eject the whole config.
- ht85 6y agoSee sibling comments for solutions to do exactly that.
- nawgszy 6y agoI think there's a couple repos that provide exactly that - a webpackOverrides.js file or something similar. I also think that next.js might have some of what the gp is interested in
- ThePadawan 6y agoI can only second what ht85 said in a sibling comment. I have the same complaint, but this is definitely possible using e.g. react-app-rewired. Adding custom webpack loader rules is as simple as replacing the calls to react-scripts with calls to react-app-rewired and adding a .js file with your customizations.
- acemarke 6y agoThere are multiple existing third-party tools in the ecosystem that let you do exactly that: - https://github.com/gsoft-inc/craco https://github.com/gsoft-inc/craco - https://github.com/harrysolovay/rescripts https://github.com/harrysolovay/rescripts - https://github.com/timarney/react-app-rewired https://github.com/timarney/react-app-rewired - https://github.com/arackaf/customize-cra https://github.com/arackaf/customize-cra No, they're not "officially" supported, and you basically void the warranty by poking the configs manually, but the tools do what you want them to do.
- hn_throwaway_99 6y agoThank you, this list is much appreciated.
- arvinsim 6y agoBut I think that is the problem. Since there are many ways to do it, you will have to evaluate each one and hope the one you pick gets upstream updates.
- acemarke 6y agoI'd go with `craco`, personally.