Answer the question
In order to leave comments, you need to log in
What role do dependencies and devDependencies play in npm, only a formal one?
What role do dependencies and devDependencies play in npm, just a formal one?
I don’t quite understand how to manipulate dependencies with dependencies, or is it just for developers to see and done only for them?
Answer the question
In order to leave comments, you need to log in
Yes, the difference is only formal, semantic. Technically there is no difference, you can push all the dependencies to dev and you will build your project normally. As well as vice versa. This is done in order not to clutter up package.json, so that you can immediately see which specific dependencies are needed for the application itself (dependencies, for example, react and all its dependencies will go here), and which ones are only for assembly and development (for example , gulp will go to dev).
With npm i or yarn , the package managers take the dependencies from the lists and install them.
dependencies contains what is needed to run the application anyway (for example, some library for a node)
devDependencies - only for development (for example, webpack or sass)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question