Skip to content

前端组件安装整理

qloog edited this page Jul 27, 2015 · 6 revisions

bower

1. 新建 .bowerrc文件

{
    "directory": "resources/assets/bower"
}

2. 生成bower.json

bower init 然后一路默认即可,最后生成的文件内容大概如下:

{
  "name": "laravel5-wechat",
  "version": "0.0.0",
  "authors": [
    "qloog <[email protected]>"
  ],
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "bootstrap-sass-official": "~3.3.4",
    "jquery": "~2.1.4",
    "bootstrap": "~3.3.4"
  }
}

3. 安装组件

$ bower install jquery --save  
$ bower install bootstrap --save  
$ bower install fontawesome --save  
$ bower install datatables --save
$ bower install datatables-plugins --save 

PS:

  1. (We’re adding datatables-plugins in order to use bootstrap specific styles in DataTables.)
  2. To get the latest versions of any of your bower dependencies, simply run the bower update command from the root directory

4. 参考:

  1. https://mattstauffer.co/blog/convert-laravel-5-frontend-scaffold-to-bower
  2. http://laravel-tricks.com/tricks/use-sass-instead-of-less-laravel-5
  3. Laravel 5.1 Beauty - Using Bower

gulp

组件安装

npm install gulp-rename --save