Skip to content

Commit

Permalink
Merge pull request #250 from cevou/sourcemaps-path
Browse files Browse the repository at this point in the history
Fix file path in source maps
  • Loading branch information
jhnns authored Jun 26, 2016
2 parents ad89943 + e0923ab commit e0ce2b4
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

1 comment on commit e0ce2b4

@aronallen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change broke our server.
It loads assets relative to the source root.
This is a breaking change.

Please sign in to comment.