lib/define.js
function makeRequire(module) {
		var mrequire = function(id, fn) { return require(module, id, fn); };
		mrequire.resolve = function(id) { return getModule(module, id).uri; };
		mrequire.toUrl = function(id) {
			return getModule(module, id.replace(/\.[^.\\\/]+$/, ''))
				.uri.replace(/\.js$/i, id.match(/\.[^.\\\/]+$/));
		};
		mrequire.cache = modules;
		mrequire.main = main;
		mrequire.map = mapUrlToIds; // allow mapping multiple module ids to a url
		return mrequire;
	}
function makeRequire(module) {
		var mrequire = function(id, fn) { return require(module, id, fn); };
		mrequire.resolve = function(id) { return getModule(module, id).uri; };
		mrequire.toUrl = function(id) {
			return getModule(module, id.replace(/\.[^.\\\/]+$/, ''))
				.uri.replace(/\.js$/i, id.match(/\.[^.\\\/]+$/));
		};
		mrequire.cache = modules;
		mrequire.main = main;
		mrequire.map = mapUrlToIds; // allow mapping multiple module ids to a url
		return mrequire;
	}
function makeRequire ( module ) { var mrequire = function ( id , fn ) { return require ( module , id , fn ) ; } ; mrequire . resolve = function ( id ) { return getModule ( module , id ) . uri ; } ; mrequire . toUrl = function ( id ) { return getModule ( module , id . replace ( / \.[^.\\\/]+$ / , '' ) ) . uri . replace ( / \.js$ / i , id . match ( / \.[^.\\\/]+$ / ) ) ; } ; mrequire . cache = modules ; mrequire . main = main ; mrequire . map = mapUrlToIds ; // allow mapping multiple module ids to a url return mrequire ; }
build out the require function specific to the module scope
build out the require function specific to the module scope