'use strict';
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');
gulp.task('sass', function () {
return gulp.src('public/css/scss/*.{css,scss}')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('public/css/'));
});
gulp.task('serve', function() {
browserSync.init(
{
proxy:'w23/public/',
port:8080
}
// {server: "public/"}
);
browserSync.watch('public/**/*.*').on('change', browserSync.reload);
gulp.watch('public/css/scss/*.{css,scss}', ['sass']);
});
gulp.task('default', gulp.series('clear','sass','serve'));
Выдает ошибку:
Error: watching public/css/scss/*.{css,scss}: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)
at Gulp.watch (D:\OpenServer\domains\w23\node_modules\gulp\index.js:28:11)
at D:\OpenServer\domains\w23\gulpfile.js:125:6
at taskWrapper (D:\OpenServer\domains\w23\node_modules\undertaker\lib\set-task.js:13:15)
at bound (domain.js:280:14)
at runBound (domain.js:293:12)
at asyncRunner (D:\OpenServer\domains\w23\node_modules\async-done\index.js:36:18)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)