diff --git a/index.js b/index.js index cd37da7..8744a5f 100644 --- a/index.js +++ b/index.js @@ -74,6 +74,7 @@ function requireDirectory(m, path, options) { // hash node key shouldn't include file extension key = filename.substring(0, filename.lastIndexOf('.')); obj = m.require(joined); + obj = obj && obj.default ? obj.default : obj; retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; } }