-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
66 lines (55 loc) · 1.33 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
var gulp = require('gulp');
var karma = require('gulp-karma');
var jshint = require('gulp-jshint');
var connect = require('connect');
var serveStatic = require('serve-static');
var bump = require('gulp-bump');
var jsmin = require('gulp-jsmin');
var rename = require('gulp-rename');
var testFiles = [
'test/*spec.js'
];
var watchFiles = [
'test/*spec.js',
'angular.embedly.js'
];
gulp.task('run-tests', function() {
return gulp.src('./nonexistent')
.pipe(karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
throw err;
});
});
gulp.task('lint', function() {
gulp.src(watchFiles)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('watch', function() {
gulp.start('test');
gulp.watch(watchFiles, function() {
gulp.start('test');
});
});
gulp.task('test', ['lint', 'run-tests']);
gulp.task('default', ['watch']);
gulp.task('connect', function() {
connect.server();
});
gulp.task('server', function() {
var app = connect().use(serveStatic('.')).listen(8080);
});
gulp.task('bump', function(){
gulp.src('./*.json')
.pipe(bump({ type:'minor' }))
.pipe(gulp.dest('./'));
});
gulp.task('minify', function () {
gulp.src('angular.embedly.js')
.pipe(jsmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('.'));
});