-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
73 lines (66 loc) · 1.87 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
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
connect = require('gulp-connect'),
open = require('gulp-open'),
jsdoc = require('gulp-jsdoc'),
ngAnnotate = require('gulp-ng-annotate'),
diff = require('gulp-diff'),
sass = require('gulp-sass');
/**
* preview changes from ng-annotate
* @todo add into the build process
*/
gulp.task('build-annotate', function() {
gulp.src(['!./app/bower_components/**', './app/*.js', './app/**/*.js'])
.pipe(ngAnnotate())
.pipe(diff())
.pipe(diff.reporter({
fail: true
}));
});
/* force live reload to refresh browser */
gulp.task('force-reload', function() {
gulp.src('./**/*.html')
.pipe(livereload());
});
/* generate documentation */
gulp.task('jsdoc', function() {
gulp.src(['!./app/bower_components/**', './app/*.js', './app/**/*.js']).pipe(jsdoc('./documentation'));
});
/* start the web server and open a browser */
gulp.task('startdev', function() {
gulp.src('./app/index.html')
.pipe(open('', {
url: 'http://localhost:8999',
app: 'chrome'
}));
});
/* compile sass files */
gulp.task('css', function() {
gulp.src('./app/content/css/*.scss')
.pipe(sass())
.pipe(gulp.dest('./app/content/css'));
});
/* start watching files to trigger a reload */
gulp.task('watch', function() {
connect.server({
port: 8999,
root: 'app/'
});
livereload.listen({
quiet: false
});
gulp.watch([
'!./app/bower_components/**', // ignore bower components
'./app/app.*.js', //core application files
'./app/index.html', //root html file
'./app/**/*.js', //all js files
'./app/content/**/*.scss', //all sass files
'./app/**/*.html', //all html files
'./app/portal/*.*'
], ['jsdoc', 'css', 'force-reload']);
});
/* task definitions */
gulp.task('default', ['watch', 'startdev']);
gulp.task('restart', ['watch']);
gulp.task('doc', ['jsdoc']);