Skip to content
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

Resolve sources relative to the source map #4

Closed
wants to merge 1 commit into from

Conversation

floridoo
Copy link

From Source Map Revision 3: Resolving Sources

If the sources are not absolute URLs after prepending of the
“sourceRoot”, the sources are resolved relative to the SourceMap (like
resolving script src in a html document).

Source Map Revision 3: Resolving Sources
If the sources are not absolute URLs after prepending of the
“sourceRoot”, the sources are resolved relative to the SourceMap (like
resolving script src in a html document).
@evanw evanw closed this in 0370316 Apr 25, 2013
@evanw
Copy link
Owner

evanw commented Apr 25, 2013

This is great, thanks!

return sourceMap ? sourceMap.originalPositionFor(position) : position;
if (sourceMap) {
var originalPosition = sourceMap[1].originalPositionFor(position);
originalPosition.source = path.resolve(path.dirname(sourceMap[0]), originalPosition.source)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants