-
-
Notifications
You must be signed in to change notification settings - Fork 50
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 #55, issue with sourcemap output #61
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? We already pass the
file.path
to the postcss function. Seems rather like an issue with eitherpostcss
orvinyl-sourcemaps-apply
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works without, but the reason
gulp-postcss
is doing it is that it's missing the path. If we don't do this, all files will look like they are coming from the root of the website.I did it mostly due to
gulp-postcss
doing the same thing, and they are maintaining bothpostcss
andgulp-postcss
seeming that they think it's the right solution. But one can argue that the problem is postcss.I can remove it if you like :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They added it in this commit: postcss/gulp-postcss@9feb6d4#diff-168726dbe96b3ce427e7fedce31bb0bc to fix the relative sourcemaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean the whole change. Why is any of this needed. It should just work. I don't think it makes sense to work around stuff here. It should rather be fixed upstream so it benefits all consumers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a requirement to make the sourcemap paths relative, I think it's the job of https://github.com/floridoo/vinyl-sourcemaps-apply which already get's the
file
object and should handle any sourcemap related task.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being a bit unclear. Without these changes it's simply not working right now.
Right now it only keeps the autoprefixer sourcemaps, and throws away the LESS ones, it outputs this:
Giving this in DevTools, that's not useful at all since it's not the real source.
After this patch it gives this:
that's translated to the real source in DevTools:
Hope this makes a bit more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's an issue. I'm just saying you're trying to fix it in the wrong place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I linked the issue and this PR on the postcss issue (postcss/postcss#240), the information within this PR might be useful.