-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Handling source maps without sourcesContent
#15445
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53994/ |
@@ -58,7 +58,7 @@ export default class SourceMap { | |||
setSourceContent( | |||
map, | |||
resolvedSources[i], | |||
this._inputMap.sourcesContent[i], | |||
this._inputMap.sourcesContent?.[i], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We can skip this full loop if there's no sourcesContent
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect sources
? At first I skipped the whole loop, but then I'm not sure if sources
will be preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of eagerly adding all sources, it'll only adds source as they are marked. It's not important to keep a source that was input if that source is never seen in the map, but setting a sourcesContent
forces it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
ref: #15022
@nicolo-ribaudo @JLHwung This seems to be a regression affecting quite a few people, let's release a patch, thanks!