I am trying to upgrade gulp from 3.x to 4.x When using gulp watch, the styles, scripts and inject function works well.But when I make any file changes the scripts and styles need to be loaded automatically. This is not working.
I have tried adding gulp.series to each function.
function isOnlyChange(event) {
return event.type === 'changed';
}
gulp.watch([
path.join(conf.paths.src, '/app/**/*.css'),
path.join(conf.paths.src, '/app/**/*.scss')
], gulp.series(function (event) {
if (isOnlyChange(event)) {
gulp.series('styles-reload');
} else {
gulp.series('inject-reload');
}
}));
Gulp watch needs to reload styles when I make changes in styles file but this is not performing. Can someone help me out how to perform in gulp 4.x