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(v2): Use pnp-webpack-plugin to support pnp module resolution #2796

Merged
merged 1 commit into from May 23, 2020
Merged

feat(v2): Use pnp-webpack-plugin to support pnp module resolution #2796

merged 1 commit into from May 23, 2020

Conversation

SamChou19815
Copy link
Contributor

@SamChou19815 SamChou19815 commented May 22, 2020

Motivation

According to the discussion in #2795, I think we should add pnp-webpack-plugin directly 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 20kb node_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:

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.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 22, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 877086b

https://deploy-preview-2796--docusaurus-2.netlify.app

@SamChou19815 SamChou19815 marked this pull request as ready for review May 22, 2020 22:31
@yangshun yangshun merged commit 78136e7 into facebook:master May 23, 2020
@SamChou19815 SamChou19815 deleted the add-pnp-webpack-plugin-to-core branch May 23, 2020 03:25
@lex111 lex111 added this to the v2.0.0-alpha.56 milestone May 27, 2020
@slorber
Copy link
Collaborator

slorber commented May 27, 2020

Hi @SamChou19815

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).

image

Was wondering if yarn2 or a specific version of nodeJS was required to make it work.

I'm on:
node v12.16.1
yatn 1.21.1

Any idea?

@SamChou19815
Copy link
Contributor Author

Screen Shot 2020-05-27 at 10 43 10

@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 rm -rf **/node_modules, or manually remove the build folders?

@slorber
Copy link
Collaborator

slorber commented May 27, 2020

Ah sorry it's working after deleting /lib

I think it has something to do with incremental TS compilation and the .tsbuildinfo file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants