N
N
Nebrasko2018-10-19 06:55:01
npm
Nebrasko, 2018-10-19 06:55:01

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

3 answer(s)
A
Alexey Nikolaev, 2018-10-19
@Nebrasko

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).

V
Vitaly Stolyarov, 2018-10-19
@Ni55aN

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)

S
SilentFl, 2015-08-04
@TwoRS

You ask nonsense. everything works as it should.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question