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

fix: Correctly handle protocol-only sourceRoot values #61

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

kamilogorek
Copy link
Contributor

This makes some configurations of Webpack, which emit "sourceRoot": "webpack:///" work as expected, and allowing CLI to rewrite sources into webpack:///./src/foo/bar.js rather than webpack:/./src/foo/bar.js.

@kamilogorek kamilogorek enabled auto-merge (squash) March 6, 2023 13:46
Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple nits

Comment on lines +192 to +193
let source_root = if source_root.ends_with('/') {
source_root[..source_root.len() - 1].to_string()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can use strip_suffix() here

@@ -72,6 +72,32 @@ fn test_basic_sourcemap_with_root() {
assert!(iter.next().is_none());
}

#[test]
fn test_basic_sourcemap_with_absolute_uri_root() {
let input: &[_] = b"{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let input: &[_] = b"{
let input: &[_] = rb#"{

so you won’t have to escape everything

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