-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
39 lines (34 loc) · 1.05 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
var projectName = 'responsive-tester',
gulp = require('gulp'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
del = require('del'),
karmaServer = require('karma').Server;
gulp.task('scripts', function() {
return gulp.src('source/*.js')
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default'))
.pipe(concat(projectName + '.js'))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Scripts task complete' }));
});
gulp.task('test', function (done) {
new karmaServer({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
gulp.task('clean', function() {
return del(['dist']);
});
gulp.task('watch', function() {
gulp.watch('source/*.js', ['scripts']);
});
gulp.task('default', ['clean'], function() {
gulp.start('test', 'scripts', 'watch');
});