tminglei / browserify-bower

A browserify plugin, to enable you use bower components just like node modules
MIT License
20 stars 3 forks source link

Please add more detail in documentation #6

Closed duongphuhiep closed 9 years ago

duongphuhiep commented 9 years ago
b.plugin('browserify-bower', {
    require: ['*', 'base62/lib/base62'],
    external: {
        exclude: ['comp1', 'comp2']
    },
    alias: ['base62/lib/base62:base62'], // or alias: { 'base62/lib/base62':'base62', ... } 
    mainfiles: { // specify the main file for packages without a bower.json 
        'base62': 'main.js'
    }
});

Can you please explain what happens here? 1) What is the different between require and external? which case use which? 2) alias can only be used in the mainfiles section, or it can also be used in require, external and exclude section? 3) Do you have any project sample using browserify-bower (with gulp if possible)? 4) what is the advantages of browserify-bower over

"browser": {
  "angular": "./bower_components/angular/angular.js",
  "angular-resource": "./bower_components/angular-resource/angular-resource.js"
},
"browserify-shim": {
  "angular": {
    "exports": "angular"
  },
  "angular-resource": {
    "depends": ["./bower_components/angular/angular.js:angular"]
  }
},
tminglei commented 9 years ago

Hi @duongphuhiep, I updated the README guide, you can help check it.

browserify-bower is target to bower, so you needn't specify bower home and dependencies, it can detect it for you. You can simply use the names.

duongphuhiep commented 9 years ago

It is better now! thank you

tminglei commented 9 years ago

np ;)