-
Notifications
You must be signed in to change notification settings - Fork 10
/
gulpfile.js
73 lines (62 loc) · 2.37 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
const path = require('path')
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const sources = {
flot: [
// 'bower_components/Flot/jquery.flot.js',
// 'bower_components/Flot/jquery.flot.resize.js',
// 'bower_components/Flot/jquery.flot.fillbetween.js',
//'bower_components/flot.orderbars/js/jquery.flot.orderBars.js',
//'bower_components/Flot/jquery.flot.categories.js',
//'bower_components/Flot/jquery.flot.pie.js',
//'bower_components/Flot/jquery.flot.time.js',
//'bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js',
//
"flot-legacy/jquery.flot.cust.min.js",
"flot-legacy/jquery.flot.resize.min.js",
"flot-legacy/jquery.flot.fillbetween.min.js",
"flot-legacy/jquery.flot.orderBar.min.js",
"flot-legacy/jquery.flot.pie.min.js",
"flot-legacy/jquery.flot.time.min.js",
"flot-legacy/jquery.flot.tooltip.min.js"
] ,
datatables: [
'bower_components/datatables.net/js/jquery.dataTables.js',
'bower_components/datatables.net-bs/js/dataTables.bootstrap.js',
'bower_components/datatables.net-buttons/js/dataTables.buttons.js',
'bower_components/datatables.net-buttons/js/buttons.colVis.js',
'bower_components/datatables.net-buttons/js/buttons.flash.js',
'bower_components/datatables.net-buttons/js/buttons.html5.js',
'bower_components/datatables.net-buttons/js/buttons.print.js',
'bower_components/datatables.net-buttons-bs/js/buttons.bootstrap.js',
'bower_components/datatables.net-colreorder/js/dataTables.colReorder.js',
'bower_components/datatables.net-responsive/js/dataTables.responsive.js',
'bower_components/datatables.net-responsive-bs/js/responsive.bootstrap.js',
]
}
const dest = {
flot: 'flot-bundle' ,
datatables: 'datatables-bundle'
}
const concatBundle = (name)=>{
return gulp.src(sources[name])
.pipe(concat(dest[name]+'.js'))
.pipe(gulp.dest(path.resolve(__dirname, dest[name] )))
}
const uglifyBundle = (name)=>{
return gulp.src(sources[name])
.pipe(uglify())
.pipe(concat(dest[name]+'.min.js'))
.pipe(gulp.dest(path.resolve(__dirname, dest[name] )))
}
gulp.task('concat', ()=>{
concatBundle('flot');
// concatBundle('datatables')
})
gulp.task('uglify', ()=>{
uglifyBundle('flot');
// uglifyBundle('datatables')
})
gulp.task
('default', ['concat', 'uglify'])