Skip to content
New issue

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

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

Already on GitHub? # to your account

Is there an appropriate approach to add custom configuration for webpack? #2608

Closed
draplater opened this issue Jun 24, 2017 · 2 comments
Closed

Comments

@draplater
Copy link

I try to add configuration for custom loaders by modifying webpack.config.dev.js. But when I upgrade packages, my modification is overridden. So, can I config webpack without "eject"?

@jmcrthrs
Copy link

jmcrthrs commented Jun 24, 2017

Actually, yes.

You can read about it here:

#682

Here is a detailed blog post with all the steps you require:

https://auth0.com/blog/how-to-configure-create-react-app/

In short, you:

  • fork react-scripts
  • edit the configuration
  • publish to npm with a unique name (draplater-react-scripts)
  • reference your forked react-scripts when creating a new app

$ create-react-app my-app --scripts-version draplater-react-scripts

Pro:

  • You can pull from upstream to stay up to date with changes from the official react-scripts
  • No need to eject

Con:

  • Maintaining your fork.

@gaearon
Copy link
Contributor

gaearon commented Jun 26, 2017

There is also unofficial https://github.com/timarney/react-app-rewired (use at your own risk).
But we don't officially support overriding webpack loaders until you eject or fork.

Cheers!

@gaearon gaearon closed this as completed Jun 26, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants