forked from KardiaIO/kardia-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
71 lines (59 loc) · 1.65 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mochaTest = require('gulp-mocha');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var server = require('gulp-express');
gulp.task('server', function () {
// Start the server at the beginning of the task
require('./server.js');
//TODO: Restart the server when file changes - add a line for all files.
//gulp.watch(['server/**/*.html'], server.notify);
});
gulp.task('lint', function(){
return gulp.src([
'client/**/*.js',
'server/**/*.js',
'gulpfile.js',
'!client/lib/**',
'!client/design/**'
])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('mochaTest', function(){
return gulp.src(['tests/clientSpecs/clientSpecs.js', 'tests/serverSpecs/serverSpecs.js'])
.pipe(mochaTest());
});
gulp.task('clean', function(){
return gulp.src('dist/newConcat.js', {read: false})
.pipe(clean());
});
gulp.task('concat', function() {
return gulp.src(['**/*.js', '!client/lib/**', '!node_modules/**', '!gulpfile.js', '!client/design/**'])
.pipe(concat({ path: 'newConcat.js'}))
.pipe(gulp.dest('./dist'));
});
// Not currently watching any files
gulp.task('watch', function(){
gulp.watch(['client/**/*.js', 'server/**/*.js'], ['lint']);
});
// Run 'gulp' to lint and test your code
gulp.task('default', [
'lint',
'mochaTest',
'server'
]);
// Run 'gulp build' to check your code and create a new concatenated file
gulp.task('build', [
'lint',
'mochaTest',
'clean',
'concat'
]);
// Task for travis
gulp.task('travis', [
'lint',
'mochaTest'
]);