Removes absolute path resolver from tokenizer.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 15 Mar 2015 16:27:57 +0000 (16:27 +0000)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 15 Mar 2015 16:27:57 +0000 (16:27 +0000)
lib/selectors/tokenizer.js

index c5acc51..cbe5e52 100644 (file)
@@ -34,22 +34,12 @@ Tokenizer.prototype.toTokens = function (data) {
     source: undefined
   };
 
-  if (this.minifyContext.options.explicitRoot)
-    context.resolvePath = absolutePathResolver(context);
-  else if (this.minifyContext.options.target)
+  if (this.minifyContext.options.target)
     context.resolvePath = relativePathResolver(context);
 
   return tokenize(context);
 };
 
-function absolutePathResolver(context) {
-  var rebaseTo = path.resolve(context.outer.options.root);
-
-  return function (_, sourcePath) {
-    return sourcePath.replace(rebaseTo, '');
-  };
-}
-
 function relativePathResolver(context) {
   var rebaseTo = path.resolve(context.outer.options.root, context.outer.options.target);
   if (!fs.existsSync(rebaseTo) || fs.statSync(rebaseTo).isFile())