Skip to content

Commit

Permalink
Fix file path in source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
cevou committed May 27, 2016
1 parent e81fa62 commit e0923ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ module.exports = function (content) {
// deliberately overriding the sourceMap option
// this value is (currently) ignored by libsass when using the data input instead of file input
// however, it is still necessary for correct relative paths in result.map.sources
sassOptions.sourceMap = this.options.output.path + '/sass.map';
sassOptions.sourceMap = this.options.context + '/sass.map';
sassOptions.omitSourceMapUrl = true;

// If sourceMapContents option is not set, set it to true otherwise maps will be empty/null
Expand Down Expand Up @@ -278,7 +278,8 @@ module.exports = function (content) {
result.map.file = resourcePath;
// The first source is 'stdin' according to libsass because we've used the data input
// Now let's override that value with the correct relative path
result.map.sources[0] = path.relative(self.options.output.path, resourcePath);
result.map.sources[0] = path.relative(self.options.context, resourcePath);
result.map.sourceRoot = path.relative(self.options.context, process.cwd());
} else {
result.map = null;
}
Expand Down

0 comments on commit e0923ab

Please sign in to comment.