This repository was archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
65 lines (48 loc) · 1.32 KB
/
gulpfile.js
File metadata and controls
65 lines (48 loc) · 1.32 KB
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
60
61
62
63
64
65
var gulp = require('gulp');
var del = require('del');
var util = require('gulp-util');
gulp.task('clearBuild', function(cb){
log('Clearing current build');
del("./build/**/*", {force: true}).then(function () {
cb();
});
});
gulp.task('copyServer', ['clearBuild'], function () {
return gulp
.src(['./src/server/**/*', '!**/doc/**', '!**/logs/**', '!**/*.iml', '!./src/server/public/**'])
.pipe(gulp.dest('./build'));
});
gulp.task('copyClean',['clearBuild', 'copyServer', 'copyApp'], function(cb){
del(['./build/logs', './build/doc'], {force: true}).then(function () {
cb();
});
});
//gulp.task('copySite', ['clearBuild', 'copyServer'], function () {
//
// return gulp
// .src(['./src/website/src/**'])
// .pipe(gulp.dest('./build/public'));
//
//});
gulp.task('copyApp', ['clearBuild', 'copyServer'], function () {
return gulp
.src(['./src/client/build/**'])
.pipe(gulp.dest('./build/public/dashboard'));
});
gulp.task('build',['clearBuild', 'copyServer', 'copyApp', 'copyClean'], function(){
});
/////////////////////////////////////////////////
/*
* Handy helper functions of helpfulness
*/
function log(msg) {
if (typeof(msg) === 'object') {
for (var item in msg) {
if (msg.hasOwnProperty(item)) {
util.log(util.colors.blue(msg[item]));
}
}
} else {
util.log(util.colors.blue(msg));
}
}