forked from thomas-crane/nrelay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (40 loc) · 1.1 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
var gulp = require('gulp');
var ts = require('gulp-typescript');
var runSequence = require('run-sequence');
var tsProject = ts.createProject('tsconfig.json');
var watch = require('gulp-watch');
var del = require('del');
gulp.task('default', function (callback) {
return runSequence('clean', 'ts', 'copy-files', function (error) {
if (error) {
console.error(error);
}
callback(error);
});
});
gulp.task('ts', function () {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest('dist'));
});
gulp.task('copy-files', function () {
return gulp.src('src/**/*.json')
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function (callback) {
return watch('src/**/*.ts', function () {
runSequence('ts', function (error) {
if (error) {
console.error(error);
}
callback(error);
});
});
});
gulp.task('clean', function (callback) {
return del([
'src/services/updater-assets/decompiled/',
'src/services/updater-assets/client.swf',
'dist/'
]);
})