fix(ModuleScopePlugin): support pnp in workspaces#11237
fix(ModuleScopePlugin): support pnp in workspaces#11237russell-dot-js wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @russell-dot-js! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign 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 to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
| } | ||
| if (process.versions.pnp) { | ||
| const {findPackageLocator} = require('pnpapi'); | ||
| if (findPackageLocator(request.__innerRequest_request) !== null) { |
There was a problem hiding this comment.
This will be true for any absolute path, not just workspaces
There was a problem hiding this comment.
This is not a complete check and most likely not even a part of a proper check. The idea was to see if file can be resolved to be belonging to one of the packages declared as a dependency, but that does not guarantee that it is required via dependency and not directly.
I assume that is what it does but I don't actually know.
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Fixes #10508, #9226, #8757
I cannot take credit for this fix - @Xerkus wrote it here:
#10508 (comment)
I am only PR'ing this as yarn2 lists create-react-app as compatible with PnP, but create-react-app does not work with workspaces .. kind of funny considering create-react-app is a yarn workspace itself :)
Verified by adding resolution on react-dev-utils: "#10508 (comment)"