-
Notifications
You must be signed in to change notification settings - Fork 22
/
gulpfile.js
37 lines (30 loc) · 932 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
const del = require('del');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const babel = require('gulp-babel');
const eslint = require('gulp-eslint');
const excludeGitignore = require('gulp-exclude-gitignore');
// Initialize the babel transpiler so ES2015 files gets compiled when they're loaded
require('@babel/register');
gulp.task('lint', function () {
return gulp.src('**/*.js')
.pipe(plumber())
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('watch', function () {
gulp.watch(['lib/**/*.js', 'test/**'], ['test']);
});
gulp.task('clean', function () {
return del('dist');
});
gulp.task('babel', () => {
return gulp.src('lib/**/*.js')
.pipe(plumber())
.pipe(babel())
.pipe(gulp.dest('dist'));
});
gulp.task('prepare', gulp.series('clean', 'babel'));
gulp.task('default', gulp.series('lint'));