Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
support json resolves (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 30, 2015
1 parent 5981f83 commit 5d9c33a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion npm.js
Expand Up @@ -595,7 +595,7 @@ NPMLocation.prototype = {
// run the NodeJS resolver, to know which file we should get
else if (!pjson.dependencies[firstPart]) {
try {
var resolved = npmResolve.sync(dep, { basedir: path.dirname(file) }).replace(/\\/g, '/');
var resolved = npmResolve.sync(dep, { basedir: path.dirname(file), extensions: ['.js', '.json'] }).replace(/\\/g, '/');
dep = path.relative(path.dirname(file), resolved);
if (dep.substr(0, 1) != '.')
dep = './' + dep;
Expand Down

0 comments on commit 5d9c33a

Please sign in to comment.