-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
36 lines (29 loc) · 857 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
/* eslint import/no-extraneous-dependencies: 'off' */
/* eslint arrow-body-style: 'off' */
import gulp from 'gulp';
import eslint from 'gulp-eslint';
import babel from 'gulp-babel';
import sourcemaps from 'gulp-sourcemaps';
import del from 'del';
const paths = {
src: 'src',
dest: 'lib',
lint: ['gulpfile.babel.js', 'src/**/*.js', 'test/**/*.js'],
};
gulp.task('clean', () => del(`${paths.dest}/*`));
gulp.task('build', ['clean'], () => {
return gulp.src(`${paths.src}/**/*.js`)
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.dest));
});
gulp.task('lint', () => {
return gulp.src(paths.lint)
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('watch', ['build', 'lint'], () => {
gulp.watch(paths.lint, ['build', 'lint']);
});
gulp.task('default', ['build', 'lint']);