我已经安装了我的应用程序所需的一些Git,并通过以下操作完成了它:
bower install git://github.com/user/cooltool.git --save
grunt bower-install然后我得到以下错误:
cooltool was not injected in your file.
Please go take a look in "app/bower_components/cooltool" for the file you need, then manually include it in your file.从GitHub回购中直接安装的Bower组件是否总是需要手动添加到我的index.html文件中?如果没有,如何使它正确地包含脚本?
Grunt任务都是yo angular-fullstack脚手架工具的一部分。
gruntfile的bower-install任务如下:
// Automatically inject Bower components into the app
'bower-install': {
app: {
html: '<%= yeoman.app %>/views/index.html',
ignorePath: '<%= yeoman.app %>/',
exclude: ['bootstrap-sass']
}
},最后,我希望在build:js部分中将这个冷却器bower组件的脚本标记注入我的index.html中:
<!-- build:js(app) scripts/vendor.js -->
<!-- bower:js -->
<script ...>
<!-- endbower -->
<!-- endbuild -->运行bower install git://github.com/user/cooltool.git --save后,为它创建了一个Bower目录,该目录的内部是一个(隐藏的) .bower.json文件,而不是一个主bower.json文件:
.bower.json
{
"name": "d3-cloud",
"homepage": "https://github.com/jasondavies/d3-cloud",
"version": "1.0.5",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "83eb4128335eacdc0736ab7a6cafbdc2b124f484"
},
"_source": "https://github.com/jasondavies/d3-cloud.git",
"_target": "~1.0.5",
"_originalSource": "https://github.com/jasondavies/d3-cloud.git"
}发布于 2015-05-14 13:52:51
通常,您将以这样的方式安装一些东西:
bower cache clean
bower install component --save但是,如果添加的回购本身没有为main和bower.json规则建立和忽略,则需要自己添加并签入。
你这样做的方式如下:
1.- Fork the original repository for the component
2.- Add a bower.json file.
3.- Include in this file a
"main": ['path/to/file'],
"ignore":['array','of','things','to','ignore']
3.-bower install your forked git repo, and it will workhttps://stackoverflow.com/questions/30035618
复制相似问题