Skip to content

Improve detection of minified source files #1519

Description

@loewenheim

The code that determines if a source file that has been added to a SourceMapProcessor is minified is here. It checks

  1. if the file name contains the substring ".min."
  2. if the file contains a debug id or source mapping URL
  3. a bunch of heuristics based on code shape and whatnot.

Another reason to consider a file minified might be if it has a sourcemap in the "obvious" location (i.e. a sibling file with same file name, but the extension .map). We already have logic for finding such a sourcemap in the form of the guess_sourcemap_reference function, but that function refers to the SourceMapProcessor's internal list of sourcemaps—something we can't rely on until we're finished with adding files.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions