-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add getCombinedSourceMap in transform plugin context (#2983) #2993
Conversation
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.
Awesome for looking into this! Did you already try if this works to generate proper instrumentation for coverage? I will probably not have time today for actually running your code but I hope we can merge this soon. Just some stylistic remarks you may or may not address.
I have tested it with |
Here is the test configuration:
|
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.
Finally managed to get it to run with Mocha and nyc (pro tip: By default, nyc does not like "ts" extensions...). Works really well!
One last thing I noticed: The spelling of "SourceMap" in the context function differs from our spelling of "Sourcemap" in all options so I would like to change the name of the function to "getCombinedSourcemap".
I will fix it asap |
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.
👍
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #2983
Description
Add
this.getCombinedSourceMap() => SourceMap
in transform plugin contextWhen the sourcemap chain is not not empty, replace the original source map with the combined source source map and clear the sourcemap chain
Refactor
collapseSourcemaps