-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
83 lines (74 loc) · 2.23 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
var gulp = require('gulp');
var connect = require('gulp-connect');
var manifest = require('gulp-manifest');
gulp.task('html', function(){
return gulp.src(['app/**/*.html', '!app/vendor/**/*'])
.pipe(connect.reload())
.pipe(gulp.dest('build/'))
});
gulp.task('css', function(){
return gulp.src(['app/**/*.css', '!app/vendor/**/*'])
.pipe(connect.reload())
.pipe(gulp.dest('build/'))
});
gulp.task('js', function(){
return gulp.src(['app/**/*.js', '!app/vendor/**/*'])
.pipe(connect.reload())
.pipe(gulp.dest('build/'))
});
gulp.task('assets', function(){
return gulp.src('app/assets/*')
.pipe(connect.reload())
.pipe(gulp.dest('build/assets'))
});
gulp.task('connect', function() {
connect.server({
root: 'build',
livereload: true
});
});
gulp.task('vendor', function() {
return gulp.src([
'app/vendor/**/font-awesome.min.css',
'app/vendor/**/dist/css/bootstrap.css',
'app/vendor/**/dist/web-font/style.css',
'app/vendor/**/dist/jquery.js',
'app/vendor/**/moment.js',
'app/vendor/**/dist/js/bootstrap.js',
'app/vendor/**/angular.js',
'app/vendor/**/angular-route.js',
'app/vendor/**/ngStorage.js',
'app/vendor/**/angular-moment.js',
'app/vendor/**/app/angular.audio.js',
'app/vendor/**/ui-bootstrap-tpls.js',
'app/vendor/**/dist/jquery.js',
'app/vendor/**/moment.js',
'app/vendor/**/dist/js/bootstrap.js',
'app/vendor/**/fonts/*.woff2',
'app/vendor/**/fonts/*.woff',
'app/vendor/**/fonts/*.tff'
])
.pipe(gulp.dest('build/vendor'))
});
gulp.task('watch', function () {
gulp.watch(['./app/**/*.html'], ['html', 'manifest']);
gulp.watch(['./app/**/*.css'], ['css', 'manifest']);
gulp.watch(['./app/**/*.js'], ['js', 'manifest']);
gulp.watch(['./assets/*.*'], ['assets', 'manifest']);
});
gulp.task('manifest', function(){
gulp.src([
'build/**/*'
], { base: './build' })
.pipe(manifest({
hash: true,
preferOnline: true,
network: ['*'],
filename: 'app.manifest',
exclude: 'app.manifest'
}))
.pipe(connect.reload())
.pipe(gulp.dest('build'));
});
gulp.task('build', [ 'html', 'css', 'js', 'assets', 'vendor', 'manifest' ]);
gulp.task('default', [ 'build', 'connect', 'watch' ]);