shiftx/esbuild-plugin-pnp

Doesn't support TypeScript paths and project references

Opened this issue · 3 comments

Thanks a lot for creating this great plugin @eigilsagafos.

It seems that currently the plugin doesn't support TypeScript's path feature leading to errors like these:

image

Esbuild itself does support TS paths out of the box, so it would be great if this plugin could also support this crucial feature for larger projects.

Thanks for reporting and I do agree with you @schickling. I guess in this case pnpPlugin should just ignore packages that are marked in the ts config?

We suggest not using that config at all and instead using the link: protocol https://yarnpkg.com/features/protocols/#why-is-the-link-protocol-recommended-over-aliases-for-path-mapping

The official Yarn plugin has the same issue.

I found a workaround for my specific use case: yarnpkg/berry#2549 (comment)

@schickling You'd probably only need to adjust the regex for your case.