Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ignore" in Bower's bower.json?

Tags:

bower

Bower's website describes the ignore key in bower.json:

ignore [array]: An array of paths not needed in production that you want Bower to ignore when installing your package.

Does this mean that it's ignoring paths in installed components, or in your package? Or something else? I was confused by this.

like image 447
Evan Hahn Avatar asked Aug 15 '13 02:08

Evan Hahn


2 Answers

TL;DR:

ignore only works within the scope of packages being installed, ignoring matching patterns.


Somewhat longer answer:

Bower will ignore all files matching the patterns specified in the ignore property of bower.json in installed packages.

So, suppose if you ran bower install someBowerPackage which had following structure:

someBowerPackage
|- css/
|- js/
|- index.html
|- bower.json

with a bower.json file having:

{
  ...
  "ignore": [ "index.html" ]
}

then, index.html file of this someBowerPackage will not be installed within this package.

like image 134
gustavohenke Avatar answered Nov 06 '22 18:11

gustavohenke


  • ignore is related to the files in your package
  • You can't ignore on behalf of other packages
  • Dependencies are loaded all or none
like image 27
uicoded Avatar answered Nov 06 '22 18:11

uicoded