From 0b3add26314373dcc1dced8e0eb961b388d5bb58 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Sun, 15 Mar 2015 16:27:57 +0000 Subject: [PATCH] Removes absolute path resolver from tokenizer. --- lib/selectors/tokenizer.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/selectors/tokenizer.js b/lib/selectors/tokenizer.js index c5acc518..cbe5e526 100644 --- a/lib/selectors/tokenizer.js +++ b/lib/selectors/tokenizer.js @@ -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()) -- 2.34.1