vercel/webpack-asset-relocator-loader

Yarn berry pnp support

goloveychuk opened this issue · 2 comments

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.

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

@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?