Skip to content
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

Normalise path separators for Webpack paths on Windows #95

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

yousif-bugsnag
Copy link
Contributor

Goal

Updates StripProjectRoot to preserve the correct path separators for Webpack source maps when running on Windows.

The StripProjectRoot transformation uses path, 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.

@yousif-bugsnag yousif-bugsnag force-pushed the PLAT-11374/preserve-path-separators branch from 57a4449 to e36e1a3 Compare April 12, 2024 11:09
@yousif-bugsnag yousif-bugsnag merged commit 47a6aa0 into next Apr 17, 2024
16 checks passed
@gingerbenw gingerbenw mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants