I am attempting to rebuild my gulpfile.js
after upgrading to Gulp 5 and the most recent stable version of Node.js (20.11.1). The gulpfile below works just fine with Node.js version 16.14.0, but is broken after around v.18. I get a message that says “aggregateerror” which I cannot figure out how to debug. I have Googled the crap out of this, but to no avail. Any help is greatly appreciated. Here is my gulpfile:
const { src, dest, gulp, watch, series, parallel } = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const sourcemaps = require('gulp-sourcemaps');
const browserSync = require('browser-sync').create();
function reload(done) {
browserSync.reload();
done();
}
function serve(done) {
browserSync.init({
proxy: 'lib-d9.ddev.site',
injectChanges: true
});
done();
}
function watchTask(done) {
watch('css/scss/**/*.scss', series(cssTask, reload));
done();
}
function cssTask() {
return (
src('css/scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(dest('css/'))
.pipe(browserSync.stream())
);
}
exports.default = series(serve, watchTask)