1
votes

I am trying to watch scss files and only recompile them when they change. For ease of deployment, I want to use gulp-ruby-sass instead of gulp-sass.

I want to do this but the task will hang on "dependency seen"

// Doesn't work
var gulp = require('gulp')
var debug = require('gulp-debug')
var sass = require('gulp-ruby-sass')
var watch = require('gulp-watch');

watch("static/**/*.scss")
    .pipe(debug({title:'dependency seen'}))
    .pipe(sass())
    .pipe(debug({title:'sassed'}))

The script works when I use vanilla gulp.src

// Works
var gulp = require('gulp')
var debug = require('gulp-debug')
var sass = require('gulp-ruby-sass')
var watch = require('gulp-watch');

gulp.src("static/**/*.scss")
    .pipe(debug({title:'dependency seen'}))
    .pipe(sass())
    .pipe(debug({title:'sassed'}))

It also works when I use gulp-sass instead of gulp-ruby-sass

// Works
var gulp = require('gulp')
var debug = require('gulp-debug')
var sass = require('gulp-sass')
var watch = require('gulp-watch');

watch("static/**/*.scss")
    .pipe(debug({title:'dependency seen'}))
    .pipe(sass())
    .pipe(debug({title:'sassed'}))

This tells me that there is something wrong with the interaction between gulp-watch and gulp-ruby-sass. Any ideas?

2

2 Answers

0
votes

I found that gulp-ruby-sass-ns doesn't hang. The library doesn't seem quite as well supported however so I will leave this question open to see whether anyone else has any input

0
votes

Install Gulp-Plumber and call it right before you compile your sass.