-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
93 lines (69 loc) · 2.64 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
91
92
93
var gulp = require('gulp'),
del = require('del'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCss = require('gulp-minify-css'),
removeCode = require('gulp-remove-code');
var clientJS = [
'client/app.js',
'client/directives/**/*',
'client/services/**/*',
'client/controllers/**/*'
];
gulp.task('clean', function() {
return del.sync(['public/']);
});
gulp.task('vendor', function vendorTask() {
gulp.src('client/vendor/bootstrap/dist/**/*')
.pipe(gulp.dest('public/vendor/bootstrap/'));
gulp.src(['client/vendor/angular/angular.min.js', 'client/vendor/angular/angular.min.js.gzip'])
.pipe(gulp.dest('public/vendor/angular/'));
gulp.src(['client/vendor/angular-ui-router/release/angular-ui-router.min.js'])
.pipe(gulp.dest('public/vendor/angular-ui-router/'));
gulp.src(['client/vendor/pickadate/lib/**/*'])
.pipe(gulp.dest('public/vendor/pickadate/'));
gulp.src(['client/vendor/angular-loading-bar/**/*'])
.pipe(gulp.dest('public/vendor/angular-loading-bar/'));
gulp.src(['client/vendor/underscore/**/*'])
.pipe(gulp.dest('public/vendor/underscore/'));
gulp.src(['client/vendor/d3/**/*'])
.pipe(gulp.dest('public/vendor/d3/'));
gulp.src(['client/vendor/jquery/dist/**/*'])
.pipe(gulp.dest('public/vendor/jquery/'));
});
gulp.task('client', function clientTask() {
gulp.src('client/app.js')
.pipe(gulp.dest('public/'));
gulp.src('client/partials/**/*')
.pipe(gulp.dest('public/partials/'));
gulp.src('client/directives/**/*')
.pipe(gulp.dest('public/directives/'));
gulp.src('client/services/**/*')
.pipe(gulp.dest('public/services/'));
gulp.src('client/controllers/**/*')
.pipe(gulp.dest('public/controllers/'));
gulp.src('client/css/**/*')
.pipe(gulp.dest('public/css/'));
gulp.src('client/index.html')
.pipe(removeCode({development: true}))
.pipe(gulp.dest('public/'));
});
gulp.task('client-dist', function clientDistTask() {
gulp.src(clientJS )
.pipe(concat('all.js'))
.pipe(uglify())
.pipe(gulp.dest('public/'));
gulp.src('client/css/**/*')
.pipe(minifyCss())
.pipe(gulp.dest('public/css/'));
gulp.src('client/partials/**/*')
.pipe(gulp.dest('public/partials/'));
gulp.src('client/index.html')
.pipe(removeCode({production: true}))
.pipe(gulp.dest('public/'));
});
gulp.task('build-dev', ['clean', 'vendor', 'client']);
gulp.task('build', ['clean', 'vendor', 'client-dist']);
gulp.task('watch', function watchTask() {
gulp.watch('client/**', ['client']);
});