-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
[Question] patch on published module #198
Comments
Sorry, patch-package doesn't support publishing libraries. This has been asked before a number of times but it's not safe and therefore not something i want to encourage. If you really want to do this for some reason I'm gonna leave it up to you to figure out how to write a postinstall script that would work ;) |
may you please elaborate more on "patch-package doesn't support publishing libraries" what do you mean exactly ? is this exposed by the readme / docs ? I'm wondering if using prepare hook instead of postinstall would solve the issue. Do you see any drawback in using |
We found out that we may not rely on patch-package in a library, as it is intended to work exclusively in top level projects and not recommended to be used in a library. References: - ds300/patch-package#198 - ds300/patch-package#26 For that reason we had to create a new repository containing the patched version of the Launchpad package's latest build. We patched the build instead of forking the whole package and patching the source for practical reasons, please see the package README if you're curious about those reasons.
A simple solution
|
Hello,
currently I have a module project (named
great-module
) where the code is organized like that:From this repo, the
postinstall
script is correctly executed and the patch is applied tosub-module
module.After publishing my module (
npm publish
) I want to use it from another project (npm install geat-module
).But after install process, I have the following error message :
Error: Patch file found for package sub-module which is not present at node_modules/sub-module
Indeed, after this installation, the code of this project is organized like that:
patch-package
tries to usesub-module
from/node_modules/great-module/node_modules/sub-module
and not from/node_modules/sub-module
.What is the way to apply patches in published module?
Thanks a lot :)
The text was updated successfully, but these errors were encountered: