-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
49 lines (39 loc) · 1.04 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const gulp = require('gulp');
const del = require('del');
const cache = require('gulp-cached');
const help = require('gulp-task-listing');
const babel = require('gulp-babel');
const ext = require('gulp-ext');
const eslint = require('gulp-eslint');
function clean() {
return del(['build'])
}
function transpileBin() {
return gulp.src('bin/**/*')
.pipe(cache('bin'))
.pipe(babel())
.pipe(ext.crop())
.pipe(gulp.dest('build'))
}
function transpileLib() {
return gulp.src('lib/**/*')
.pipe(cache('lib'))
.pipe(babel())
.pipe(gulp.dest('build/lib'))
}
function copy() {
return gulp.src(['default.json'])
.pipe(gulp.dest('build'));
}
function watchFiles() {
gulp.watch('lib/**/*', build);
}
function lint() {
return gulp.src(['**/*.js', '!node_modules/**', '!build/**', '!docs/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
}
export { clean, help, transpileBin, transpileLib, copy, lint, watchFiles as watch };
const build = gulp.series(copy, transpileBin, transpileLib);
export default build;