-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgulpfile.js
52 lines (42 loc) · 1.11 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
48
49
50
51
52
'use strict';
var gulp = require('gulp'),
pkg = require('./package.json'),
paths = {
dest: './dist',
gulp: './gulpfile.js',
src: './index.js',
test: './test/*.{e2e,spec}.js'
};
gulp.task('default', ['build']);
gulp.task('lint', function () {
var jscs = require('gulp-jscs'),
jshint = require('gulp-jshint');
return gulp
.src([paths.gulp, paths.src, paths.test])
.pipe(jscs())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('cover', function () {
var istanbul = require('gulp-istanbul');
return gulp
.src(paths.src)
.pipe(istanbul());
});
gulp.task('test', ['lint', 'cover'], function () {
var istanbul = require('gulp-istanbul'),
mocha = require('gulp-mocha');
return gulp
.src(paths.test)
.pipe(mocha({ reporter: 'spec' }))
.pipe(istanbul.writeReports());
});
gulp.task('build', ['test'], function () {
var browserify = require('browserify'),
source = require('vinyl-source-stream'),
options = { standalone: 'handlebars-group-by' };
return browserify(paths.src, options)
.bundle()
.pipe(source(pkg.name + '.js'))
.pipe(gulp.dest(paths.dest));
});