forked from fvtt-fria-ligan/twilight2000-foundry-vtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
48 lines (39 loc) · 1.19 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const gulp = require('gulp');
const less = require('gulp-less');
const cleanCSS = require('gulp-clean-css');
/* ----------------------------------------- */
/* Handle Errors function
/* ----------------------------------------- */
function handleError(err) {
console.log(err.toString());
this.emit('end');
}
/* ----------------------------------------- */
/* Compile LESS
/* ----------------------------------------- */
const T2K_LESS = ['less/**/*.less'];
function compileLESS() {
return gulp
.src('./less/t2k4e.less')
.pipe(less().on('error', handleError))
.pipe(cleanCSS({ debug: true }, details => {
console.log(`${details.name}: ${details.stats.originalSize}`);
console.log(`${details.name}: ${details.stats.minifiedSize}`);
}))
.pipe(gulp.dest('./'));
}
const css = gulp.series(compileLESS);
/* ----------------------------------------- */
/* Watch Updates
/* ----------------------------------------- */
function watchUpdates() {
gulp.watch(T2K_LESS, css);
}
/* ----------------------------------------- */
/* Export Tasks
/* ----------------------------------------- */
exports.default = gulp.series(
gulp.parallel(css),
watchUpdates,
);
exports.css = css;