-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
46 lines (37 loc) · 881 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
const gulp = require('gulp');
const gulpInclude = require('gulp-file-include');
const gulpWatch = require('gulp-watch');
const assets = [
'./css/**/*',
'./fonts/**/*',
'./images/**/*',
'./js/**/*'
];
const layouts = [
'./layouts/**/*'
];
const includeFiles = [
'./pages/*.html'
];
const buildDir = './';
gulp.task('copy-assets', function () {
return gulp.src(assets, {base: '.'})
.pipe(gulp.dest(buildDir))
});
gulp.task('include-html', function () {
return gulp.src(includeFiles)
.pipe(gulpInclude())
.pipe(gulp.dest(buildDir));
});
gulp.task('build', ['include-html'], function (cb) {
return cb();
});
gulp.task('dev', ['build'], function (cb) {
return gulpWatch(
assets.concat(layouts).concat(includeFiles),
function () {
gulp.start('build');
}
);
});