Skip to content

Fix sources absolute paths#398

Open
jerome-rdlv wants to merge 1 commit into
gulp-sourcemaps:masterfrom
jerome-rdlv:fix-absolute-path
Open

Fix sources absolute paths#398
jerome-rdlv wants to merge 1 commit into
gulp-sourcemaps:masterfrom
jerome-rdlv:fix-absolute-path

Conversation

@jerome-rdlv
Copy link
Copy Markdown

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 the urlRegex beside https: and webpack:.

Copy link
Copy Markdown
Collaborator

@nmccready nmccready left a comment

Choose a reason for hiding this comment

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

Opening a discussion.

Comment thread src/utils.js
var PLUGIN_NAME = require('../package.json').name;

var urlRegex = /^(https?|webpack(-[^:]+)?):\/\//;
var urlRegex = /^(https?|webpack(-[^:]+)?|file):\/\//;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var urlRegex = /^(https?|webpack(-[^:]+)?|file):\/\//;
var urlRegex = /^(https?|webpack(-[^:]+)?|file?):\/\//;

all of them were optional prior, should it be so still?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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.

2 participants