下载

Bower 需要 Node, npm, Git 的支持

1
$ npm install -g bower

macOS

1
$ brew install bower

用法

下载包

1
2
3
4
5
6
7
8
9
10
# installs the project dependencies listed in bower.json
bower install
# registered package
bower install jquery
# GitHub shorthand
bower install desandro/masonry
# Git endpoint
bower install git://github.com/user/package.git
# URL
bower install http://example.com/script.js

搜索

1
$ bower search jquery

保存包

1
2
$ bower init
$ bower install jquery --save

使用

1
<script src="bower_components/jquery/dist/jquery.min.js"></script>

卸载

1
$ bower uninstall
03-17 02:20