diff --git a/index.js b/index.js index 6684064..c7b8a1c 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,5 @@ var fs = require('fs'); var path = require('path'); -var relativePath = require('cached-path-relative') - var browserResolve = require('browser-resolve'); var nodeResolve = require('resolve'); var detective = require('detective'); @@ -12,6 +10,7 @@ var combine = require('stream-combiner2'); var duplexer = require('duplexer2'); var xtend = require('xtend'); var defined = require('defined'); +var relativePathCache = {}; var inherits = require('inherits'); var Transform = require('readable-stream').Transform; @@ -562,3 +561,9 @@ function wrapTransform (tr) { tr.on('error', function (err) { wrapper.emit('error', err) }); return wrapper; } + +function relativePath (from, to) { + var key = from + to; + return relativePathCache[key] || + (relativePathCache[key] = path.relative(from, to)); +} diff --git a/package.json b/package.json index 43a7bec..3400cd4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "dependencies": { "JSONStream": "^1.0.3", "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", "concat-stream": "~1.5.0", "defined": "^1.0.0", "detective": "^4.0.0",