Created
September 25, 2015 01:54
-
-
Save siroky/9429bab1bb825a81459c to your computer and use it in GitHub Desktop.
This file contains 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 context = require.context('./Scripts/Sources/', true, /^\.\/.*\.js$/); | |
var _ = require('underscore'); | |
window.require = function (m, callback) { | |
if (_.isFunction(callback)) { | |
if (_.isArray(m)) { | |
callback(_.map(m, window.require)); | |
} else { | |
callback(window.require(m)); | |
} | |
} else { | |
return context('./' + m + '.js'); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment