Simplifies resolving paths in source map stringifier.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sat, 29 Nov 2014 23:54:20 +0000 (23:54 +0000)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Mon, 8 Dec 2014 09:39:15 +0000 (09:39 +0000)
lib/selectors/source-map-stringifier.js

index e8b9ba7..8ca43ba 100644 (file)
@@ -10,7 +10,6 @@ function Rebuilder(options, restoreCallback, inputMapTracker) {
   this.line = 1;
   this.output = [];
   this.keepBreaks = options.keepBreaks;
-  this.relativeTo = options.relativeTo;
   this.restore = restoreCallback;
   this.inputMapTracker = inputMapTracker;
   this.outputMap = new SourceMapGenerator();
@@ -32,9 +31,7 @@ Rebuilder.prototype.relativePathResolver = function (sourcePath, sourceRelativeT
   if (sourceRelativeTo)
     sourcePath = path.resolve(path.dirname(sourceRelativeTo), sourcePath);
 
-  return path.normalize(sourcePath) === path.resolve(sourcePath) ?
-    path.relative(this.rebaseTo, sourcePath) :
-    path.relative(this.rebaseTo, path.join(this.relativeTo, sourcePath));
+  return path.relative(this.rebaseTo, sourcePath);
 };
 
 Rebuilder.prototype.rebuildValue = function (list, separator) {