Answer the question
In order to leave comments, you need to log in
GULP. How to run autoprefix along with watch?
Hello. This is my first time using gulp collectors, and indeed any collector.
Found some guides, began to act in accordance with them. But not one of them contains information on autoprefix. I started installing it myself. Here is what I have now:
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
gulp.task('less', function () {
return gulp.src('css/style.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('css'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('autopre', function () {
return gulp.src('css/style.css')
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('css'));
});
gulp.task('watch', ['browserSync', 'less'], function (){
gulp.watch('css/*.less', ['less']);
// другие ресурсы
});
gulp.task('browserSync', function() {
browserSync({
server: {
baseDir: ''
},
})
});
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