-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
improvements: set react and react-dom alias in webpack #3698
Conversation
…to avoid react loading twice when developing
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
I feel like in a way this just works around the problem instead of solving it. I would prefer it we completely failed the build with multiple |
I wonder how it's possible to deduplicate. |
It depends on the exact scenario in which you're seeing duplication (there are many possible solutions). |
Okay, let me explain the case that we've been facing. Then we may understand/talk the way how we resolve it. After that, I can improve this pull request. First, we have an application which is obviously created by create-react-app and using a dependency that we have been developing. That dependency contains our React UI components. Therefore, we need to link the dependency to our main application during the development. So this case cause multiple copies of React issue. I think that we may resolve the issue in this way that we have in this branch. Besides that, there is such a workaround, here. But the latter one would be a real workaround than the changes we have here in my opinion. Therefore, I'm wondering how we can resolve the issue. Could you explain that? |
We are tracking the "npm link" use case in #1107. Not sure if there's any great solutions for it. Ideally I'd like us to fix #1333. This wouldn't solve "linking" per se, but it would add a supported way to develop components alongside the app. Would that satisfy your use case? The reason I'm not very happy with aliasing |
Related: #3883 Seems like this is actually the root of the problem. Pardon the module resolution pun. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. |
This pull request has been automatically closed because it has not had any recent activity. The conversation will be locked in 7 days unless the pull request is reopened. Thank you for your contribution. |
set react and react-dom alias in webpack to avoid loading twice react during developing. This issue has been discussed, see here #675. I have tested with my app locally. The duplicated react issue is gone after set up alias.