Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created November 14, 2011 18:50
Show Gist options
  • Save jiggliemon/1364743 to your computer and use it in GitHub Desktop.
Save jiggliemon/1364743 to your computer and use it in GitHub Desktop.
Library dependencies.
// Defined in Framework
// Uses Mootools
define(['./localFile','Milk/core/Class'], function(local, Class) {
...
});
// Defined in `Framework`
// Uses both Mootools and Polyfills
define(['./localFile','../../lib/Milk/core/Class', 'Polyfills/Array/Array.isArray'], function(local, Class) {
...
});
require({
packages: [
{
name: 'Poly'
,location: '/js/lib/Polyfills/Source'
}
{
name: 'Mootools'
,location: '/js/lib/Milk/Source'
}
,{
name: 'Framework'
// this framework names Mootools as Milk
// and Polyfills as Polyfills
,location: '/js/lib/Other/Framework'
}
,{
name: 'App'
,location: '/js/app/'
}
]
,callback: function () {
//.. make shit happen
}
})
@unscriptable
Copy link

It's a complex problem for sure. Devs want to configure their apps and/or frameworks in all sorts of crazy ways. To my knowledge, @cadorn is the only one who's come up with a way to handle all (sane) use cases (via Package/Mappings/C) in BravoJs/PINF, including the ones you've described, @arian. https://github.com/cadorn/pinf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment