daggerheart/gulpfile.js
tomaioo e3f231ff2a 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>
2026-05-23 05:22:09 -07:00

22 lines
592 B
JavaScript

// Less configuration
var gulp = require('gulp');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('less', function (cb) {
gulp.src('styles/daggerheart.less')
.pipe(sourcemaps.init())
.pipe(less())
.on('error', console.error.bind(console))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('styles'));
cb();
});
gulp.task(
'default',
gulp.series('less', function () {
return gulp.watch('styles/**/*.less', gulp.series('less'))
.on('error', console.error.bind(console));
})
);