我正在尝试查看 scss 文件,并且仅在它们更改时重新编译它们。为了便于部署,我想使用 gulp-ruby-sass 而不是 gulp-sass。
我想这样做,但任务将挂在“看到的依赖”上
// 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'}))
当我使用 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'}))
当我使用 gulp-sass 而不是 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'}))
这告诉我 gulp-watch 和 gulp-ruby-sass 之间的交互有问题。有任何想法吗?