sp00m / gulp-watch-sass

Watches for SASS files modifications, taking @import-ing SASS files into account.
MIT License
6 stars 2 forks source link

gulp-watch events don't seem to work #10

Open dvelikiy opened 6 years ago

dvelikiy commented 6 years ago

Ok, so I tried to substitute gulp-watch with gulp-watch-sass, but it didn't work: watchSass(SRC_STYLES).on('change', updateRelatedStyles);

I managed to make it work by using gulp-fn: gulp.task("watch-styles", () => watchSass(SRC_STYLES).pipe(gulpFn(updateRelatedStyles)));

It'd be nice to have the usual 'change' and other events.

sp00m commented 6 years ago

I'm not sure I understand. What are you trying to achieve? gulp-watch-sass adds related SASS files to the stream already, so you should only have to pipe gulp-sass as explained in the usage section.

dvelikiy commented 6 years ago

I understand that. However, it's sometimes useful to have access to chokidar events, such as 'change'.

E. g. (the standard gulp watch mechanism) var watcher = gulp.watch('js/**/*.js', gulp.parallel('concat', 'uglify')); watcher.on('change', function(path, stats) { console.log('File ' + path + ' was changed'); });

Reloecc commented 5 years ago

Hello, I am here to ask about the events as well. What I would like to achieve is just to see an information that something has happened in console as confirmation that everything is working well. I had no success with chaining .on('end', ()=>{ console.log('Job done') }). And as stated in the issue, chokidar's events are not accessible neither. So how do we catch the information that something is happening with gulp-watch-sass? Thatnk you.