This repository has been archived by the owner on Sep 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
95 lines (84 loc) · 2.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var gulp = require('gulp');
var rename = require("gulp-rename");
const babel = require('gulp-babel');
const del = require('del');
gulp.task('clean',function(){
return del(['patch']);
});
gulp.task('export1', function () {
return gulp.src(
['public_html/**/*.*'
, '!public_html/js/**/*.*'
, '!public_html/kvn/backend/**/*.*'
, '!public_html/kvn/images/bkgd/**/*.*'
, '!public_html/kvn/images/char/**/*.*'
, '!public_html/kvn/scripts/**/*.*'
, '!public_html/kvn/sound/**/*.*'
, '!public_html/kvn/config.js'
, '!public_html/kvn/config_def.js'
])
.pipe(gulp.dest(['export']));
});
gulp.task('export2', function () {
var a = new Promise(function (resolve) {
gulp.src(['public_html/js/**/*.*']).pipe(babel({
presets: ['env']
})).pipe(gulp.dest(['export/js'])).on('end', function () {
resolve();
});;
});
var b = new Promise(function(resolve){
gulp.src(['public_html/kvn/backend/**/*.*']).pipe(babel({
presets: ['env']
})).pipe(gulp.dest(['export/kvn/backend'])).on('end', function () {
resolve();
});;
});
var e = new Promise(function(resolve){
gulp.src(['public_html/kvn/config_def.js'])
.pipe(rename(function (path) {
path.basename = "config";
}))
.pipe(gulp.dest(['export/kvn/'])).on('end', function () {
resolve();
});;
});
var d = new Promise(function(resolve){
gulp.src(['*.*'],{read:false})
.pipe(gulp.dest('export/kvn/sound'))
.pipe(gulp.dest('export/kvn/images/char'))
.pipe(gulp.dest('export/kvn/images/bkgd')).on('end', function () {
resolve();
});
});
return Promise.all([a, b,d,e]);
});
gulp.task('patch', function () {
var a = new Promise(function (resolve) {
gulp.src(
['export/css/**/*.*'
, '!export/css/config.css'
]).pipe(gulp.dest(['patch/css'])).on('end', function () {
resolve();
});
;
});
var b = new Promise(function (resolve) {
gulp.src(
['export/kvn/**/*.*'
, '!export/kvn/images/**/*.*'
, '!export/kvn/scripts/**/*.*'
, '!export/kvn/sound/**/*.*'
, '!export/kvn/config.js'])
.pipe(gulp.dest(['patch/kvn'])).on('end', function () {
resolve();
});
});
return Promise.all([a, b]);
});
gulp.task('default', gulp.series('clean','export1', 'export2', 'patch'));