A
A
Aricus2018-06-14 07:23:02
JavaScript
Aricus, 2018-06-14 07:23:02

How to use gulp-watch with gulp-autoprefixer?

Everything works in this code, except for the autoprefixer, no errors and notes are displayed in the console:

var gulp = require('gulp');
var watch = require('gulp-watch');
var sass = require('gulp-sass'); // переводит SASS в CSS
var autoprefixer = require('gulp-autoprefixer'); // Проставлет вендорные префиксы в CSS
var cssnano = require('gulp-cssnano'); // Минимизация CSS

gulp.task('sass', function () {
    return watch(['src/sass/*.+(sass|scss|css)'], { ignoreInitial: false })
        .pipe(sass())
        .pipe(autoprefixer({
            browsers: ['last 25 versions'],
            cascade: false
        }))
        .pipe(cssnano())
        .pipe(gulp.dest("dist/css/"));
});

Can you please tell me how can I fix this situation while maintaining change tracking through gulp-watch?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav Lyskov, 2018-06-14
@Aricus

this?

S
Socrates, 2018-06-14
@Karmov69

the latest 25 versions of browsers why only

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question