-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel-extra.js
48 lines (47 loc) · 1.72 KB
/
gulpfile.babel-extra.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
/**
* Data Table CSS, SCSS and JS
*/
gulp.task('renameAndCopyDataTable', () => {
const dataTable = `${node_modules_path}/datatables.net/js/jquery.dataTables.js`;
const dataTableBootstrap = `${node_modules_path}/datatables.net-bs4/js/dataTables.bootstrap4.js`;
const dataTableImages = `${node_modules_path}/datatables.net-dt/images/*.*`;
const dataTableCSSSRC = `${node_modules_path}/datatables.net-dt/`;
const dataTableBootstrapSRC = `${node_modules_path}/datatables.net-bs4/`;
const dataTableDestination = `./assets/images`
gulp.src([
dataTable, dataTableBootstrap
])
.pipe(gulpConcat('datatable-min.js'))
.pipe(gulp.dest(jsTarget))
gulp.src(dataTableImages)
.pipe(gulp.dest(dataTableDestination))
gulp.src(`${dataTableCSSSRC}css/jquery.dataTables.css`)
.pipe(gulpRename((path) => {
path.dirname += '/scss';
path.extname = ".scss"
}))
.pipe(gulp.dest(dataTableCSSSRC))
gulp.src(`${dataTableBootstrapSRC}css/dataTables.bootstrap4.css`)
.pipe(gulpRename((path) => {
path.dirname += '/scss';
path.extname = ".scss"
}))
.pipe(gulp.dest(dataTableBootstrapSRC))
});
/**
* Bootstrap Date picker
*/
gulp.task('bootstrapDatePickerTask', () => {
const bootstrapDatePickerDir = `${node_modules_path}/bootstrap-datepicker`
const bootstrapDatePickerJSSRC = `${bootstrapDatePickerDir}/dist/js/bootstrap-datepicker.min.js`;
const bootstrapDatePickerCSSSRC = `${bootstrapDatePickerDir}/dist/css`
// Save JS File
gulp.src(bootstrapDatePickerJSSRC)
.pipe(gulp.dest(jsTarget));
// Convert CSS TO SASS
gulp.src(`${bootstrapDatePickerCSSSRC}/*.min.css`)
.pipe(gulpRename((path) => {
path.dirname += '/scss';
path.extname = '.scss';
})).pipe(gulp.dest(bootstrapDatePickerDir))
})