-save-dev 是指将包信息添加到 package.json 里的 devDependencies节点,表示开发时依赖的包。 -save 是指将包信息添加到 package.json 里的dependencies节点,表示发布时依赖的包。
(当使用npm install --production的时候,只会安装dependencies:{***}中的项目)
{ "dependencies": {
"vue": "^2.2.1"
}, "devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-latest": "^6.0.0",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"vue-loader": "^11.1.4",
"vue-template-compiler": "^2.2.1",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0"
}
}