-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
37 lines (31 loc) · 834 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
35
36
37
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
gulp.task('lint', function() {
gulp.src(['router.js', 'tests/spec/*.js'])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('minify', function() {
gulp.src('router.js')
.pipe(uglify())
.pipe(rename('router.min.js'))
.pipe(gulp.dest('.'));
});
// The default task (called when you run `gulp`)
gulp.task('default', function(){
gulp.run('lint', 'minify');
// Watch files and run tasks if they change
gulp.watch('router.js', function() {
gulp.run('lint', 'minify');
});
gulp.watch('tests/spec/*.js', function() {
gulp.run('lint');
});
});
// CI build
gulp.task('ci', function(){
gulp.run('lint');
});