bower install take repo, not specific files in main

匆匆过客 提交于 2019-12-05 17:59:06

Yes, this is how Bower is meant to work. Bower-installer looks like a more lightweight solution than Grunt to solve the exact requirement you're describing and get just the files you need to be deployed to production.

Yes, that's how Bower works.

It always look for the matching tag on the repo; if cannot find one, it goes with the default branch, and download it.

The unique usage I've seen so far for the main property of a bower.json file is for integration, for example with build tools, like Grunt (there are lots of other bower related tasks, just Google around) and others.

This is a common misconception.

As stated in Bower documentation, the main property is a string/array listing the primary endpoints of your package.

Bower package maintainers (and maybe users, using the overrides property) can use the ignore property, which is an array of paths not needed in production that you want Bower to ignore when installing your package.

Example:

{
  "name": "stackoverflow",
  "version": "1.0.0",
  "ignore": [
    "test/**",
    ".jshintrc"
  ],
  "dependencies": {
    "foo": "~1.1"
  }
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!