-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.js
More file actions
34 lines (29 loc) · 887 Bytes
/
Gulpfile.js
File metadata and controls
34 lines (29 loc) · 887 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
const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const eslint = require('gulp-eslint');
const spawn = require('child_process').spawn;
gulp.task('lint', () => {
return gulp.src('src/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('build', gulp.series('lint', () => {
return gulp.src('src/**/*.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('lib'));
}));
gulp.task('test', done => {
spawn('npm', ['run', 'test:cover'], {shell: true, stdio: ['inherit', 'inherit', 'ignore']})
.on('exit', code => {
console.log('Exited with code:', code);
done();
});
});
gulp.task('watch', gulp.series('test', () => {
gulp.watch(['src/**/*.js', 'test/**/*.spec.js'], gulp.series('test'));
}));
gulp.task('default', gulp.series('test'));