-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (41 loc) · 1.08 KB
/
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 babel = require('gulp-babel');
const eslint = require('gulp-eslint');
const concat = require('gulp-concat');
const mocha = require('gulp-mocha');
const sm = require('gulp-sourcemaps');
gulp.task('build', ['lint'], () =>
gulp
.src('./index.js')
.pipe(sm.init())
.pipe(babel({
presets: ['es2015-node5']
}))
.pipe(sm.write())
.pipe(concat('jsonifier.js'))
.pipe(gulp.dest('./dist'))
);
gulp.task('lint', () =>
gulp
.src('./index.js')
.pipe(eslint({
config: '.eslintrc.json'
}))
.pipe(eslint.format())
);
gulp.task('test', ['build'], () =>
gulp
.src('./test/**/*.spec.js')
.pipe(mocha({
ui: 'bdd',
reporter: 'spec',
require: ['should', 'source-map-support/register'],
debug: true
}))
);
gulp.task('dev', ['build'], () => {
gulp.watch('./index.js', ['test']);
gulp.watch('./test/**/*.spec.js', ['test']);
});
gulp.task('default', ['build']);