-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathgulpfile.js
More file actions
37 lines (30 loc) · 804 Bytes
/
Copy pathgulpfile.js
File metadata and controls
37 lines (30 loc) · 804 Bytes
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
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
var paths = {
scripts: 'src/*.js',
tests: 'test/*.js'
};
gulp.task('test', function () {
gulp.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
gulp.src(paths.tests)
.pipe(mocha());
});
gulp.task('build', function () {
gulp.src('src/fake-identity.js')
.pipe(browserify({
insertGlobals: true,
debug: true
}))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['test', 'build'], function () {
gulp.watch([paths.scripts, paths.tests], ['test', 'build']);
});
gulp.task('default', ['test', 'build', 'watch']);