NPM install when installing the node module, there are two command parameters that can write their information to the Package.json file:
–save
–save-dev
But its document 1, only mentioned a small difference,-- Save adds the dependent package name to the Package.json file dependencies key, and--save-dev is added under the Package.json file Devdependencies key, such as:
{
"Name": "Yo",
"Version": "0.0.0",
"Dependencies": {},
"Devdependencies": {
"Grunt": "~0.4.1",
"Grunt-contrib-copy": "~0.4.1",
"Grunt-contrib-concat": "~0.3.0",
"Grunt-contrib-uglify": "~0.2.0",
"Grunt-contrib-compass": "~0.7.0",
"Grunt-contrib-jshint": "~0.7.0",
"Grunt-contrib-cssmin": "~0.7.0",
}
}
But that's just their superficial difference. The real difference is that the modules listed below Devdependencies are used in our development, such as grunt-contrib-uglify, we use it to confuse JS files, they are not deployed to the production environment. The modules under dependencies are the dependencies we need in our production environment.