[英]Are Node devDependencies included as part of a release if they are nested within dependencies?
Let's say I have Project A with: 假设我的Project A具有:
"dependencies": {
"someDependency": "1.0"
}
and someDependency with: 和someDependency与:
"devDependencies": {
"notwantedinproduction": "1.0"
}
Will Project A included the "notwantedinproduction" dependency as part of a release build, by virtue of having it nested within dependencies a la "someDependency"? 项目A是否会将“ notwantedinproduction”依赖性作为发行版本的一部分包含在内,因为它会嵌套在“ someDependency”依赖性中?
Thanks guys! 多谢你们!
No, when you npm i
it will only install the dependencies defined in that module and will not install that modules devDependencies. 不,当您使用
npm i
,它将仅安装该模块中定义的依赖项,而不会安装该模块devDependencies。 An easy was to see this in action is to start a new project then install express (or anything else). 一个容易看到的实际效果是启动一个新项目,然后安装express(或其他任何东西)。 Express has a dev dependency for eslint but if you check your node modules you won't find eslint in there.
Express具有eslint的dev依赖关系,但是如果您检查节点模块,则不会在其中找到eslint。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.