-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (32 loc) · 980 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
const path = require('path');
const gulp = require('gulp');
const concat = require('gulp-concat');
const resources = {
css: [
"./bower_components/reveal.js/css/reveal.css",
"./bower_components/reveal.js/css/theme/night.css",
"./bower_components/reveal.js/lib/css/zenburn.css",
"./css/*.css"
],
js: [
"./bower_components/reveal.js/lib/js/head.min.js",
"./bower_components/reveal.js/js/reveal.js",
"./bower_components/reveal.js/plugin/highlight/highlight.js",
"./js/*.js"
]
};
const build = (resurce) => new Promise((done) => {
gulp.src(resources[resurce])
.pipe(concat('bundle.' + resurce))
.pipe(gulp.dest('build/'))
.on('end', () => done);
});
gulp.task('default', (done) => {
return Promise.all([
build('css'),
build('js')
]).then(done);
});
gulp.task('watch', () => {
gulp.watch(['index.html', 'js/*.js', 'css/*.css'], ['default']);
});