-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
43 lines (36 loc) · 1.11 KB
/
gulpfile.js
File metadata and controls
43 lines (36 loc) · 1.11 KB
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
var gulp = require('gulp'),
gutil = require('gulp-util'),
jshint = require('gulp-jshint')
concat = require('gulp-concat-util')
Server = require('karma').Server,
merge = require('merge-stream');
gulp.task('default', ['watch'], function() {
return gutil.log("Gulp is running...");
});
// configure the jshint task
gulp.task('lint', function() {
var sourceFiles = gulp.src('./app/js/**/*.js')
//.pipe(jshint())
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
var testFiles = gulp.src('./app/test/**/*.js')
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
return merge(sourceFiles, testFiles);
});
// configure which files to watch
gulp.task('watch', function() {
gulp.watch('./app/js/**/*.js', ['jshint']);
});
gulp.task('build-js', function() {
return gulp.src('./app/js/{,*/}*.js')
.pipe(concat('main.js'))
.pipe(gulp.dest('./public/assets/js'));
});
// run tests once then exit
gulp.task('test', function(done) {
new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});