-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Move more things to react-dev-utils #2442
Comments
Sounds good, but I want to keep user in control of webpack configs (and probably DevServer config?) so it’s easy to modify them explicitly. |
You mean, once ejected? I see a few options:
Option 1 would be consistent with what we do at the moment, but is a bit of a shame as it means users who eject never get updates to webpackDevServerConfig.js Option 2 will be the most work to build/maintain, but I think is probably the nicest experience. Option 3 would be very easy, but does add more work for the user if they decide they want to fork webpackDevServer.config.js |
[see facebook#2442] This removes the path resolution utilities from config/paths.js and leaves behind just the actual path configuration.
People who maintain forks of Keeping it in I've also edited |
Just to set expectations, we’re a little busy with some other things and it will take me a little while to get back to this. |
We can add lots of options to the function that returns webpackDevServerConfig, so that it needs forking less frequently. You can also always mutate the object returned. If you do need to fork it completely, you can still just copy it and edit it. Thanks for letting me know what to expect @gaearon |
I want to make react-scripts easier to fork/extend. I think the way to do that is to move as much as possible into react-dev-utils so that react-scripts can be a smaller package that changes less frequently. Then you can always just update the react-dev-utils to get most new features in react-scripts.
This should also make ejecting much less painful, as ejected projects still depend on react-dev-utils
My proposal is to move:
publicPath
andappPublic
as additional optionsdotenvPath
as an argument, anddelete require.cache[require.resolve('./paths')];
will have to be done elsewhere.paths.testsSetup
andpaths.appPackageJson
as arguments.I then think we should add a
pathUtils
module in react-dev-utils, containingresolveApp
,getPublicUrl
,getServedPath
andresolveOwn
. This should simplifyconfig/paths.js
quite a bit.At this point, I think we should re-evaluate what else needs moving. If nobody objects, I'll start submitting pull requests for these changes.
The text was updated successfully, but these errors were encountered: