forked from sahat/satellizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
90 lines (82 loc) · 2.08 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
'use strict';
var gulp = require('gulp');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var complexity = require('gulp-complexity');
var ngClassify = require('gulp-ng-classify');
var coffee = require('gulp-coffee');
var coffeelint = require('gulp-coffeelint');
var gutil = require('gutil');
var Notification = require('node-notifier');
var notifier = new Notification();
function reportError (err) {
// gutil.beep();
notifier.notify({
title: 'Error running Gulp',
message: err.message
});
gutil.log(err.message);
this.emit('end');
}
gulp.task('minify', function() {
return gulp.src('satellizer.js')
.pipe(plumber())
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(rename('satellizer.min.js'))
.pipe(gulp.dest('.'));
});
gulp.task('copy', function() {
return gulp.src('satellizer.js')
.pipe(gulp.dest('examples/client/vendor'));
});
gulp.task('complexity', function() {
return gulp.src('satellizer.js')
.pipe(complexity());
});
gulp.task('watch', function() {
gulp.watch('satellizer.coffee', ['copy', 'coffee', 'minify']);
});
gulp.task('coffee', function() {
return gulp.src('satellizer.coffee')
.pipe(plumber(
{errorHandler: reportError}
))
.pipe(ngClassify({
animation: {
format: 'camelCase',
prefix: ''
},
constant: {
format: 'camelCase',
prefix: ''
},
controller: {
format: 'camelCase',
prefix: ''
},
factory: {
format: 'camelCase'
},
filter: {
format: 'camelCase'
},
provider: {
format: 'camelCase',
suffix: ''
},
service: {
format: 'camelCase',
suffix: ''
},
value: {
format: 'camelCase'
}
}))
.pipe(coffee()).on('error', reportError)
.pipe(coffeelint())
.pipe(gulp.dest('.'));
});
gulp.task('default', ['copy', 'coffee', 'minify', 'watch']);