Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Created October 7, 2010 20:44
Show Gist options
  • Save kriszyp/615846 to your computer and use it in GitHub Desktop.
Save kriszyp/615846 to your computer and use it in GitHub Desktop.
require.def("uses-foo",["has!node:./node/foo,svg:./svg/foo,./default/foo"],function(foo){
foo.bar();
});
var has = require("require/has");
var foo = require(has.node ? "./node/foo" :
has.svg ? "./svg/foo" : "./default/foo");
foo.bar();
@deanlandolt
Copy link

what would the require/has module look like? is that were all the ugly engine checks go? i'm especially keen on this idea now that i know there are at least two implementations (ringo + GPSEE) that can't support a "../engines/" setup

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