M
M
mastaJoe2019-02-15 19:41:56
gulp.js
mastaJoe, 2019-02-15 19:41:56

GULP not working, what's wrong?

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

gulp.task('sass', function(){
    return gulp.src('./src/sass/**/*.sass')
        .pipe(sass().on('error', sass.logError))
        .pipe(autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        }))
        .pipe(gulp.dest('./src/css/'))
        .pipe(browserSync.stream());
})

gulp.task('serve', ['sass'], function() {

    browserSync.init({
        server: "./src"
    });

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

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-02-15
@zetproj

Check out the documentation and see how to write tasks correctly in the fourth version .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question