Answer the question
In order to leave comments, you need to log in
Gulp 4: set up automatic page refresh?
Good afternoon.
Today I personally encountered the problem of the updated "gulp". It just so happened that I set myself version 4 ... And away we go. A lot of mistakes, everything is stupid, slows down, lags.
But I was not at a loss, I read the solutions. This one was especially helpful: https://stackoverflow.com/questions/39665773/gulp-...
And no more errors. There literally brackets [ ] should be changed.
But auto update doesn't work. That is, I write changes to the sass file, but compilation to css does not occur. If the problem was in the sass task, shouldn't I get an error?
I feel like the problem is somewhere here:
gulp.task('watch', gulp.series('browser-sync', 'sass', function() {
gulp.watch('app/sass/**/*.sass', gulp.series('sass'));
}));
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserSync = require('browser-sync');
gulp.task('sass', function() {
return gulp.src('app/sass/**/*.sass')
.pipe(sass())
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: 'app'
},
notify: false,
});
});
gulp.task('watch', gulp.series('browser-sync', 'sass', function() {
gulp.watch('app/sass/**/*.sass', gulp.series('sass'));
}));
Answer the question
In order to leave comments, you need to log in
Might come in handy for someone. Before making any edits, check if you have a body tag on your page. I accidentally forgot it and stopped updating. Stupid mistake, but you can break the brain. )))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question