From 5657c0c4adb6393758694864310be3cbac6ff5de Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Wed, 26 Oct 2016 17:45:48 +0200 Subject: [PATCH] Fix URL rebase (fixes #39) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 651f207..33466e4 100644 --- a/index.js +++ b/index.js @@ -39,7 +39,7 @@ module.exports = function(destFile, options) { } var resourceAbsUrl = path.relative(commonBase, path.resolve(path.dirname(file), url)); - resourceAbsUrl = path.relative(destDir, resourceAbsUrl); + resourceAbsUrl = path.relative(path.resolve(commonBase, destDir), path.resolve(commonBase, resourceAbsUrl)); //not all systems use forward slash as path separator //this is required by urls. if(path.sep === '\\'){