mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
The gulpfile.js uses `var` instead of `const` or `let` for variable declarations, which is an outdated practice. Additionally, the callback `cb` in the 'less' task is called before the asynchronous gulp stream operations complete, which can lead to race conditions where the task reports completion before the Less compilation finishes. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
21 lines
548 B
JavaScript
21 lines
548 B
JavaScript
// Less configuration
|
|
const gulp = require('gulp');
|
|
const less = require('gulp-less');
|
|
const sourcemaps = require('gulp-sourcemaps');
|
|
|
|
gulp.task('less', function () {
|
|
return gulp.src('styles/daggerheart.less')
|
|
.pipe(sourcemaps.init())
|
|
.pipe(less())
|
|
.on('error', console.error.bind(console))
|
|
.pipe(sourcemaps.write('.'))
|
|
.pipe(gulp.dest('styles'));
|
|
});
|
|
|
|
gulp.task(
|
|
'default',
|
|
gulp.series('less', function (cb) {
|
|
gulp.watch('styles/**/*.less', gulp.series('less'));
|
|
cb();
|
|
})
|
|
);
|