【发布时间】:2016-06-26 13:56:06
【问题描述】:
我是 Grunt 的新手,我正在做一个需要两个 Angular 应用程序的项目,但我想将节点模块和凉亭组件保留在公共位置,这样我就不必在两个地方进行安装.我创建了组合的通用 package.json 和 bower.json 文件并安装了它们。现在我需要更新我各自的 Grunt 文件以使用该公共位置的节点模块。
是否可以从 gruntfile 以外的任何其他位置提供节点模块来运行 grunt 任务。
例如:我希望 client-app-one 和 client-app-two 从公共节点模块运行各自的 grunt 任务。
/project-root-dir
/project-root-dir/client-app
/project-root-dir/client-app-one/Gruntfile.js
/project-root-dir/client-app-two/Gruntfile.js
/project-root-dir/package.json
/project-root-dir/node_modules/
/project-root-dir/bower.json
/project-root-dir/bower_componenets/
【问题讨论】:
-
可能无法回答您的问题,但 IMO 让 2 个独立的应用程序具有相同的依赖项并不是一个好主意。这些文件适合与一个独特的项目相关联,而不是多个。
-
这个问题已经在here 讨论过......好吧......三年前......
-
@IronGeek 谢谢我检查了讨论并找到了解决方案。
标签: angularjs json node.js gruntjs