-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathgulpfile.babel.js
More file actions
30 lines (26 loc) · 716 Bytes
/
gulpfile.babel.js
File metadata and controls
30 lines (26 loc) · 716 Bytes
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
import { dest, series, src } from 'gulp';
import babel from 'gulp-babel';
import del from 'gulp-clean';
import eslint from 'gulp-eslint';
import sourcemaps from 'gulp-sourcemaps';
function build () {
return src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(dest('dist'));
}
function clean () {
return src(['dist', 'reports'], { allowEmpty : true, read : false })
.pipe(del());
}
function lint () {
return src(['gulpfile.babel.js', 'src/**/*.js', 'test/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
exports.build = build;
exports.clean = clean;
exports.default = series(clean, lint, build);
exports.lint = lint;