forked from queue-hero/queue-hero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
98 lines (87 loc) · 2.81 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
94
95
96
97
98
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var karma = require('gulp-karma');
var bs = require('browser-sync');
var reload = bs.reload;
var when = require('gulp-if');
var shell = require('gulp-shell');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var clean = require('gulp-clean');
var gutil = require('gulp-util');
var filesize = require('gulp-filesize');
var bower = require('gulp-bower');
var jsScripts = [
'client/bower_components/angular/angular.min.js',
'client/bower_components/angular-ui-router/release/angular-ui-router.min.js',
'client/bower_components/socket.io-client/socket.io.js',
'client/bower_components/angular-messages/angular-messages.min.js',
'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js',
'client/bower_components/angular-animate/angular-animate.min.js',
'client/bower_components/ng-file-upload/ng-file-upload.min.js',
'client/bower_components/angular-cookies/angular-cookies.min.js',
'client/bower_components/angular-mapbox/dist/angular-mapbox.min.js',
'client/bower_components/moment/min/moment-with-locales.min.js',
'client/bower_components/lodash/lodash.min.js',
'client/bower_components/mapbox.js/mapbox.js',
'client/src/**/*.js',
'client/src/app.js'
];
// the paths to our app files
var paths = {
// all our client app js files, not including 3rd party js files
scripts: ['client/src/**/*.js'],
html: ['client/src/**/*.html'],
styles: ['client/styles/*.css'],
test: ['specs/**/*.js'],
images: ['client/images/*']
};
gulp.task('clean', function() {
return gulp.src('build', {
read: false
})
.pipe(clean());
});
gulp.task('karma', shell.task([
'karma start'
]));
gulp.task('convert-js', function() {
//specifc order
return gulp.src(jsScripts)
.pipe(concat('queueHero.min.js', {
newLine: '\n'
}))
.pipe(uglify())
.pipe(gulp.dest('build/'))
.pipe(filesize())
.on('error', gutil.log);
});
gulp.task('copy-css', function() {
gulp.src(paths.styles, {
base: './client/styles'
})
.pipe(gulp.dest('./build/styles'));
});
gulp.task('copy-images', function() {
gulp.src(paths.images, {
base: './client/images'
})
.pipe(gulp.dest('./build/images'));
});
gulp.task('copy-html', function() {
gulp.src(paths.html, {
base: './client/'
})
.pipe(gulp.dest('./build/'));
});
gulp.task('bower', function() {
return bower()
.pipe(gulp.dest('build/bower_components'));
});
gulp.task('move-index', function() {
gulp.src('client/index_gulp.html')
.pipe(rename('index.html'))
.pipe(gulp.dest('./build/'));
});
gulp.task('default', ['convert-js', 'copy-html', 'copy-css', 'copy-images', 'move-index','bower']);