Created
October 7, 2010 20:44
-
-
Save kriszyp/615846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.def("uses-foo",["has!node:./node/foo,svg:./svg/foo,./default/foo"],function(foo){ | |
foo.bar(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var has = require("require/has"); | |
var foo = require(has.node ? "./node/foo" : | |
has.svg ? "./svg/foo" : "./default/foo"); | |
foo.bar(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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