-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.babel.js
44 lines (39 loc) · 1 KB
/
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
43
44
import { argv } from 'yargs';
import gulp from 'gulp';
import sourcemaps from 'gulp-sourcemaps';
import nodemon from 'gulp-nodemon';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import eslint from 'gulp-eslint';
import Cache from 'gulp-file-cache';
import del from 'del';
const cache = new Cache();
gulp.task('clean', () => {
return del(['.dist/**', '.gulp-cache']);
});
gulp.task('jd', () => {
return gulp.src('./src/**/*.js')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(cache.filter())
.pipe(eslint())
.pipe(eslint.format())
.pipe(babel())
.pipe(cache.cache())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./.dist'));
});
gulp.task('jd:develop', gulp.series('jd', () => {
nodemon({
script: '.dist/jd.js',
args: ['--role', argv.role],
watch: ['.'],
ext: 'js yaml',
ignore: ['node_modules/', '.dist/'],
tasks: ['jd'],
env: {
'DEBUG': 'rascal:Vhost',
},
});
}));
gulp.task('default', gulp.series('jd:develop'));