-
Notifications
You must be signed in to change notification settings - Fork 225
Find the *last* sourceMappingURL in the source document. #48
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
Conversation
@evanw ping? |
I am no source map expert but I believe source maps can be specified anywhere in code and can perfectly be defined at the top of the file. Is #58 enough for your issue? |
9766df8
to
3f56d90
Compare
@julien-f this actually supports having multiple source mapping URLs in one file, it just changes the behaviour to always use the last one. As transpilers usually append a source mapping URL at the end of the file, the last mapping URL is much more likely to be the right one to use. So I think this change is still useful. The change to not find quotes might be correct (though I'm not sure quotes need to be escaped in URIs/URLs) and help, but if somebody has code handling e.g. |
It makes sense. I think it should be mentioned in the README and maybe we should update the examples to have the directive at the end? |
@julien-f done, please take another look. |
LGTM but I don't understand the test: I see only one source map directive, am I missing something? |
This fixes odd behaviour for source files that contain the literal string '//# sourceMappingURL=' somewhere in the actual source code.
Added a clarifying comment - the test driver function actually adds the secondary sourceMappingURL comment. |
Thanks for the review, merging this now. |
f4f1638
to
e6e77ab
Compare
This fixes odd behaviour for source files that contain the literal string
'//# sourceMappingURL=' somewhere in the actual source code.