-
-
Notifications
You must be signed in to change notification settings - Fork 84
Fetch source maps over HTTP #79
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
@@ -68,6 +69,20 @@ module.exports = function(input, inputMap) { | |||
function untouched() { | |||
callback(null, input, inputMap); | |||
} | |||
function fetchHttp(source, callback) { | |||
http.get(source, function (resp) { |
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.
Built-in http.get()
is very bare-bones, e.g. doesn't follow redirects. Should probably use some higher-level library.
Also, does this need caching? Or is there already a cache on another layer?
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 can use got
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.
Built-in
http.get()
is very bare-bones, e.g. doesn't follow redirects. Should probably use some higher-level library.
Also, does this need caching? Or is there already a cache on another layer?
I understand. Any considerations about bringing in a new dependency?
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 can use
got
I'll try. Thanks for recommendation.
This PR does not handle HTTP redirection. If the original source map to https://github.com/ThoughtWorksInc/Binding.scala/raw/78443c86e5046bd1e13f1504fa9280e668d55eb9/Binding/src/main/scala/com/thoughtworks/binding/Binding.scala, this PR will create a file with the following content:
|
Close in favor #113, will be implemented for |
I was running into problems with source map URLs pointing to remote https:// resources. Same problem as #77.
This fix seems to solve my problem by fetching the remote source maps for future bundling. Ideally I would prefer source-map-loader to ignore HTTP URLs and pass them verbatim for the browser to fetch remote source maps when needed. However I couldn't figure out how to do that.
Any feedback is welcome!