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

produced sourcemap seems to have wrong mapping #38

Closed
alvinlin123 opened this issue Jan 12, 2017 · 8 comments
Closed

produced sourcemap seems to have wrong mapping #38

alvinlin123 opened this issue Jan 12, 2017 · 8 comments

Comments

@alvinlin123
Copy link
Member

This is an follow up issue of #36

Below is @entozoon's original words:

I've looked closer at our test repo (forked here:)
https://github.com/entozoon/gulp-bless-issue36-sample

And although it is outputting sourcemap data, it's actually wrong.
If you look at the index.html and inspect element (chrome with sourcemaps enabled) you can see that it shows the css properties line numbers in the compiled css file, rather than their source sass files.
e.g. in this repo, stuff like:

[merged.css:5301]
body {
    color: tomato; 
}

But without using bless in the gulpfile, it shows the proper output of:

[child.scss:1]
body {
    color: tomato; 
}

Sorry for pointing it out and, again i'm not sure if it's gulp-bless or gulp-sourcemaps.. or the gulpfile ordering itself that's the issue.
I can alternate between using either sourcemaps/bless separately in dev/production so it's not a bother :)

@alvinlin123
Copy link
Member Author

Hmm from just briefly looking at the code it looks like it may be expected behaviour. Since the css is concatenated before passing to gulp-bless, so the mapping is based on the concatenated css.

But I may be wrong, I will have to look further.

@entozoon
Copy link

I thought that might be the case too but actually the mapping somehow outputs correctly, despite concatenation, based on the original sass (if bless isn't included)

@alvinlin123
Copy link
Member Author

@entozoon So I was wrong. I thought it's expected behaviour based on the existing code (I'm new to all the source mapping stuff). After researching source mapping a little bit more, I figured that the "expected behaviour" is actually wrong, the mapping should map all the way back to the original file that a coder wrote, not some intermediated compiled source. So yea your right, thanks for reporting this issue! I learn something new from it.

Like before can you try it out using the branch https://github.com/BlessCSS/gulp-bless.git#issue-38-fix.

I will work on releasing the fix as a major version bump release (so 4.0.0); this change is quite bit so I will need to get some feedback from the creator of this project, so I may not be able to do a release as fast as last time. However, as usual, I will comment on this ticket when I release this fix.

@mderoche
Copy link

@alvinlin123 great fix, thanks!

@adam-lynch
Copy link
Member

4.0.0 released with the fix. Thanks! 😁

@alvinlin123
Copy link
Member Author

Thanks Adam!

@charginghawk
Copy link

The issue-38-fix branch was deleted. If I was using that, is the 4.0.0 release identical, or are there other concerns with it, being a major update and all?

@alvinlin123
Copy link
Member Author

alvinlin123 commented Sep 15, 2017

@charginghawk Yup 4.0.0 is identical to issue-38-fix branch. The major version was bumped because the fix introduces some backward incompatibility.

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

No branches or pull requests

5 participants