M
M
Moe Green2015-01-03 19:06:17
npm
Moe Green, 2015-01-03 19:06:17

What is the difference between --save-dev and --save?

Good day!
I installed packages for Gulp here, I wanted to figure out how the plugin works gulp.spritesmith. And by accident, on the command line to install the package, I gulp-jadetyped the key --saveinstead of --save-dev.
And when I looked in package.jsonto check that everything was fine, I saw this picture:

...
  "devDependencies": {
    "gulp": "^3.8.10",
    "gulp-stylus": "^1.3.4",
    "gulp.spritesmith": "^2.4.0"
  },
  "dependencies": {
    "gulp-jade": "^0.10.0"
  }

From which it can be seen that the packages gulp, gulp-stylusand were gulp.spritesmithinstalled with the key --save-dev(inscription devDependencies), and the package was gulp-jadeinstalled with the key --save(inscription dependencies).
Long introduction, and now the question - what is the difference between the keys --save-devand --save? I'm most interested in the practical side of the issue , because I use Gulp, but I won't develop plugins for it)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Demin, 2015-01-04
@mQm

As ruddy22 rightly noted , not all modules used in development get into the production version of the product. For example, if you want to minify a module, then most likely you will use ready-made products that will not be useful in its use.
In short, modules from devDependencies will not be installed in production. That's all.

K
Konstantin Kitmanov, 2015-05-01
@k12th

devDependencies - packages needed for development. Any gallp grants and plugins to them usually fall into this category.
dependencies - packages that your package directly depends on: as a rule, libraries.
They are all placed in node_modules.
Here are more details: https://toster.ru/answer?answer_id=559717#comments...
If someone does npm install to your package, then npm will suck those packages that are listed in his dependencies, but not in devDependencies.
If you do npm install inside the folder that has package.json, then both will be installed.

A
Alexey P, 2015-01-04
@ruddy22

it is necessary for deployment in production.
and, as you know, already minified version of everything gets into production.
if I'm wrong, please correct me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question