-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
33 lines (26 loc) · 942 Bytes
/
gulpfile.babel.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
import 'babel-polyfill'
import child_process from 'child_process'
import gulp from 'gulp'
import babel from 'gulp-babel'
import mocha from 'gulp-mocha'
import runSequence from 'run-sequence'
const SOURCES = ['src/**/*.js']
const TEST_FILES = ['test/**/*_test.js', '!test/fixtures/*.js']
gulp.task('test', ['compile'], () => {
return gulp.src(TEST_FILES)
//.pipe(mocha({ timeout: 25000, reporter: 'nyan' }))
.pipe(mocha({ timeout: 25000, reporter: 'dot' }))
})
gulp.task('compile', () => {
return gulp.src(SOURCES)
.pipe(babel())
.pipe(gulp.dest('lib'))
})
gulp.task('watch', (done) => {
gulp.watch(SOURCES.concat(TEST_FILES), ['default'])
.on('end', done)
})
gulp.task('publish', ['compile'], (done) => {
child_process.spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
});
gulp.task('default', (done) => runSequence('compile', 'test', done))