itang / todo.itang.me

4 stars 2 forks source link

熟悉Grunt、Bower和yeoman.io [暂停中] #11

Open itang opened 11 years ago

itang commented 11 years ago

///////////////////////////////////

bower

安装

npm install -g bower

bower常用命令

bower install # from bower.json

bower.json sample:

{
  "name": "AngularJS",
  "devDependencies": {
    "jquery": "1.10.2",
    "lunr.js": "0.4.0",
    "google-code-prettify": "1.0.0",
    "components-font-awesome": "3.1.0",
    "bootstrap": "https://raw.github.com/twbs/bootstrap/v2.0.2/docs/assets/bootstrap.zip",
    "closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
    "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.2/assets/ng-closure-runner.zip"
  },
  "dependencies": {
    "jquery": "~1.7.2",
    "jquery.form": "http://malsup.github.io/min/jquery.form.min.js"
  }
}

bower install jquery

bower not-cached    git://github.com/components/jquery.git#*
bower resolve       git://github.com/components/jquery.git#*
bower download      https://github.com/components/jquery/archive/2.0.3.tar.gz
bower extract       jquery#* archive.tar.gz
bower resolved      git://github.com/components/jquery.git#2.0.3
bower install       jquery#2.0.3

jquery#2.0.3 bower_components/jquery

bower list

bower check-new     Checking for new versions of the project dependencies..
test-bower /home/itang/test/test-bower
├── angular#1.0.8 extraneous (latest is 1.2.0-rc.3)
└── jquery#2.0.3 extraneous

bower list --paths

{
  "angular": "bower_components/angular/angular.js",
  "jquery": "bower_components/jquery/jquery.js"
}

bower search name

bower uninstall package-name

这篇文章可以找到更多的信息: http://chuo.me/2013/02/twitter-bower.html

Grunt

安装

npm install -g grunt-cli

配置

常用任务

常用插件

grunt-dart2js

与Bower配合

简单看yeoman, 起这个作用:)

插件

Yeoman

npm install -g yo

workflow

npm install -g generator-angular  # install generator
yo angular                        # scaffold out a AngularJS project
bower install angular-ui          # install a dependency for your project from Bower
grunt test                        # test your app
grunt server                      # preview your app
grunt                             # build the application for deployment
itang commented 11 years ago

又来了个http://component.io/ web的领域,很多发挥的空间呢