mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
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>
22 lines
592 B
JavaScript
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));
|
|
})
|
|
);
|