[英]Why grunt as devDependencies inside package.json
I'm new with grunt, I started learning it ten minutes ago and I was wondering why grunt must be listed in the package.json as dependencies. 我是grunt的新手,十分钟前开始学习它,我想知道为什么必须在package.json中将grunt作为依赖项列出。 This means that when someone will install my module for node, for example, npm will install to him also grunt.
这意味着,例如,当有人为节点安装我的模块时,npm也会对他安装。 But I actually need grunt just to minify stuff and push them to my git repo and it isn't needed to run actually the node script.
但是我实际上只需要咕unt咕to,以使内容最小化并将其推送到我的git repo中,而实际上不需要运行节点脚本。
Did I miss something? 我错过了什么?
UPDATE: Now that I know how to handle grunt I can say that I don't like it so much. 更新:现在我知道如何应付咕gr声了,我可以说我不太喜欢它。 I find grunt too tied with npm.
我发现咕unt声与npm息息相关。 This post explain perfectly my feelings about this task runner: Using a task runner without package.json
这篇文章完美地解释了我对这个任务运行程序的感受: 使用不带package.json的任务运行程序
dev Dependencies are only installed when doing npm install
in the root of the package. dev依赖项仅在软件包根目录中执行
npm install
时npm install
。 When someone installs your package, only the dependencies
are installed. 当有人安装您的软件包时,仅安装
dependencies
。
So grunt in devDependencies
is exactly what you want, you need grunt when dev eloping your package. 所以
devDependencies
正是您所需要的, 开发人员开发软件包时需要格外认真。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.