create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Discussing Advanced Configuration Options

Open harrysolovay opened this issue 5 years ago • 32 comments

I believe there's a great need for CRA to support advanced configuration. React-app-rewired was the first to let users patch their CRA configs. Then CRA changed (2.0+ and the merging of dev & prod builds). So... I made Rescripts, which similarly patches react-scripts. These tools work... but they're subject to break whenever CRA changes. Not to mention, they operate via node's require cache and can lag (big time).

I agree with everything that's been said about prioritizing simplicity for beginners. Nevertheless, there's a missed opportunity to provide better DX for experienced devs (who should also be a priority). No experienced devs want to miss out on updates to react-scripts... but they also don't want to miss out on a lot of the beautiful tooling that hasn't made its way into CRA.

CRA is––for many––the go-to starter (~1.75 million downloads this week alone according to react-scripts npm stats). I feel a little guilty as I ask this question (for what is surely the trillionth time maintainers have heard it), but why can't there be a built-in mechanism––that isn't ejection––for overriding the config?

I'd be more than happy to build this into CRA as an optional back door for manipulating the Webpack config. Something simple, where users can define a function which takes in, operates on, and returns the config object. This way, there's no need to use a 3rd party patching tool, nor would there be a need to eject in most cases.

Beginner devs stay happy. Other devs become overjoyed. Thoughts?

harrysolovay avatar Jan 29 '19 23:01 harrysolovay