Autoprefixer doing nothing with my css

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']);

});

Upvotes: 0

Views: 90

Answers (1)

TheEarlyMan
TheEarlyMan

Reputation: 402

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.

Upvotes: 0

Related Questions