Fix overwriting existing sourcesContent in sourcemaps (#4567)

This commit is contained in:
Jimb Esser
2021-01-18 15:44:24 -08:00
committed by GitHub
parent b57bae4b9e
commit 994293e972
2 changed files with 36 additions and 1 deletions

View File

@@ -144,7 +144,9 @@ function SourceMap(options) {
add(source, gen_line, gen_col, orig_line, orig_col, name);
} : add,
setSourceContent: sources_content ? function(source, content) {
sources_content[source] = content;
if (!(source in sources_content)) {
sources_content[source] = content;
}
} : noop,
toString: function() {
return JSON.stringify({