Replies: 1 comment 1 reply
-
The best practice is to build prepublish, and not to inflict a build step on every consumer of your package. When would you want |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I put
prepare
scripts in my projects so that if they are installed as git dependencies in other projects, thenprepare
will build things as needed.However, when I run
npm install
in a project, I wantprepare
to run only for dependencies that I've installed into my project, and not for the project itself.Is this possible?
If not, I maybe it would be good feature to add. A good reason for adding such a feature is that running
npm install
only for it to fail because the project is in a broken state is annoying. Sometimes, you just need to install things in the process of getting the project working again.We can open
package.json
and temporarily remove theprepare
script as a workaround. It would be nicer though, if I could stick something in my project's.npmrc
and never have to do that again (only when runningnpm install
directly in the project, but theprepare
script should still always run when it is installed as a git dependency for example).Beta Was this translation helpful? Give feedback.
All reactions