Closed
Description
It's possible that a source file may contain the string "sourceMappingURL=" in the source (not part of the source map). For example, if we were to parse the source code for parseHookNames
, the regex / ?sourceMappingURL=([^\s'"]+)/gm
would match itself.
We should have some logic in place for filtering out invalid matches like this. I think the rule should be:
- Multiple inline source maps may appear in a file/bundle. Logic exists to parse these and compare the
sources
field to the parsed error file name. (This case is fine.) - If we're dealing with external source maps though, only look at the last one (at the end of the file).