-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (57 loc) · 1.68 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
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var connect = require('gulp-connect');
var rollup = require('rollup-stream');
var concat = require('gulp-concat');
var HTML_FILES = ['index.html'];
gulp.task('html', function () {
gulp.src(HTML_FILES).pipe(connect.reload());
});
gulp.task('concat-css', function () {
return gulp.src([
'./lib/bootstrap.min.css',
'./lib/ie10-viewport-bug-workaround.css',
'./lib/non-responsive.css',
'./lib/leaflet.css',
'./lib/angular-datatables.min.css',
'./lib/datatables.bootstrap.min.css'
])
.pipe(concat('vendors.bundle.css'))
.pipe(gulp.dest('.'));
});
gulp.task('concat-scripts', function () {
return gulp.src([
'./lib/jquery.min.js',
'./lib/jquery.dataTables.min.js',
'./lib/angular.min.js',
'./lib/angular-datatables.min.js',
'./lib/angular-datatables.bootstrap.min.js',
//'./lib/bootstrap.min.js',
'./lib/rx.all.min.js',
'./lib/rx.dom.min.js',
'./lib/leaflet.js',
'./lib/polyfill.min.js'
])
.pipe(concat('vendors.bundle.js'))
.pipe(gulp.dest('.'));
});
gulp.task('serve', function() {
connect.server({
port: 8080,
livereload: true
});
});
gulp.task('bundle', function () {
return rollup('./rollup.config')
.pipe(source('quakemap.bundle.js'))
.pipe(gulp.dest('.'))
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch('./app/**/*.js', ['bundle']);
gulp.watch(HTML_FILES, ['html']);
});
gulp.task('vendors', ['concat-scripts', 'concat-css']);
gulp.task('build', ['vendors', 'bundle']);
gulp.task('development', ['build', 'serve', 'watch']);
gulp.task('default', ['build']);