
--save (-S) 会把依赖包名称添加到 package.json 文件 "dependencies" 键下
--save-dev (-D) 则添加到 package.json 文件 "devDependencies" 键下
"dependencies"是运行时依赖,"devDependencies"是开发时的依赖。
"dependencies"下的模块,是发布后还需要依赖的模块。
例如:
"dependencies": {
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
}