-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgulpfile.js
42 lines (37 loc) · 981 Bytes
/
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
var gulp = require('gulp')
, concat = require('gulp-concat')
, uglify = require('gulp-uglify')
, bower = require('gulp-bower-files')
, rename = require('gulp-rename')
, ngmin = require('gulp-ngmin');
gulp.task('bower', function() {
bower({
paths: {
bowerDirectory : 'client/bower_components',
bowerJson : 'client/bower.json'
}
}).pipe(rename({dirname: ''}))
.pipe(gulp.dest('client/src/lib'));
});
gulp.task('scripts', function() {
var scripts = [
'client/src/lib/angular.js',
'client/src/lib/lodash.compat.js',
'client/src/lib/*.js',
'client/src/js/app.js',
'client/src/js/*.js'
];
return gulp.src(scripts)
.pipe(ngmin())
.pipe(concat('index.min.js'))
.pipe(uglify())
.pipe(gulp.dest('client'));
});
gulp.task('watch', function() {
gulp.watch([
'client/src/lib/*.js',
'client/src/js/*.js',
'client/bower.json'
], ['default']);
});
gulp.task('default', ['bower', 'scripts']);