diff --git a/addStyles.js b/addStyles.js index c81451da..7b36f260 100644 --- a/addStyles.js +++ b/addStyles.js @@ -171,12 +171,17 @@ function attachTagAttrs(element, attrs) { function addStyle(obj, options) { var styleElement, update, remove; + if (obj.sourceMap && typeof options.sourceRoot === "string") { + obj.sourceMap.sourceRoot = options.sourceRoot; + } + if (options.singleton) { var styleIndex = singletonCounter++; styleElement = singletonElement || (singletonElement = createStyleElement(options)); update = applyToSingletonTag.bind(null, styleElement, styleIndex, false); remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true); } else if(obj.sourceMap && + options.sourceMap !== false && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" &&