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

Yarn berry pnp support #163

Closed
goloveychuk opened this issue Jul 6, 2022 · 2 comments · Fixed by #165
Closed

Yarn berry pnp support #163

goloveychuk opened this issue Jul 6, 2022 · 2 comments · Fixed by #165

Comments

@goloveychuk
Copy link
Contributor

I see that you're using resolve package, which does not work with pnp, and does not want to merge pnp support into repo.
To fix this, resolve maintainer created an api to hook into resolution.
Yarn team from their side created a patch, which applied when resolve installed.
https://github.dev/yarnpkg/berry/blob/5f123d0301030a29fa28ef89b1974c016edb50dc/packages/plugin-compat/extra/resolve/normalize-options.js#L1
This is what I have in yarn.lock

"resolve@patch:resolve@^2.0.0-next.3#~builtin<compat/resolve>":

But because assets relocator loader bundles resolve, it's not possible to apply a patch.
To fix this we need to make resolve external, does not bundle it, and declare it as dependency in package.json.
I can provide a pr.

@goloveychuk
Copy link
Contributor Author

goloveychuk commented Jul 7, 2022

@yichi-yang sorry for ping, could you please check if this solution is ok, I'll provide a pr

@yichi-yang
Copy link
Contributor

@yichi-yang sorry for ping, could you please check if this solution is ok, I'll provide a pr

I'm not the maintainer of webpack-asset-relocator-loader (though I did contribute a few bug fixes recently) so I'm not very familiar with how bundling works here. Maybe you can make a PR and let the maintainers take a look?

styfle pushed a commit that referenced this issue Jul 13, 2022
renawolford6 added a commit to renawolford6/asset-relocator-loader-webpack that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants