devDependencies和dependencies区别

package.json 中存在devDependencies和dependencies,那么他们的区别是什么呢?

devDependencies是开发中需要安装的包

dependencies是发布时需要安装的包

那么如果区分安装呢?

默认用 npm install 的时候他会安装devDependencies中的内容

如果用 npm install --production 就会安装dependencies中的内容

If you do npm config set production, then that sets the --production configuration flag for all npm commands, by setting production = true in the ~/.npmrc file.

If you do npm start --production, then it'll set the NODE_ENV=production environ for the start script.

If you do npm install --production then it won't install devDependencies locally.

posted @ 2015-05-24 22:25  zhongpingwang  阅读(308)  评论(0编辑  收藏  举报