I
I
ivan05122020-08-03 10:50:15
npm
ivan0512, 2020-08-03 10:50:15

How to properly separate dependencies into prod and dev in package.json?

As I understand it, production dependencies are what you need for sales, and dev is what you need for development.
This is simple and clear when it comes to the backend. There you can easily install only dependencies and run everything, since you don’t need to collect anything.
In the case of the frontend, a build step is also added.
Hence the question of whether it is necessary to group the dependencies in such a way that the assembly of the prod is possible without installing the dev dependencies.
That is, so that ci can run yarn install --prod && yarn build.
Or is it better to stick to the logic that the build is a development process, that is, even for a production build, you need to install dev dependencies? With this option, why is this division necessary at all? because in terms of usage there is no difference at all. If only in order to conveniently navigate package.json.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question