bower详细教程

来源:互联网 发布:共产主义社会 知乎 编辑:程序博客网 时间:2024/06/10 22:15

接着上次的bower介绍

1. bower install jquery       不带--save表示只会下载响应的包,不会在bower.json里面写入你的包的信息   2. bower install jquery --save       带着--save 会自动的把包的一些信息写入到bower.json中,如果你写配置文件比较厉害的话,使用第一种,如果不然还是第二种最好   3. 若bower没有收录,则找到该类库的github的插件     将LIB_NAME名替换成该地址,并将开头的http改为git,使用bower install --save git://...   4.  如果想升级bower的话cnpm update bower    5. bower -help 的命令       - cache:bower缓存管理    - help:显示Bower命令的帮助信息    - home:通过浏览器打开一个包的github发布页    - info:查看包的信息    - init:创建bower.json文件    - install:安装包到项目    - link:在本地bower库建立一个项目链接    - list:列出项目已安装的包    - lookup:根据包名查询包的URL    - prune:删除项目无关的包    - register:注册一个包    - search:搜索包    - update:更新项目的包    - uninstall:删除项目的包6. bower init 更详细的输入         zhangzhi@moke:~/code/test/static$ bower init    ? name: test    ? version: 0.1.1    ? description:    ? main file: main.js    ? what types of modules does this package expose? (Press <space>? what types of modules does this package expose?    ? keywords:    ? authors: zhangzhi <zzhi.net@gmail.com>    ? license: MIT    ? homepage:    ? set currently installed components as dependencies? Yes    ? add commonly ignored files to ignore list? Yes    ? would you like to mark this package as private which prevents ? would you like to mark this package as private which prevents it from being accidentally published to the registry? No    {      name: 'test',      version: '0.1.1',      authors: [        'zhangzhi <zzhi.net@gmail.com>'      ],      main: 'main.js',      license: 'MIT',      ignore: [        '**/.*',        'node_modules',        'bower_components',        'app/bower_components',        'test',        'tests'      ]    }    ? Looks good? Yes    7. 查看包的依赖          通过 bower list 查看依赖关系 
0 0
原创粉丝点击