Answer the question
In order to leave comments, you need to log in
Rewrite task under gulp 4?
Help me rewrite the task from 3 gulp to 4
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var concatCSS = require('gulp-concat-css');
var browserSync = require('browser-sync');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var ftp = require('gulp-ftp');
// Start server + debug sass/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./src",
notify: false,
host: "185.27. 134.11"
});
gulp.watch("
gulp.watch("src/*.html").on('change', browserSync.reload);
});
// Compile sass to CSS and paste changes into browser
gulp.task('sass', function() {
return gulp.src("src/sass/**/*.sass")
.pipe(sass())
.pipe (autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(concatCSS('style.css'))
.pipe(gulp.dest("src/css"))
.pipe(browserSync .stream());
});
gulp.task('default', ['serve']);
Answer the question
In order to leave comments, you need to log in
In general, it is enough to change such constructions
gulp.task('default', ['serve']);
to calls gulp.series / gulp.parallel
gulp.task('default', function(done){
gulp.series(
'serve'
)(done)
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question