const gulp = require('gulp');
function compress() {
// compress task
}
function watch() {
gulp.watch('src/img/*', compress);
}
function css() {
return gulp
.src('src/scss/*.scss')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass())
.on('error', sass.logError)
.pipe(cleanCSS())
.pipe(
autoprefixer({
browsers: ['last 2 versions'],
cascade: false
})
)
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream());
}
module.exports.default = gulp.series(watch); // ну если один таск можно и просто `watch`.
module.exports.watch = watch;
module.exports.css = css;