Normalise path separators for Webpack paths on Windows #95
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.
Goal
Updates
StripProjectRoot
to preserve the correct path separators for Webpack source maps when running on Windows.The
StripProjectRoot
transformation usespath
, which uses platform-specific path separators. This means that when the tool is run on Windows, Webpack source paths are incorrectly converted to Windows-style path separators.Design
If we detect that the tool is running on Windows and the source map path is a Webpack path, normalise the path separators to URI format (
/
)Testing
Updated webpack unit tests assertions to check for the correct path separator - although CI runs on both Windows and Linux, the unit test assertions used
path.join
and so were also platform-specific.