browserify-shim-dependency

0.0.2 • Public • Published

browserify-shim-dependency

Dependencies  Dependencies  Build Status

About:

Dependency initialization in browserfy-shim is very terse and repetitive. This library aim to help eliminate that.

In short a shim definition like

obj = JSON.parse('{
  "../../app/components/jquery/dist/jquery.js" : {"exports" :  "$" },
  "../../app/components/bootstrap/dist/bootstrap.js" : {"exports" : "bootstrap" },
  "../../app/components/angular/angular.js" : {"exports" : "angular", "depends" : { "../../app/components/jquery/dist/jquery.js" : {"exports" : "$" }}}
}')

becomes..

bower = '../../app/components/'
$ = new dep "#{bower}jquery/dist/jquery.js", '$'
bootstrap = new dep "#{bower}bootstrap/dist/bootstrap.js", 'bootstrap'
angular = new dep("#{bower}angular/angular.js", 'angular').dependsOn $

dependencies = $.combine [bootstrap, angular] #or dep.combine [$,bootstrap, angular]

where

dependencies == obj

To use pull in via npm or bower.

npm install --save-dev browserify-shim-dependency
bower install --save browserify-shim-dependency

Readme

Keywords

none

Package Sidebar

Install

npm i browserify-shim-dependency

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • nmccready