-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
55 lines (49 loc) · 1.47 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
var gulp = require('gulp');
screeps = require('gulp-screeps'),
watch = require('gulp-watch'),
credentials = require('./credentials.js'),
ts = require('gulp-typescript'),
git = require('git-rev'),
addsrc = require('gulp-add-src');
gulp.task('screeps', function() {
// gulp.src('dist/*.js')
// .pipe(screeps(credentials));
var tsResult = gulp.src(['code/ts/**.ts', 'code/ts/*/**.ts', 'code/dts/**.ts', "./node_modules/screeps-typescript-declarations/dist/screeps.d.ts"])
.pipe(ts({
// noImplicitAny: true,
out: 'main.js',
// declaration: true,
noExternalResolve: true,
// module: 'commonjs',
// module: 'amd',
// module: 'umd',
// module: 'system',
// moduleResolution: 'node',
target: 'ES6',
removeComments: true,
}));
// var js = gulp.src('code/lib/**.js');
// console.log(js);
/* Use this one if you want the definitions to be output as well: */
// return merge([
// tsResult.dts.pipe(gulp.dest('public/definitions')),
// tsResult.js.pipe(gulp.dest('public/js'))
// ]).pipe(browserSync.stream());
// tsResult.js;
git.branch(function (branch) {
if (branch === "test"){
credentials.ptr = true;
}else{
delete credentials.ptr;
}
tsResult.js
.pipe(addsrc('code/lib/**.js'))
.pipe(gulp.dest('.cache'))
.pipe(screeps(credentials));
});
});
gulp.task('default', ['screeps'], function(){
// gulp.watch("dist/*.js", ['screeps']);
gulp.watch("code/*/**.ts", ['screeps']);
gulp.watch("code/ts/*/**.ts", ['screeps']);
});