Hi. I am out of ideas for this so I have to ask for a little help. I have the gulp code below. When I execute “gulp live” I only get the CSS compiled but no refresh and I can’t figure it out why.
const { src, dest, parallel, watch, series } = require('gulp');
const sass = require('gulp-sass');
const minifyCSS = require('gulp-csso');
const browserSync = require('browser-sync').create();
function refresh(cb){
browserSync.init({
server: {
baseDir: "./src/"
}
});
console.log("refresh");
cb();
}
function css(cb) {
return src('src/sass/*.scss')
.pipe(sass())
.pipe(minifyCSS())
.pipe(dest('src/css'));
console.log("css")
cb();
}
//////
function watchCode(cb){
watch('src/sass/*.scss', css);
console.log("watch")
cb();
}
exports.css = css;
exports.watchCode = watchCode;
exports.refresh = refresh;
exports.live = series(watchCode, refresh);
Thanks.