Y
Y
Yastr2016-03-25 19:10:59
css
Yastr, 2016-03-25 19:10:59

Why doesn't autoprefixer with sass work when building gulp?

Hello!
For the second hour I've been sitting parsing the galp and I can't understand why I can't start the autoprefixer after processing the scss file. Please tell me what is the reason?
I copied the blank from the browser-sync docks.
gulpfile

var gulp         = require('gulp');
var browserSync  = require('browser-sync').create();
var sass         = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');

gulp.task('serve', ['sass'], function() {
    browserSync.init({
        server: "./app"
    });

    gulp.watch("app/scss/*.scss", ['sass']);
    gulp.watch("app/*.html").on('change', browserSync.reload);
});


gulp.task('sass', function() {
    return gulp.src("app/scss/*.scss")
        .pipe(sass())
        .pipe(autoprefixer({
            browsers: ['last 12 versions'],
            cascade: false
        }))
        .pipe(gulp.dest("app/css"))
        .pipe(browserSync.stream());
});

gulp.task('default', ['serve']);

sass
.block{
  background-image: linear-gradient(90deg, #333, #fff);
  &__element{
    font-size: 34px;
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Clever_Coyote, 2016-03-25
@Yastr

Attach a piece of sass that compiles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question