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

Is there a way to convert pnpm patches to patch-package patches? Or do they use the same format? #505

Open
matthew-dean opened this issue Dec 19, 2023 · 2 comments

Comments

@matthew-dean
Copy link

While the documentation notes that patch-package is not needed for PNPM, a lot of people in this PNPM thread feel otherwise, for very good reasons. It's simply not as robust as patch-package. Is it possible to convert PNPM patches to patch-package patches and then move forward with just using patch-package?

@matthew-dean
Copy link
Author

Oh.... patch-package won't work with PNPM whatsoever? 😢

@Fryuni
Copy link

Fryuni commented Dec 19, 2023

pnpm uses links on node_modules, saving both space and time during installation and upgrades, but that also means you can't freely edit files there like you can for yarn and npm. That is why patch-package won't work properly with pnpm, it would globally mess with all your projects and a patch in one project would conflict with patches on another project.

You can convert a patch-package patch into a pnpm patch and vice-versa. You just need to change the prefix of the files. patch-package is relative to the root of your project, so the path is /node_modules/<package_name>/<changed_file>, pnpm is relative to the root of the package being patched, so the path is just /<changed_file>

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

No branches or pull requests

2 participants