Answer the question
In order to leave comments, you need to log in
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-jade
typed the key --save
instead of --save-dev
.
And when I looked in package.json
to 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"
}
gulp
, gulp-stylus
and were gulp.spritesmith
installed with the key --save-dev
(inscription devDependencies
), and the package was gulp-jade
installed with the key --save
(inscription dependencies
). --save-dev
and --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
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.
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question