Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

"ignore" in Bower's bower.json?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...