Skip to content

Commit 0e043c6

Browse files
committed
Include sourceMapContents by default if sourceMaps are wanted
This way the developer does not have to map the local path inside Chrome, because the contents are delivered directly with the sourceMap.
1 parent bddc1a0 commit 0e043c6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module.exports = {
131131
};
132132
```
133133

134-
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.
134+
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.
135135

136136
## License
137137

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ module.exports = function (content) {
135135
// however, it is still necessary for correct relative paths in result.map.sources
136136
opt.sourceMap = this.options.output.path + '/sass.map';
137137
opt.omitSourceMapUrl = true;
138+
139+
// If sourceMapContents option is not set, set it to true otherwise maps will be empty/null
140+
// when exported by webpack-extract-text-plugin.
141+
if ('sourceMapContents' in opt === false) {
142+
opt.sourceMapContents = true;
143+
}
138144
}
139145

140146
// indentedSyntax is a boolean flag

0 commit comments

Comments
 (0)