Skip to content

Commit

Permalink
Include sourceMapContents by default if sourceMaps are wanted
Browse files Browse the repository at this point in the history
This way the developer does not have to map the local path inside Chrome, because the contents are delivered directly with the sourceMap.
  • Loading branch information
jhnns committed Aug 3, 2015
1 parent bddc1a0 commit 0e043c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = {
};
```

If you want to view the original Sass files inside Chrome and even edit it, [there's a good blog post](https://medium.com/@toolmantim/getting-started-with-css-sourcemaps-and-in-browser-sass-editing-b4daab987fb0). Checkout [test/sourceMap](https://github.com/jtangelder/sass-loader/tree/master/test) for a running example. Make sure to serve the content with an HTTP server.
If you want to edit the original Sass files inside Chrome, [there's a good blog post](https://medium.com/@toolmantim/getting-started-with-css-sourcemaps-and-in-browser-sass-editing-b4daab987fb0). Checkout [test/sourceMap](https://github.com/jtangelder/sass-loader/tree/master/test) for a running example. Make sure to serve the content with an HTTP server.

## License

Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ module.exports = function (content) {
// however, it is still necessary for correct relative paths in result.map.sources
opt.sourceMap = this.options.output.path + '/sass.map';
opt.omitSourceMapUrl = true;

// If sourceMapContents option is not set, set it to true otherwise maps will be empty/null
// when exported by webpack-extract-text-plugin.
if ('sourceMapContents' in opt === false) {
opt.sourceMapContents = true;
}
}

// indentedSyntax is a boolean flag
Expand Down

0 comments on commit 0e043c6

Please sign in to comment.