-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
38 lines (33 loc) · 882 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
// gulp jingtum base lib to front enabled js lib
'use strict';
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('build', 'eslint'));
gulp.task('dev', gulp.parallel('watch', 'eslint'));