Projektowanie stron internetowych

TypeError: glob pattern string required

Podczas kompilacji plików sass przy pomocy gulp-ruby-sass możemy spotkać się z błędem 'TypeError: glob pattern string required’ . Problemem jest zapewne z niewłaściwie użytym obiektem sass.

var gulp = require('gulp'), sass = require('gulp-ruby-sass');

gulp.task('css', function() {
return gulp.src('./stylesheets/master.scss')
.pipe(sass({ style: 'expanded' }))
.pipe(minifycss({keepBreaks:true}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./../../web/assets/'+template+'/css'));
});

Należy użyć bezpośrednio obiektu sass a nie jako parametr obiektu pipe

gulp.task('css', function() {
return sass('./stylesheets/master.scss', {
 style: 'compressed',
 compass: true,
 loadPath: ['./stylesheets']
 })
.pipe(minifycss({keepBreaks:true}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./../../web/assets/'+template+'/css'));
});