This repository was archived by the owner on Aug 29, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 87
fix(index): resolve source maps with root-relative paths correctly #68
Merged
michael-ciniawsky
merged 3 commits into
webpack-contrib:master
from
iclanton:ianc/fixing-issue-resolving-root-relative-urls
Aug 14, 2018
Merged
fix(index): resolve source maps with root-relative paths correctly #68
michael-ciniawsky
merged 3 commits into
webpack-contrib:master
from
iclanton:ianc/fixing-issue-resolving-root-relative-urls
Aug 14, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zuohaocheng
suggested changes
Aug 1, 2018
Contributor
zuohaocheng
left a comment
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.
Looks good. May you add a test case?
zuohaocheng
approved these changes
Aug 1, 2018
Contributor
zuohaocheng
left a comment
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.
Looks great to me.
Contributor
Author
|
Excellent! Can this get merged in? How frequently do you guys release this package? |
Contributor
|
@d3viant0ne Could you help to merge it? |
Contributor
Author
|
@d3viant0ne can you take a look at this? |
michael-ciniawsky
approved these changes
Aug 14, 2018
Member
michael-ciniawsky
left a comment
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.
@iclanton Thx
michael-ciniawsky
pushed a commit
that referenced
this pull request
Aug 14, 2018
Member
|
Released in |
Contributor
Author
|
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
source-map-loaderdoesn't correctly handle sourcemaps with root-relativesourceRootproperties in sourcemaps.Consider the following example sourcemap:
{ "version": 3, "file": "my-file.js", "sourceRoot": "/code/my-project/src/", "sources": [ "my-file.ts" ], "names": [], "mappings": "AAAA, ..." }source-map-loaderwill resolve each of the files referenced insourcesto be undersourceRoothere (so in this example, the path becomes/code/my-project/src//my-file.ts), and then it will attempt to resolve each of the paths it constructed usingloaderUtils.urlToRequest. As per the documentation ofurlToRequest, therootargument is required for paths that are root-relative. Root-relative paths work correctly on Windows because of this condition, but on UNIX and UNIX-like operating systems, without therootargument, this condition applies. This means, the path in our example above is turned into.//code/my-project/src//my-file.ts, which isn't a valid path.This issue is easily fixed by passing
trueto therootparameter ofurlToRequest, which causes paths with a leading/to be passed through (this condition).