0

Here is my gulpfile, I don't know whats wrong. Why is autoprefixer doing nothing? I suppose it's something wrong with dest.

 gulp.task('sass', function () {
        gulp.src('**/sass/*.scss')
            .pipe(plumber({errorHandler: onError}))
            .pipe(sass())
            .pipe(autoprefixer({
                browsers: ['last 2 versions'],
                cascade: false
            }))
            .pipe(flatten({includeParents: 0}))
            .pipe(gulp.dest(function (file) {
                var dir = path.dirname(file.path).split('/scss')
                return dir[1] ? path.join(dir[0], 'css', dir[1]) : path.join(dir[0], 'css');
            }))

    });

    gulp.task('watch', function () {
        gulp.watch('**/sass/*.scss', ['sass']);

});
R. Arnone
  • 423
  • 4
  • 15

1 Answers1

0

Add "return gulp.src('**/sass/*.scss')" in the second line of your task, before you pipe the others. It should work. You are missing the word return in the second line of your task.

TheEarlyMan
  • 384
  • 4
  • 15