-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
44 lines (37 loc) · 1.12 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
var gulp = require('gulp');
var useref = require('gulp-useref');
var es = require('event-stream');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-clean-css');
var ngAnnotate = require('gulp-ng-annotate');
var gulpif = require('gulp-if');
const zip = require('gulp-zip');
var del = require('del');
var dest = './dest';
function clean() {
return del(['dest']);
}
function userefHtml(cb){
cb();
return es.merge(
gulp.src(['bsvirtualkb.html'])
.pipe(useref())
.pipe(gulp.dest(dest)),
gulp.src(['autorun.brs', 'bsvirtualkb.json'])
.pipe(gulp.dest(dest))
);
}
function zipFiles(){
return gulp.src(['bsvirtualkb.html', 'bsvirtualkb.json'])
.pipe(useref())
.pipe(gulpif('*.js', ngAnnotate()))
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', minifyCss()))
.pipe(zip('keyboard.zip'))
.pipe(gulp.dest('./presentation'));
}
var build = gulp.series(clean, userefHtml, zipFiles);
exports.clean = clean;
exports.useref = userefHtml;
exports.zip = zipFiles;
exports.default = build;