generated from pcon/site-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (38 loc) · 1.07 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
const config = require('config');
const gulp = require('gulp');
const clean = require('./gulp/clean');
const css = require('./gulp/css').default;
const fonts = require('./gulp/fonts').default;
const html = require('./gulp/html').default;
const img = require('./gulp/img').default;
const js = require('./gulp/js').default;
const pub = require('./gulp/public').default;
const sass = require('./gulp/sass').default;
const sitemap = require('./gulp/sitemap');
const static_files = require('./gulp/static');
const watch = require('./gulp/watch');
const parallel_jobs = [
css,
fonts,
html,
img,
js,
pub,
sass
];
if (static_files.has.css()) {
parallel_jobs.push(static_files.css);
}
if (static_files.has.js()) {
parallel_jobs.push(static_files.js);
}
const series_jobs = [
gulp.parallel(parallel_jobs)
];
if (config.get('site.sitemap')) {
series_jobs.push(sitemap);
}
gulp.task('build', gulp.series(series_jobs));
const build = gulp.task('build');
gulp.task('watch', gulp.series(clean, build, watch));
exports.default = gulp.series(clean, build);