-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fails to pick up changes from gulp-watch #110
Comments
It seems the issue is in index.js:
The compilation happens only when |
Here's a solution I'm using. You should be able to do the following: return gulp.src('app/styles/base.scss')
.pipe(watch('app/styles/base.scss'))
.pipe(compassSingleFile({
sass: 'app',
css: '.tmp'
})); /**
* Run compass on single sass files as they come down the stream.
*
* The gulp-compass plugin collects all files and runs compass on them when the
* stream is over, but the stream is never over when watching.
*/
function compassSingleFile(config) {
var source = require('vinyl-source-stream');
return require('event-stream').map(function(file, callback) {
var result;
var stream = source(file.relative)
.pipe($.compass(config))
.on('data', function(data) {
result = data;
})
.on('end', function() {
callback(null, result);
});
stream.write(file);
stream.end();
});
} |
My way was to use both compass watch and gulp-watch. It's not optimal but works. gulp.src('path_to_scss/*.scss')
.pipe( compass({
sass: 'path_to_scss',
css: './tmp',
task: 'watch'
}))
.pipe( gulp.watch('./tmp/*.css'))
.pipe( ... ); Since there is no communication possible between compass and gulp (except parsing stdout) we kinda use files to do it. So when you modify a .scss file => compass triggered => new css file produced => gulp-watch triggered => file added to stream => wonderful things happen. |
I'm unable to make gulp-compass compile anything coming piped through gulp-watch.
This works:
This doesn't work:
The pipe does produce a vinyl on change (I verified with gulp-debug), but gulp-compass fails to compile them, as soon as I add the watch pipe.
The text was updated successfully, but these errors were encountered: