Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom configuration #3917

Closed
Ayc0 opened this issue Jan 25, 2018 · 5 comments
Closed

Custom configuration #3917

Ayc0 opened this issue Jan 25, 2018 · 5 comments

Comments

@Ayc0
Copy link

Ayc0 commented Jan 25, 2018

As mentioned in #2758 and in #3878, we could need a file in which we store our conf, such as the vendors, or the externals (to support cdn), or even custom babel config (ahahah)

Why not a cra field in the package.json and a .crarc / .crarc.json and a .crarc.js files that contains our custom config ?

@andriijas
Copy link
Contributor

Both razzle, react-app-rewired and preact-cli enables custom configuration by optionally adding a js file (razzle.config.js, config-overrides.js, preact.config.js)

I suggest optional file without . in the beginning.

@Ayc0
Copy link
Author

Ayc0 commented Jan 26, 2018

But babel, eslint, prettier, create-component-app, validate-commit-message, etc. are using .[file]rc files (sometimes with the .js or .json extensions)

@bsutt123
Copy link

Gaearon will probably be able to give a better explanation than I, but I believe the intention of CRA was to make it so that you have good defaults that newbies and seasoned programmers alike can use and are stable. If you start throwing in the ability for us to modify the default behavior of the configuration then they have to go down the rabbit hole of worrying about all the different ways you can change configs and trying to account for that.

If you don't like the defaults, you can a) use a module like andriijas suggests and get to use their defaults b) make your own react-scripts (this is what I do) or c) eject for each project and set up the config yourself. Moral of the story is that they don't want to make the config customizable.

@danielkcz
Copy link

I do really like the mission of CRA, it makes the entrance to React world much easier. However, I am more inclined to allow at least some optional configuration that is most commonly requested (eg. custom webpack loaders, babel plugins...) with a big red warning that doing that means jumping into a rabbit hole.

For example, as I've mentioned in a linked issue, it's really great that .graphql is now recognized, but if I prefer to use .gql I have to either eject or pollute NPM with my own fork of react-scripts for this tiny little change.

Just my two cents, I can understand it's not as easy as it seems to allow such level of customization.

@mudrz
Copy link

mudrz commented Apr 11, 2018

To expand with some additional feedback:

The approach taken by create-react-app was a step in the right direction at the time it was released, but now it feels stale.

It seems that the project does not have the same amount of support from Facebook as the other projects have received from their respective companies/sponsors.

Is there anything we as a community can do to get better 1st party support for this project and its future?
Is it even feasible to expect create-react-app to be expanded to accommodate real-world scenarios that the React community faces?

I realize that one can eject (I do) or use 3rd party projects, but having a mature first party solution that sets some less opinionated style guidelines and project structure propagates in EVERY library and project the community creates. Which in turn creates higher quality and easier to navigate OS libraries.

Any feedback on what we can expect and what we cannot expect would be highly appreciated. And thank you for all the great work so far, this project truly made a big difference 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants