Skip to content

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

Merged
yangshun merged 1 commit into
meta:masterfrom
SamChou19815:add-pnp-webpack-plugin-to-core
May 23, 2020
Merged

yangshun merged 1 commit into
meta:masterfrom
SamChou19815:add-pnp-webpack-plugin-to-core

Conversation

@SamChou19815

@SamChou19815 SamChou19815 commented May 22, 2020 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@SamChou19815
SamChou19815 marked this pull request as ready for review May 22, 2020 22:31
@SamChou19815
SamChou19815 requested a review from yangshun as a code owner May 22, 2020 22:31
@yangshun
yangshun merged commit 78136e7 into meta: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

slorber commented May 27, 2020 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

slorber commented May 27, 2020

Copy link
Copy Markdown
Collaborator

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.

6 participants