tobie/module-grapher — Issue #10: Support packages with accurate 'main' values
Author: CGamesPlay
Created: 2012-02-26 23:59:34+00:00
State: open

Node modules have a package.json with a 'main' value that points to the main file in a module. module-grapher does not understand this, and assumes that the filename is a directory.

If the empty string was added as a valid extension, this problem goes away.

diff --git i/lib/src-resolver.js w/lib/src-resolver.js
index 38dbd85..34dd468 100644
--- i/lib/src-resolver.js
+++ w/lib/src-resolver.js
@@ -21,7 +21,7 @@ function SrcResolver(config) {
function normalizeConfig(input) {
input = input || {};
var output = {},
- exts = input.extensions || ['.js', '.coffee'];
+ exts = input.extensions || ['', '.js', '.coffee'];

for (var prop in input) {
output[prop] = input[prop];
@@ -36,7 +36,7 @@ function SrcResolver(config) {

p.normalizeExtensions = normalizeExtensions;
function normalizeExtensions(extensions) {
- return extensions.map(pathHelpers.normalizeExt);
+ return extensions;//.map(pathHelpers.normalizeExt);
}