feat: support multiple node_modules roots in require_patch #3055
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs: #266
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When referencing multiple
node_modules
from(npm|yarn)_install
targets in anodejs_(binary|target)
, you won't be able to resolve modules from allnode_modules
roots.For example, having a separate
yarn_install
:alongside the root:
and referring to both of them in a test rule:
would result in the test run not being able to access the
jest
module.Issue Number: #266
What is the new behavior?
Resolution of a
require
call will be done against allnode_modules
roots. The behavior is the same if it is not found.Does this PR introduce a breaking change?
The prior behavior would have allowed for node_modules to be included without being able to be imported. Due to this, if anyone were relying on this undefined behavior to include
node_modules
data where importing that would have thrown an error, but I can't imagine a use case where this would be useful behavior to rely on.Other information
Some minor adjustments to test case names such as "mode" updated to "module".