-
Notifications
You must be signed in to change notification settings - Fork 224
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 support for runtime inline source maps #118
Conversation
This allows the user to control the source map output post instrumentation. Not fully straightforward right now, but when combined with a fork of source-map-support that has inline support (or placing the files in the proper location), end to end covered source maps can be achieved. For runtime source-map-support, see evanw/node-source-map-support#118. Will be forking to @kpdecker/source-map-support soon, since the canonical project appears to be dead.
@evanw just bumping this issue, would love to add this functionality to IstanbulJS/nyc. |
This looks good to me, could you please add some documentation and then we could merge :) |
@LinusU added docs and also refactored the installed flag to make it global to avoid conflicts if multiple versions are loaded. |
Any idea why Travis is failing? |
Looks like it's a slight variation in the text formatting between node versions. I'll make the regex more relaxed. |
Actually, it looks like a frame is removed in Node 6.7 (or earlier) which makes the test puke on master as well. Seems like removing the test is the easiest way to handle since maintaining it across multiple Node versions sounds painful. |
Adds the hookRequire option which monkey patches _compile to support require extension hooks that use inline source maps. This is necessary because the default retrieveFile implementations point to the original source file when doing runtime transpilation and thus don’t have the source map attached.
This fixes relative url mapping for inline source maps.
This is not consistent across different Node versions.
52e78fa
to
f273530
Compare
Rebased and simplified the test to avoid the environment dependent behavior. |
Thank you for this! |
Published as 0.4.4 |
Thanks! |
This allows the user to control the source map output post instrumentation. Not fully straightforward right now, but when combined with a fork of source-map-support that has inline support (or placing the files in the proper location), end to end covered source maps can be achieved. For runtime source-map-support, see evanw/node-source-map-support#118. Will be forking to @kpdecker/source-map-support soon, since the canonical project appears to be dead.
@kpdecker do you remember (6 years later!) why you opted to It sets |
Adds the hookRequire option which monkey patches _compile to support require extension hooks that use inline source maps. This is necessary because the default retrieveFile implementations point to the original source file when doing runtime transpilation and thus don’t have the source map attached.