-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
32 lines (27 loc) · 906 Bytes
/
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
const rename = require('gulp-rename');
const gulp = require('gulp');
const del = require('del');
const filePaths = require('./src/src/HighchartsModules.js');
const destinationPath = './src/highcharts-files/';
gulp.task('update-highcharts', async function () {
const CORE_FILES_PATH = 'node_modules/highcharts/';
const moduleFiles = Object.keys(filePaths.modules).map(
(file) => CORE_FILES_PATH + 'modules/' + file + '.js'
);
// clear destination directory
del([destinationPath + '*']);
gulp
.src(
[
CORE_FILES_PATH + 'highcharts.js',
CORE_FILES_PATH + 'highcharts-more.js',
CORE_FILES_PATH + 'highcharts-3d.js',
...moduleFiles,
],
{ base: './node_modules/highcharts/' }
)
// rename files
.pipe(rename({ extname: '.hcscript' }))
// copy them into the destination directory
.pipe(gulp.dest(destinationPath));
});