From 994293e97229110f676dc72ad68b6b2d8a015394 Mon Sep 17 00:00:00 2001 From: Jimb Esser Date: Mon, 18 Jan 2021 15:44:24 -0800 Subject: Fix overwriting existing sourcesContent in sourcemaps (#4567) --- lib/sourcemap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/sourcemap.js') diff --git a/lib/sourcemap.js b/lib/sourcemap.js index c2587c88..94966a6a 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -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({ -- cgit v1.2.3