Skip to content

Commit f952605

Browse files
fix(sourcemaps): Avoid associating only sourcemap with all minified sources
Remove the branch from `guess_sourcemap_reference` which handles the case of there only being one sourcemap. If there are multiple minified souces, they would all (erroneously) end up associated with the same single sourcemap. Fixes #2438
1 parent c30b264 commit f952605

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/utils/sourcemaps.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,6 @@ fn guess_sourcemap_reference(
111111
sourcemaps: &HashSet<String>,
112112
min_url: &str,
113113
) -> Result<SourceMapReference> {
114-
// if there is only one sourcemap in total we just assume that's the one.
115-
// We just need to make sure that we fix up the reference if we need to
116-
// (eg: ~/ -> /).
117-
if sourcemaps.len() == 1 {
118-
let original_url = sourcemaps.iter().next().unwrap();
119-
return Ok(SourceMapReference {
120-
url: sourcemap::make_relative_path(min_url, original_url),
121-
original_url: Option::from(original_url.to_string()),
122-
});
123-
}
124-
125114
let map_ext = "map";
126115
let (path, basename, ext) = split_url(min_url);
127116

0 commit comments

Comments
 (0)