-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
85 lines (71 loc) · 2 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
/*jshint esversion: 6 */
const { series, parallel, watch, src, dest } = require('gulp');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
sass.compiler = require('node-sass');
function select2css(cb) {
return src('node_modules/select2/dist/css/select2.css')
.pipe(dest('static/css'));
}
function select2js(cb) {
return src('node_modules/select2/dist/js/select2.js')
.pipe(dest('static/js'));
}
function jquery(cb) {
return src('node_modules/jquery/dist/jquery.js')
.pipe(dest('static/js'));
}
function datatablesJs(cb) {
return src('node_modules/datatables/media/js/jquery.dataTables.js')
.pipe(dest('static/js'));
}
function bulmaDatatablesJs(cb) {
return src('node_modules/datatables-bulma/js/dataTables.bulma.js')
.pipe(dest('static/js'));
}
function bulmaDatatablesCss(cb) {
return src('node_modules/datatables-bulma/css/dataTables.bulma.css')
.pipe(rename('dataTables.bulma.scss'))
.pipe(dest('sass'));
}
function underscore(cb) {
return src('node_modules/underscore/underscore.js')
.pipe(dest('static/js'));
}
function chartjs(cb) {
return src('node_modules/chart.js/dist/Chart.js')
.pipe(dest('static/js'));
}
function chartjsCss(cb) {
return src('node_modules/chart.js/dist/Chart.css')
.pipe(dest('static/css'));
}
function tooltipJs(cb) {
return src('node_modules/tooltip.js/dist/tooltip.js')
.pipe(dest('static/js'));
}
// This also imports bulma:
function compileCss(cb) {
return src('sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(dest('static/css'));
}
function watchFiles() {
return watch("sass/**/*.scss", compileCss);
}
exports.default = series(
parallel(
jquery,
datatablesJs,
bulmaDatatablesJs,
bulmaDatatablesCss,
select2js,
select2css,
underscore,
tooltipJs,
chartjs,
chartjsCss,
compileCss
),
watchFiles
);