-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (31 loc) · 934 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
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const babel = require('gulp-babel');
gulp.task('eslint', function () {
return gulp.src(['src/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('build', function () {
return gulp.src('src/**/*.js')
.pipe(babel({
presets: [
["@babel/preset-env", {
"targets": {
"browsers": ["last 2 versions"],
"node": "8.11.3"
}
}]
],
plugins: [
"@babel/plugin-transform-runtime"
]
}))
.pipe(gulp.dest('lib/'))
})
gulp.task('watch', function () {
gulp.watch(['src/**/*.js'], ['eslint']);
})
gulp.task('default', gulp.parallel('eslint'));
gulp.task('dev', gulp.parallel('eslint', 'watch'));