-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
47 lines (39 loc) · 976 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
39
40
41
42
43
44
45
46
47
'use strict';
const gulp = require('gulp');
const del = require('del');
const jshint = require('gulp-jshint');
const babel = require('gulp-babel');
const mocha = require('gulp-mocha');
gulp.task('lint', () => {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('clean', () => {
return del(['test', 'lib']);
});
gulp.task('copy', () => {
gulp.src('src/README.md')
.pipe(gulp.dest('./'))
});
gulp.task('lib', ['clean'], () => {
gulp.src('src/lib/*.js')
.pipe(babel({
presets: ['env'],
plugins: ['transform-runtime']
}))
.pipe(gulp.dest('lib'))
});
gulp.task('test', ['clean'], () => {
gulp.src('src/test/*.js')
.pipe(babel({
presets: ['env'],
plugins: ['transform-runtime']
}))
.pipe(gulp.dest('test'))
});
gulp.task('build', ['lint', 'clean', 'copy', 'lib', 'test']);
gulp.task('default', () => {
gulp.src('test/*.js', {read: false})
.pipe(mocha({reporter: 'spec'}))
});