Skip to content

Commit 57f88e5

Browse files
committed
Don't emit sourcesContent if empty
An empty item might confuse some tools, and it is not required by the spec.
1 parent a61117a commit 57f88e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/source_map.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ namespace Sass {
5050
JsonNode *json_content = json_mkstring(content);
5151
json_append_element(json_contents, json_content);
5252
}
53+
if (json_contents->children.head)
54+
json_append_member(json_srcmap, "sourcesContent", json_contents);
5355
}
54-
json_append_member(json_srcmap, "sourcesContent", json_contents);
5556

5657
string mappings = serialize_mappings();
5758
JsonNode *json_mappings = json_mkstring(mappings.c_str());

0 commit comments

Comments
 (0)