简体   繁体   English

创建凉亭组件并注入index.html

[英]Create bower component and inject into index.html

I'm creating my first bower component and im having some issues. 我正在创建我的第一个Bower组件,并且我遇到了一些问题。

Hhere is my component - https://github.com/yuvalsaraf/bower-component and I've already registered it with bower with the name 'bower-component' (I'll delete it after I will create my first bower component successfully). 我的组件在这里-https: //github.com/yuvalsaraf/bower-component ,我已经在Bower中注册了名称为'bower-component'的组件(我将在成功创建第一个Bower组件后删除它)。

I'm having two problems - 我有两个问题-

  1. Even though I specified the main files only to be - one JS file, one CSS file, and one GIF file, it still downloads index.html to the user downloading the component. 即使我将主要文件指定为-一个JS文件,一个CSS文件和一个GIF文件,它仍然会将index.html下载给下载该组件的用户。

  2. The JS and the CSS files are not injected into my index.html file (on grunt bowerInstall command). JS和CSS文件没有注入到我的index.html文件中(在grunt bowerInstall命令上)。 I added a dependency to jQuery and it is injected fine. 我向jQuery添加了一个依赖项,并且注入良好。

Please check the repo and tell me what I'm doing wrong.. Thanks in advance! 请检查仓库,并告诉我我在做什么错..预先感谢!

bower info bower-component

returns "No versions available.". 返回“没有可用的版本”。 This is signal that you haven't use git tags in proper way. 这表明您没有以适当的方式使用git标签

You must create some tags, eg 您必须创建一些标签,例如

git tag -a v0.0.1 -m "Release version 0.0.1"

Then push it to remote repository (origin?) 然后将其推送到远程存储库(来源?)

git push --tags

To filter unnecessary files use ignore array 要过滤不必要的文件,请使用ignore array

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM