forked from veevelder/quick-combat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
67 lines (59 loc) · 1.71 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const gulp = require('gulp');
const prefix = require('gulp-autoprefixer');
const sourcemaps = require('gulp-sourcemaps');
const sass = require('gulp-sass')(require('sass'));
const yaml = require('gulp-yaml');
/* ----------------------------------------- */
/* Compile Sass
/* ----------------------------------------- */
// Small error handler helper function.
function handleError(err) {
console.log(err.toString());
this.emit('end');
}
const SYSTEM_SCSS = ["styles/src/**/*.scss"];
function compileScss() {
// Configure options for sass output. For example, 'expanded' or 'nested'
let options = {
outputStyle: 'compressed'
};
return gulp.src(SYSTEM_SCSS)
.pipe(
sass(options)
.on('error', handleError)
)
.pipe(prefix({
cascade: false
}))
.pipe(gulp.dest("./styles/dist"))
}
const cssTask = gulp.series(compileScss);
/* ----------------------------------------- */
/* Compile YAML
/* ----------------------------------------- */
const SYSTEM_YAML = ['./yaml/**/*.yml', './yaml/**/*.yaml'];
function compileYaml() {
return gulp.src(SYSTEM_YAML)
.pipe(yaml({ space: 2 }))
.pipe(gulp.dest('./'))
}
const yamlTask = gulp.series(compileYaml);
/* ----------------------------------------- */
/* Watch Updates
/* ----------------------------------------- */
function watchUpdates() {
gulp.watch(SYSTEM_SCSS, cssTask);
gulp.watch(SYSTEM_YAML, yamlTask);
// gulp.watch(SYSTEM_SCRIPTS, scripts);
}
/* ----------------------------------------- */
/* Export Tasks
/* ----------------------------------------- */
exports.default = gulp.series(
compileScss,
// compileScripts,
watchUpdates
);
exports.css = cssTask;
exports.yaml = yamlTask;
// exports.scripts = scripts;