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.

转载于:https://www.cnblogs.com/zhongping/p/4526674.html

你可能感兴趣的:(devDependencies和dependencies区别)