Skip to content

Commit

Permalink
Fix URL rebase (fixes mariocasciaro#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 26, 2016
1 parent c417176 commit f25378d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ module.exports = function(destFile, options) {
return url;
}

var resourceAbsUrl = path.relative(commonBase, path.resolve(path.dirname(file), url));
resourceAbsUrl = path.relative(destDir, resourceAbsUrl);
var resourceAbsUrl = path.relative(
path.resolve(commonBase, destDir),
path.resolve(path.dirname(file), url)
);
//not all systems use forward slash as path separator
//this is required by urls.
if(path.sep === '\\'){
Expand Down

0 comments on commit f25378d

Please sign in to comment.