-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
82 lines (71 loc) · 1.78 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
// Build GeoDash.js
var gulp = require('gulp')
, rename = require('gulp-rename')
, concat = require('gulp-concat')
, uglify = require('gulp-uglify')
, less = require('gulp-less')
gulp.task('less', function () {
gulp.src('src/style/chart.less')
.pipe(less({
paths: ['src/style']
}))
.pipe(rename('geodash.min.css'))
.pipe(gulp.dest('dist/'))
})
gulp.task('minify', function(){
gulp.src(['src/core/*.js', 'src/charts/Chart.js', 'src/charts/BarChart.js', 'src/charts/*.js'])
.pipe(concat('geodash.js'))
.pipe(gulp.dest('dist/'))
.pipe(rename('geodash.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/'))
.on('end', gulpconcat)
})
var gulpconcat = function(){
gulp.src([
'src/GeoDash.js'
, 'src/lib/d3.min.js'
, 'src/lib/mustache.js'
, 'dist/geodash.min.js'
])
.pipe(concat('geodash.min.js'))
.pipe(gulp.dest('dist/'))
gulp.src([
'src/GeoDash.js'
, 'src/lib/aight.min.js'
, 'src/lib/r2d3.min.js'
, 'src/lib/aight.d3.min.js'
, 'src/lib/mustache.js'
, 'dist/geodash.min.js'
])
.pipe(concat('geodash.ie8.min.js'))
.pipe(gulp.dest('dist/'))
gulp.src([
'src/GeoDash.js'
, 'src/lib/d3.min.js'
, 'src/lib/mustache.js'
, 'dist/geodash.js'
])
.pipe(concat('geodash.js'))
.pipe(gulp.dest('dist/'))
gulp.src([
'src/GeoDash.js'
, 'src/lib/aight.min.js'
, 'src/lib/r2d3.js'
, 'src/lib/aight.d3.min.js'
, 'src/lib/mustache.js'
, 'dist/geodash.js'
])
.pipe(concat('geodash.ie8.js'))
.pipe(gulp.dest('dist/'))
}
gulp.task('default', function() {
gulp.run('minify')
gulp.run('less')
gulp.watch(['src/**/*.js'], function(event) {
gulp.run('minify')
})
gulp.watch(['src/style/*.less'], function(event) {
gulp.run('less')
})
})