grunt bower-install of a shimmed bower dependency

Kristian

I've bower installed some Git repo that I need for my application and I did it by doing the following:

bower install git://github.com/user/cooltool.git --save
grunt bower-install

and then I get the following error:

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.

are Bower components that are installed straight from a GitHub repo always required to be manually added to my index.html file? if not, how do I make it include the script correctly?

The Grunt tasks are all part of the yo angular-fullstack scaffolding tool.

The gruntfile's bower-install task is the following:

// Automatically inject Bower components into the app
'bower-install': {
  app: {
    html: '<%= yeoman.app %>/views/index.html',
    ignorePath: '<%= yeoman.app %>/',
    exclude: ['bootstrap-sass']
  }
},

Ultimately, I want the script tag for that cooltool bower component to be injected into my index.html in the Bower build:js section:

<!-- build:js(app) scripts/vendor.js -->
<!-- bower:js -->

    <script ...>

<!-- endbower -->
<!-- endbuild -->

After performing running bower install git://github.com/user/cooltool.git --save, there was a Bower directory created for it, and inside of that directory is a (hidden) .bower.json file, but not a main bower.json file:

.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"
}
Alejandro Teixeira Muñoz

Typically, you'll install something in this way:

bower cache clean
bower install component --save

However, if the added repo itself does not establish and bower.json rules for main and ignore, you'll need to add it yourself and check that in.

You'd do that in the following way:

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 work

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

grunt-bower-install: exclude certain components

From Dev

Trouble configuring grunt bower-install

From Dev

Configure Grunt-Bower-Install path for a Component

From Dev

Configure Grunt-Bower-Install path for a Component

From Dev

grunt bower-install into the php file

From Dev

Trouble configuring grunt bower-install

From Dev

how to force bower to install a certain version of dependency

From Dev

Yeoman bower install vs npm install vs grunt

From Dev

Grunt, Bower and Bootstrap 3

From Dev

Concat bower components with grunt

From Dev

docker with bower, grunt

From Dev

grunt and bower on heroku

From Dev

grunt and bower on heroku

From Dev

docker with bower, grunt

From Dev

grunt-bower-install won't include my css files

From Dev

Yeoman, grunt and bower: is possible to install bootstrap without javascript file?

From Dev

How to use grunt-bower-install to update multiple html files

From Dev

grunt bower-install puts script tags in wrong order

From Dev

Dockerizing npm & bower install using the digitallyseamless/nodejs-bower-grunt docker image

From Dev

Dockerizing npm & bower install using the digitallyseamless/nodejs-bower-grunt docker image

From Dev

Bower override dependency

From Dev

Bower dependency tilde in Node

From Dev

Bower override dependency

From Dev

Yeoman (bower,grunt) - 'SockJS' is not defined

From Dev

grunt-bower-task and Polymer

From Dev

Install CKeditor using Bower

From Dev

Install tweenmax using bower

From Dev

Bower install - failed with ETIMEDOUT

From Dev

EACCES Error with Bower install?