Fix resolveOptions to use project root instead of disk root (#7271) #8969
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.
Relates to (and closes?) #7271 (and similar)
Closes #8846
Changes resolveOptions function to use
path.parse().dir
as opposed topath.parse().root
see docs for more information.With the old code, it would resolve to
C:/
,D:/
, ... etc instead of the root we're interested in. This caused it to climb the tree as opposed to descend it, which causes numerous problems.In my case it would break my pnpm monorepo setup when trying to run/build with parcel. It would select my monorepo root (the first case of a
lock
file fromD:/
). I noticed I could solve it by putting anyyarn.lock
orpackage-lock.json
inside of my app folder and it would select the correct root and build and start properly. This is due to the arrayLOCK_FILE_NAMES
havingpnpm-lock.yaml
last.💻 Examples
├─apps
│ └─examples
│ ├─package-lock.json
├─pnpm-lock.yaml
└─pnpm-workspace.yaml