D
D
Denis2020-06-21 00:36:46
npm
Denis, 2020-06-21 00:36:46

How to define dependency in package json?

How to understand if the dev library is a dependency in the project or is it needed in the production version?
For example, the editor for React is a production lib? I don't quite understand the concept

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FinGanapre, 2020-06-21
@likoz

What is executed in the application itself is the dependency ( dependencies )
What is needed only for building the application / tests is the development dependency ( devDependencies )
The package repository most often specifies the correct command to install. Either just npm i [name] or npm i -D [name]. But I met errors in some when the command is written as npm i, although either is needed only for building.
Just think about where you apply this package. If there is not enough knowledge to determine this, then .. mm .. you can look at the package.json in the boilerplates.
Another option to check. What you import when developing an application (in components and index.js) are dependencies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question