forked from computernewb/collab-vm-admin-web-app-1.2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
41 lines (35 loc) · 1.19 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
inject = require('gulp-inject'),
htmlmin = require('gulp-htmlmin'),
uglify = require('gulp-uglify'),
fs = require('fs');
function JsTask() {
return gulp.src(['src/js/guacamole/**/*.js', 'src/js/collab-vm/common.js', 'src/js/collab-vm/admin.js'])
.pipe(concat('admin.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build/admin'));
};
function ResTask() {
return gulp.src('src/res/**/*', { dot: true /* Include view/.htaccess */ })
.pipe(gulp.dest('build'));
};
function HtmlTask() {
return gulp.src('src/html/admin/*.html')
.pipe(inject(gulp.src(['build/*.css'], {read: false}), { ignorePath: 'build', addPrefix: '..', addRootSlash: false }))
.pipe(inject(gulp.src(['build/admin/admin.min.js'], {read: false}), { ignorePath: 'build/admin', addRootSlash: false }))
.pipe(htmlmin(JSON.parse(fs.readFileSync('html-minifier.conf', 'utf8'))))
.pipe(gulp.dest('build/admin'));
};
function GuacTask() {
return gulp.src('src/js/guacamole/*.js')
.pipe(concat('guacamole.min.js'))
.pipe(uglify())
.pipe(gulp.dest('src/html'));
};
exports.guacamole = GuacTask;
exports.default = gulp.series(
JsTask,
ResTask,
HtmlTask
);