forked from boyaq/wechat-payment-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (28 loc) · 953 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
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const mocha = require('gulp-mocha');
const watch = require('gulp-watch');
require('babel-core/register');
var jsFiles = ['src/*.js', '*.js', 'tests/*.js'];
gulp.task('build', () => {
return gulp.src('src/*')
.pipe(babel({
plugins: ['transform-runtime'],
presets: ['es2015']
}))
.pipe(gulp.dest('lib'));
});
gulp.task('watch', ['build'], () => {
return watch(jsFiles, { ignoreInitial: false }, () => {
gulp.src('tests/*', { read: false })
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha())
});
});
gulp.task('test', () => {
gulp.src('tests/*', { read: false })
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha())
});