Skip to content
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

feat: add Yarn PnP support #2478

Merged
merged 6 commits into from
Dec 8, 2020
Merged

feat: add Yarn PnP support #2478

merged 6 commits into from
Dec 8, 2020

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Nov 16, 2020

What's the problem this PR addresses?

The tag providers can't be located under Yarn PnP due to hard coding node_modules

Fixes #2469

How did you fix it?

  • Use require.resolve to locate tag providers
  • Setup the PnP hook from the workspace if it exists

@merceyz
Copy link
Contributor Author

merceyz commented Nov 16, 2020

Would it be fine if I changed

const packages = await findAllPackages(nodeModulesPaths, name);
to use require.resolve instead?
I guess that is supposed to half support workspaces, but at that point it should just run require.resolve in each workspace

@yoyo930021
Copy link
Member

Would it be fine if I changed

const packages = await findAllPackages(nodeModulesPaths, name);

to use require.resolve instead?
I guess that is supposed to half support workspaces, but at that point it should just run require.resolve in each workspace

I want to establish a dependency relationship in advance.
But I thought maybe in pnp it was redundant?

@merceyz
Copy link
Contributor Author

merceyz commented Dec 1, 2020

I'll omit that part for now

@merceyz merceyz marked this pull request as ready for review December 1, 2020 09:42
Copy link
Member

@yoyo930021 yoyo930021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I will merge when #2495 merged.

@yoyo930021 yoyo930021 merged commit 5291921 into vuejs:master Dec 8, 2020
@merceyz merceyz deleted the merceyz/pnp branch December 8, 2020 13:33
@merceyz merceyz restored the merceyz/pnp branch December 10, 2020 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support yarn pnp mode
2 participants