-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
73 lines (61 loc) · 2.15 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
var gulp = require('gulp');
var plugins = require("gulp-load-plugins")({lazy:false});
gulp.task('scripts', function(){
//combine all js files of the web
gulp.src(['!./web/**/*_test.js','./web/**/*.js'])
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'))
.pipe(plugins.concat('app.js'))
.pipe(gulp.dest('./app/web'));
});
gulp.task('templates',function(){
//combine all template files of the web into a js file
gulp.src(['!./web/index.html',
'./web/**/*.html'])
.pipe(plugins.angularTemplatecache('templates.js',{standalone:true}))
.pipe(gulp.dest('./app/web'));
});
gulp.task('css', function(){
gulp.src('./web/**/*.css')
.pipe(plugins.concat('app.css'))
.pipe(gulp.dest('./app/web'));
});
gulp.task('vendorJS', function(){
//concatenate vendor JS files
gulp.src(['!./bower_components/**/*.min.js',
'./bower_components/**/*.js'])
.pipe(plugins.concat('lib.js'))
.pipe(gulp.dest('./app/web'));
});
gulp.task('vendorCSS', function(){
//concatenate vendor CSS files
gulp.src(['!./bower_components/**/*.min.css',
'./bower_components/**/*.css'])
.pipe(plugins.concat('lib.css'))
.pipe(gulp.dest('./app/web'));
});
gulp.task('copy-index', function() {
gulp.src('./web/index.html')
.pipe(gulp.dest('./app/web'));
});
gulp.task('watch',function(){
gulp.watch([
'build/**/*.html',
'build/**/*.js',
'build/**/*.css'
], function(event) {
return gulp.src(event.path)
.pipe(plugins.connect.reload());
});
gulp.watch(['./web/**/*.js','!./web/**/*test.js'],['scripts']);
gulp.watch(['!./web/index.html','./web/**/*.html'],['templates']);
gulp.watch('./web/**/*.css',['css']);
gulp.watch('./web/index.html',['copy-index']);
});
gulp.task('connect', plugins.connect.server({
root: ['build'],
port: 9000,
livereload: true
}));
gulp.task('devel',['connect','scripts','templates','css','copy-index','vendorJS','vendorCSS','watch']);
gulp.task('default',['scripts','templates','css','copy-index','vendorJS','vendorCSS']);