Skip to content

Ensure collect_sourcemap_references does not associate the same sourcemap with multiple source files #2445

@szokeasaurusrex

Description

@szokeasaurusrex

collect_sourcemap_references can in some cases associate the same sourcemap with multiple source files, which should not happen. One of these cases will be addressed in #2438; here we should add additional logic to ensure we don't guess the same sourcemap is associated with more than one minified source.

We will do this as follows:

  • Do two passes over the minified sources. First, we pass over all of the sources with source mapping URLs, then we pass over all of the sources without source mapping URLs
  • As we identify sourcemaps, remove them from the set of sourcemaps that have not been associated with a source yet, so that we cannot add the same sourcemap to multiple files (this applies when guessing the sourcemap references; if two minified sources contain the same source mapping URL, we will associate both sources with the same sourcemap)

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions