-
Notifications
You must be signed in to change notification settings - Fork 381
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
sourceComments option gets ignored if called by gulp.watch #234
Comments
Please try with the latest version:
|
Same result. |
I cannot replicate your error using the latest version of Because we're passing a string to /* line 1, {{process.cwd()}}/sass/_foo.scss */
.banana {
content: 'waldo'; }
/* line 3, stdin */
.foo {
content: 'bar'; }
/* line 7, stdin */
.bar {
content: 'baz'; }
/* line 11, stdin */
.baz {
content: 'baz'; }
/* line 15, stdin */
.qux {
content: 'qux'; } |
I'm also happy to defer this to 2.1 as most people seem to be interested in Source Maps over Comments and I don't want to block the 2.0 release on this |
I'm ok with moving this to 2.1. I'll take a look at this again, I could bet in my case there where no source comments at all. |
I didn't even know that was a thing (I use compressed output with no sourcemaps/anything). |
For those of you, like me, who are to impatient to wait for a fix you can hack around this by tapping into the stream with gulp-tap and just doing plain ol' string replacement. It will likely slow things down as we have to toString the buffer then convert it back but it gets you out of a bind. gulp.src(config.files.scss)
.pipe(sass({
sourceComments:true
}))
.pipe(tap(function(file, t) {
file.contents = new Buffer(file.contents.toString().replace(/stdin \*\//g, file.path + ' */'));
}))
.pipe(concat('app.css'))
})) |
This appears to be fix in v2.3.1. |
In v2.3.2 it still doesn't work. |
Example:
When I call
gulp sass
it generates source comments, as expected. But when I rungulp watch
no source comments get generated.The text was updated successfully, but these errors were encountered: