1
0
Fork 0

workaround for index modules

This commit is contained in:
hkernbach 2016-02-09 14:26:30 +01:00
parent 4a972d3f55
commit c205e3236a
1 changed files with 4 additions and 0 deletions

View File

@ -166,6 +166,10 @@ Module.prototype.define = function (path, definition) {
// first get rid of any ".." and "."
path = this.normalise(path);
var match = path.match(/(.+)\/index$/);
if (match) {
path = match[1];
}
// check if you already know the module, return the exports
if (! Module.prototype.moduleCache.hasOwnProperty(path)) {