Fix sources absolute paths#398
Open
jerome-rdlv wants to merge 1 commit into
Open
Conversation
nmccready
reviewed
May 27, 2025
Collaborator
nmccready
left a comment
There was a problem hiding this comment.
Opening a discussion.
| var PLUGIN_NAME = require('../package.json').name; | ||
|
|
||
| var urlRegex = /^(https?|webpack(-[^:]+)?):\/\//; | ||
| var urlRegex = /^(https?|webpack(-[^:]+)?|file):\/\//; |
Collaborator
There was a problem hiding this comment.
Suggested change
| var urlRegex = /^(https?|webpack(-[^:]+)?|file):\/\//; | |
| var urlRegex = /^(https?|webpack(-[^:]+)?|file?):\/\//; |
all of them were optional prior, should it be so still?
Author
There was a problem hiding this comment.
Not exactly. The "?" in "https?" is only for the optional trailing "s", to support both "http" and "https".
In the webpack fragment the "?" applies only to the final part, not to the "webpack" prefix.
And the regex should match only in one of the three cases is present.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Sass produces absolute source paths prefixed with the
file:pseudo protocol. This was not supported and was being prefixed with base path which resulted in broken paths.This pull request simply add that
file:protocol to theurlRegexbesidehttps:andwebpack:.