Skip to content

Instantly share code, notes, and snippets.

@fjakobs
Created September 28, 2010 05:27
Show Gist options
  • Save fjakobs/600456 to your computer and use it in GitHub Desktop.
Save fjakobs/600456 to your computer and use it in GitHub Desktop.
if (!require.def) require.def = require("requireJS-node")(module);
require.def("project/foo", ["project/bar"], function(oop) {
// ...
});
module.exports = function(module) {
return function(name, deps, callback) {
if (!callback) {
callback = deps;
deps = [];
}
var modules = deps.map(function(dep) {
return require(dep);
});
module.exports = callback.apply(this, modules);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment