-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
59 lines (48 loc) · 1.41 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
const { src, dest, parallel, series, watch } = require('gulp');
const del = require('del');
const path = require('path');
const ssi = require('gulp-ssi');
const lec = require('gulp-line-ending-corrector');
function clean() {
return del(['dist/**']);
}
function copyReveal() {
const rbase = 'node_modules/reveal.js';
return src(
[
path.join(rbase, 'dist/**/*'), path.join(rbase, 'js/**/*.js'),
path.join(rbase, 'lib/**/*'), path.join(rbase, 'plugin/**/*')
],
{base: rbase})
.pipe(dest('dist'));
}
function copyJquery() {
return src('node_modules/jquery/dist/jquery.min.js').pipe(dest('dist/js'));
}
function copyHtml() {
return src('*.html').pipe(ssi()).pipe(dest('dist'));
}
function copyCss() {
return src('*.css').pipe(dest('dist/css'));
}
function copyHeaders() {
return src(['headers.js']).pipe(dest('dist/js'));
}
function copyImages(cb) {
return src('images/**/*').pipe(dest('dist/images'));
}
function copyMarkdown(cb) {
return src(['*.md', '!README.md'])
.pipe(ssi())
.pipe(lec())
.pipe(dest('dist'));
}
const defaultTasks = series(parallel(copyHtml, copyCss, copyHeaders, copyImages, copyMarkdown), copyReveal, copyJquery);
exports.clean = clean;
exports.default = defaultTasks;
exports.watch = function() {
watch(
['*.html', '*.css', 'headers.js', 'images/**/*', '*.md'],
{ ignoreInitial: false },
defaultTasks);
}