From: Jakub Pawlowicz Date: Sun, 15 Mar 2015 16:27:57 +0000 (+0000) Subject: Removes absolute path resolver from tokenizer. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0b3add26314373dcc1dced8e0eb961b388d5bb58;p=clean-css.git Removes absolute path resolver from tokenizer. --- 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())