forked from amir20/phantomjs-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.babel.js
More file actions
34 lines (27 loc) · 802 Bytes
/
gulpfile.babel.js
File metadata and controls
34 lines (27 loc) · 802 Bytes
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
import gulp from "gulp";
import babel from "gulp-babel";
import copy from "gulp-copy";
import newer from "gulp-newer";
import del from "del";
import {spawn} from "child_process";
const lib = 'lib';
gulp.task('clean', () => del(['lib/']));
gulp.task('build', () => {
return gulp.src('src/**/*.js')
.pipe(newer(lib))
.pipe(babel())
.pipe(gulp.dest(lib));
});
gulp.task('copy-snapshots', () => {
return gulp.src('src/**/*.snap')
.pipe(newer(lib))
.pipe(copy(lib, {prefix: 1}));
});
gulp.task('test', ['build', 'copy-snapshots'], done => {
const cmd = spawn('jest', {stdio: 'inherit'});
cmd.on('close', code => done(code));
});
gulp.task('watch', ['build'], () => {
gulp.watch('src/**/*.js', ['build']);
});
gulp.task('default', ['watch']);