Answer the question
In order to leave comments, you need to log in
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']);
.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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question