From 0917ed39f8ce05875051fbeb3c72706827e7ac02 Mon Sep 17 00:00:00 2001 From: Ben Daley Date: Sat, 23 May 2015 12:00:34 +1000 Subject: [PATCH] If sourceMap option is set, automatically set sourceMapContents option by default. --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 0788a663..6d75542e 100644 --- a/index.js +++ b/index.js @@ -127,6 +127,12 @@ module.exports = function (content) { // 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 opt.sourceMap = this.options.output.path + '/sass.map'; + + // If sourceMapContents option is not set, set it to true otherwise maps will be empty/null + // when exported by webpack-extract-text-plugin. + if (!opt.hasOwnProperty('sourceMapContents') ) { + opt.sourceMapContents = true; + } } // indentedSyntax is a boolean flag