From db7566d27c0eb924a3d967462c8cc76df8c741a9 Mon Sep 17 00:00:00 2001 From: gustaff-weldon Date: Thu, 28 Feb 2013 10:55:01 +0100 Subject: [PATCH] fixed bug with cache entries being overwritten when 'module' was registered under 'module/index' --- src/stitch.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stitch.coffee b/src/stitch.coffee index cecca07..9fe5694 100644 --- a/src/stitch.coffee +++ b/src/stitch.coffee @@ -61,7 +61,7 @@ exports.Package = class Package (function(/*! Stitch !*/) { if (!this.#{@identifier}) { var modules = {}, cache = {}, require = function(name, root) { - var path = expand(root, name), module = cache[path], fn; + var path = expand(root, name), module = cache[path] || cache[expand(path, './index')], fn; if (module) { return module.exports; } else if (fn = modules[path] || modules[path = expand(path, './index')]) {