Sign in
Log inSign up

What's wrong with my gulp task?

estevan carlos benson's photo
estevan carlos benson
·Sep 6, 2017

I am copying some code from an example.

I receive an error message stating, "Task function must be specified" on the first line of code below, "gulp.task('serve'..."

When I remove the [sass] dependency, the gulp tasks work. What is wrong with my code? The original example is here: browsersync.io/docs/gulp#gulp-sass-css

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

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


gulp.task("sass", function() {
    return gulp.src("app/sass/*.scss")
        .pipe(sass())
        .pipe(gulp.dest("dist/css"))
        .pipe(browserSync.stream());
});