-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
42 lines (34 loc) · 926 Bytes
/
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
var gulp = require("gulp");
var babel = require("gulp-babel");
var eslint = require("gulp-eslint");
import gulp from 'gulp';
var paths = {
scripts: {
src: ['lib/**/*.js'],
dest: 'lib/'
}
};
function lint() {
return gulp.src(['./lib/**/*.js','./index.js'])
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error
.pipe(eslint.failAfterError());
};
function watch() {
gulp.watch(paths.scripts.src, build);
};
function scripts() {
return gulp.src(paths.scripts.src)
.pipe(babel())
.pipe(gulp.dest(paths.scripts.dest));
};
var build = gulp.series(lint,scripts);
gulp.task('build', build);
gulp.task('lint', lint);
gulp.task('default', gulp.series(build,watch));
exports.build = build;
exports.watch = build;
exports.scripts = scripts;