forked from kroysemaj/jasmine-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (27 loc) · 909 Bytes
/
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
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
jasmine = require('gulp-jasmine')
karma = require('karma').Server;
gulp.task('default', ['watch']);
gulp.task('test', function(done){
new karma({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
gulp.task('jshint', function(){
return gulp.src('source/javascript/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('build-js', function(){
return gulp.src('source/javascript/**/*.js')
.pipe(sourcemaps.init())
.pipe(concat('bundle.js'))
.pipe(gutil.env.type === 'production' ? uglify() : gutil.noop())
.pipe(sourcemaps.write())
.pipe(gulp.dest('public/assets/javascript'));
});
gulp.task('watch', function(){
gulp.watch('spec/**/*.spec.js', ['test']);
gulp.watch('source/javascript/**/*.js', ['jshint', 'build-js']);
});