Repository navigation
feat(v2): Use pnp-webpack-plugin to support pnp module resolution - #2796
Merged
yangshun merged 1 commit intoMay 23, 2020
Merged
Conversation
Contributor
|
Deploy preview for docusaurus-2 ready! Built with commit 877086b |
SamChou19815
marked this pull request as ready for review
May 22, 2020 22:31
yangshun
approved these changes
May 23, 2020
Collaborator
|
Don't exactly know what is happening but I'm unable to build the core project (the module is present in node_modules, I did rm -rf node_modules and yarn install). Was wondering if yarn2 or a specific version of nodeJS was required to make it work. I'm on: Any idea? |
Contributor
Author
|
@slorber I am unable to reproduce this problem. I'm on latest master, Yarn 1.22.4, node 12.14.1. I guess you need to |
Collaborator
|
Ah sorry it's working after deleting /lib I think it has something to do with incremental TS compilation and the .tsbuildinfo file |
mrizwanashiq
pushed a commit
to mrizwanashiq/docusaurus
that referenced
this pull request
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Motivation
According to the discussion in #2795, I think we should add
pnp-webpack-plugindirectly to docusaurus core to enable a zero-config experience for yarn pnp users. It adds very little space overhead to non-pnp users: adding this to an empty projects only creates a 20kbnode_modules.Note
After testing it on a local project after manually apply my pnp fix changes, including this one, I found that we are still one or two diffs away from fully supporting Yarn pnp mode. Here are some problems I found so far:
client-modules.jsrelated issues fixed in fix(v2): Consistently use require.resolve in official plugins to resolve modules #2797@mdx-js/reactissue (generated blog code hasimport { mdx } from '@mdx-js/react'), we might need to recommend pnp users to add@mdx-js/reactas a dependency to fix this.pnpMode: looseas a workaround.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)