fix(security): missing error handler in gulp watch task

The gulp.watch task does not include error handling. If the 'less' task fails during watch mode, the watch process may crash or hang without clear indication, potentially leaving the build in an inconsistent state. Additionally, the callback `cb()` is called immediately after gulp.watch, not waiting for the watch to actually start or handle errors.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
This commit is contained in:
tomaioo 2026-05-23 05:22:09 -07:00
parent e4a3f105dc
commit e3f231ff2a

View file

@ -15,8 +15,8 @@ gulp.task('less', function (cb) {
gulp.task(
'default',
gulp.series('less', function (cb) {
gulp.watch('styles/**/*.less', gulp.series('less'));
cb();
gulp.series('less', function () {
return gulp.watch('styles/**/*.less', gulp.series('less'))
.on('error', console.error.bind(console));
})
);