-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (34 loc) · 946 Bytes
/
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
require("babel-register")();
var gulp = require('gulp');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var serve = require('gulp-serve');
var mocha = require('gulp-mocha');
var srcList = [
// load ordering
'./src/util.js',
'./src/negamax.js',
'./src/main.js'
];
gulp.task('default', function() {
}) ;
gulp.task('serve', serve('.'));
gulp.task('test', function () {
return gulp.src('test/*.js', {read: false})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task("build", function () {
return gulp.src(srcList)
.pipe(babel({
presets: ['es2015']
}))
.pipe(sourcemaps.init())
.pipe(concat('bot.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest("."));
});
gulp.task('watch', function () {
gulp.watch(['./src/*.js', './test/*.js'], ['test', 'build']);
});