Automatically add by default to "dependencies" or "devDependencies" depending on the dependency #429
Unanswered
adriancuadrado
asked this question in
RRFC
Replies: 1 comment 2 replies
-
There's no way for the package author to know that. You always have to know, and explicitly indicate, when something isn't a runtime dependency. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is very easy to forget using the
--save-dev
flag to add a dependency correctly. I was thinking it would be a good idea if the package to add had in its package.json a field to tell whether this package is meant to be added as a normal dependency or as a devDependency. This way you won't have to explicitly add the--save-dev
flag to add the dependency as a devDependency anymore. This new field is optional and its default value will make npm install add the dependency to thedependencies
field.Beta Was this translation helpful? Give feedback.
All reactions