module-deps
Advanced tools
Comparing version 0.9.0 to 0.10.0
18
index.js
@@ -56,3 +56,11 @@ var fs = require('fs'); | ||
resolve(id, parent, function (err, file) { | ||
var resolver = opts.cache && typeof opts.cache[parent.id] === 'object' | ||
&& opts.cache[parent.id].deps[id] | ||
? function (xid, xparent, cb) { | ||
cb(null, opts.cache[parent.id].deps[id]); | ||
} | ||
: resolve; | ||
; | ||
resolver(id, parent, function (err, file) { | ||
if (err) return output.emit('error', err); | ||
@@ -71,3 +79,3 @@ if (!file) return output.emit('error', new Error([ | ||
if (cache && cache[file]) { | ||
applyTransforms(file, trx, cache[file]); | ||
parseDeps(file, cache[file]); | ||
} | ||
@@ -110,3 +118,7 @@ else fs.readFile(file, 'utf8', function (err, src) { | ||
var deps; | ||
if (opts.noParse && opts.noParse.indexOf(file) >= 0) { | ||
if (typeof src === 'object') { | ||
deps = Object.keys(src.deps); | ||
src = src.source; | ||
} | ||
else if (opts.noParse && opts.noParse.indexOf(file) >= 0) { | ||
deps = []; | ||
@@ -113,0 +125,0 @@ } |
{ | ||
"name": "module-deps", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "walk the dependency graph to generate json output that can be fed into browser-pack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21142
446
138