-
Notifications
You must be signed in to change notification settings - Fork 362
Add a third parameter to SourceNode.fromStringWithSourceMap
#105
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
I use this PR in source-map-concat. |
@@ -116,6 +118,9 @@ define(function (require, exports, module) { | |||
aSourceMapConsumer.sources.forEach(function (sourceFile) { | |||
var content = aSourceMapConsumer.sourceContentFor(sourceFile); | |||
if (content) { | |||
if (aRelativePath) { |
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.
Same as how I commented in the other PR, this should probably be:
if (aRelativePath != null) {
Just in case someone has a directory "0"
for whatever reason.
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.
You didn’t say anything about this when the third parameter of .applySourceMap()
was implemented. Isn’t the same issue present there?
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.
Yes! Good catch!
Looks good, will merge with update mentioned above. Thanks! |
Fixed. |
Sweet, rebase and I'll merge :) (Sorry, I should have got to your PRs first so you didn't have to rebase all of them) |
An important use case for `SourceNode`s, and especially for `SourceNode.fromStringWithSourceMap`, is to concatenate files with source map support. This works well as long as all the input source maps and the concatenated file¿s source map are next to each other. That’s because any relative source paths in any input source map have to be rewritten to be relative to the concatenated file’s source map. This commit adds a third parameter to `SourceNode.fromStringWithSourceMap` allowing you to do this.
Rebased. |
Fixed in 6be13d9 |
An important use case for
SourceNode
s, and especially forSourceNode.fromStringWithSourceMap
, is to concatenate files withsource map support. This works well as long as all the input source maps
and the concatenated file¿s source map are next to each other. That’s
because any relative source paths in any input source map have to be
rewritten to be relative to the concatenated file’s source map. This
commit adds a third parameter to
SourceNode.fromStringWithSourceMap
allowing you to do this.