-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathGulpfile.js
38 lines (33 loc) · 987 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const mocha = require('gulp-mocha');
const del = require('del');
gulp.task('clean', function () {
return del('lib');
});
gulp.task('lint', function () {
const eslint = require('gulp-eslint');
return gulp
.src(['src/**/*.js', 'test/**/*.js', 'Gulpfile.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task(
'build',
gulp.series('clean', 'lint', function () {
return gulp.src('src/**/*.js').pipe(babel()).pipe(gulp.dest('lib'));
}),
);
gulp.task(
'test',
gulp.series('build', function () {
return gulp.src('test/**.js').pipe(
mocha({
ui: 'bdd',
reporter: 'spec',
timeout: typeof v8debug === 'undefined' ? 2000 : Infinity, // NOTE: disable timeouts in debug
}),
);
}),
);