UNPKG

688 BJavaScriptView Raw
1"use strict";
2
3module.exports = function (item) {
4 var content = item[1];
5 var cssMapping = item[3];
6
7 if (!cssMapping) {
8 return content;
9 }
10
11 if (typeof btoa === "function") {
12 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
13 var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
14 var sourceMapping = "/*# ".concat(data, " */");
15 var sourceURLs = cssMapping.sources.map(function (source) {
16 return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */");
17 });
18 return [content].concat(sourceURLs).concat([sourceMapping]).join("\n");
19 }
20
21 return [content].join("\n");
22};
\No newline at end of file