forked from igdmapps/igdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
29 lines (24 loc) · 816 Bytes
/
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
'use strict';
var gulp = require('gulp');
var pug = require('gulp-pug');
gulp.task('html', function () {
return gulp.src(['./browser/views/**/*.pug', '!./browser/views/**/_*.pug'])
.pipe(pug({pretty: true}))
.pipe(gulp.dest(function (file) {
return './browser/'
}));
});
gulp.task('website-html', function () {
return gulp.src(['./docs-src/**/*.pug', '!./docs-src/**/_*.pug'])
.pipe(pug({ pretty: true }))
.pipe(gulp.dest(function (file) {
// Keeps folder and file structure intact
let base = file.base.split('docs-src/');
return './docs/' + (base[1] ? base[1] : '');
}));
});
gulp.task('watch', function(){
gulp.watch('./browser/views/**/*.pug', ['html']);
gulp.watch('./docs-src/**/*.pug', ['website-html']);
})
gulp.task('build', gulp.series('html'));