browserify-shim-dependency
v0.0.2
Published
easier way to create dependencies for browserify-shim
Downloads
3
Readme
browserify-shim-dependency
###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