-
Notifications
You must be signed in to change notification settings - Fork 130
/
gulpfile.js
95 lines (68 loc) · 2.09 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
var bower = require('./bower.json');
console.log(bower)
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cssMin = require('gulp-css');
var wrap = require("gulp-wrap");
var wrapper = '(function(window){<%= contents %>})(window);';
var pubnub = [
'bower_components/pubnub/dist/web/pubnub.min.js'
];
var map = [
'bower_components/leaflet/dist/leaflet.js',
'bower_components/google-maps/lib/Google.js',
'bower_components/Leaflet.GridLayer.GoogleMutant/Leaflet.GoogleMutant.js',
'bower_components/mapbox.js/mapbox.standalone.js',
'bower_components/eon-map/eon-map.js',
];
var chart = [
'bower_components/d3/d3.min.js',
'bower_components/c3/c3.js',
'bower_components/visibilityjs/lib/visibility.core.js',
'bower_components/visibilityjs/lib/visibility.timers.js',
'bower_components/eon-chart/pubnub-c3.js'
];
var styles = [
'bower_components/c3/c3.min.css',
'bower_components/mapbox.js/mapbox.css'
];
var images = [
'bower_components/mapbox.js/images/*'
];
var map_files = pubnub
.concat(map);
var chart_files = pubnub
.concat(chart);
var all_files = pubnub
.concat(chart)
.concat(map);
gulp.task('map', function(){
gulp.src(map_files)
.pipe(concat('eon-map.js'))
.pipe(wrap(wrapper))
.pipe(gulp.dest('v/eon-map/' + bower.dependencies['eon-map']));
});
gulp.task('chart', function(){
gulp.src(chart_files)
.pipe(concat('eon-chart.js'))
.pipe(wrap(wrapper))
.pipe(gulp.dest('v/eon-chart/' + bower.dependencies['eon-chart']));
});
gulp.task('javascript', function(){
gulp.src(all_files)
.pipe(concat('eon.js'))
.pipe(wrap(wrapper))
.pipe(gulp.dest('v/eon/' + bower.version));
});
gulp.task('css', function(){
gulp.src(styles)
.pipe(concat('eon.css'))
.pipe(gulp.dest('v/eon/' + bower.version));
});
gulp.task('images', function(){
return gulp.src(images)
.pipe(gulp.dest('v/eon-map/' + bower.dependencies['eon-map'] + '/images'))
.pipe(gulp.dest('v/eon/' + bower.version + '/images'));
});
gulp.task('default', ['map', 'chart', 'javascript', 'css', 'images']);