-
Notifications
You must be signed in to change notification settings - Fork 16
/
gulpfile.js
87 lines (76 loc) · 1.65 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var webserver = require('gulp-webserver');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var plato = require('gulp-plato');
gulp.task('build-concat', function() {
gulp.src("./lib/*.js")
.pipe(concat('angular-noVNC.js'))
.pipe(gulp.dest('./dist'))
});
gulp.task('build-uglify', function() {
gulp.src("./lib/*.js")
.pipe(concat('angular-noVNC.min.js'))
.pipe(uglify({
mangle: true,
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('build', ['build-concat', 'build-uglify']);
gulp.task('webserver', function() {
gulp.src('./')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('watch', function () {
gulp.watch(['./lib/*.js', 'index.html'], ['build']);
});
var jshintOpts = {
strict : true,
unused : true,
curly : true,
eqeqeq : true,
undef : true,
eqnull : true,
nonew : true,
plusplus : false,
browser : true,
noempty : true,
newcap : false,
immed : true,
latedef : true,
quotmark : true,
multistr : true,
bitwise : false,
indent : 2,
maxlen : 150,
globals : {
angular: true,
console: true,
Base64: true,
Websock_native: true,
ActiveXObject: true,
escape: true,
keysyms: true,
}
};
gulp.task('lint', function() {
return gulp.src("./lib/*.js")
.pipe(jshint(jshintOpts))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('plato', function () {
return gulp.src('./lib/*.js')
.pipe(plato('plato', {
jshint: {
options: jshintOpts
},
complexity: {
trycatch: true
}
}));
});
gulp.task('default', ['build', 'webserver', 'watch']);