-
Notifications
You must be signed in to change notification settings - Fork 24
/
gulpfile.js
76 lines (67 loc) · 2.08 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
/**
* Created by gti on 01.08.16.
*/
const gulp = require('gulp');
const concat = require('gulp-concat');
const less = require('gulp-less');
const webserver = require('gulp-webserver');
const path = require('path');
const jsSources = [
'./src/scripts/jquery.simplemodal.js',
'./src/scripts/jquery.palette.js',
'./src/scripts/lib/ichart.core.js',
'./src/scripts/lib/indicators.descr.js',
'./src/scripts/lib/charting/*',
'./src/scripts/templates.js',
'./src/scripts/chart_options_for_nt.js',
'./src/scripts/chart.js',
'./src/scripts/iguana-ui.js',
'./src/scripts/jquery.iguana-chart.js',
'./src/scripts/ta/TA_prototypes.js',
'./src/scripts/ta/functions/*',
'./src/scripts/ta/TA_common.js',
'./src/scripts/ta/TA_analyse_rs.js',
];
const i18nSources = './src/scripts/i18n/*.js';
const lessSource = './src/styles/*.less';
gulp.task('less', function () {
return gulp.src(lessSource)
.pipe(less({
paths: [path.join(__dirname, 'less', 'includes')],
}))
.pipe(gulp.dest('./src/styles'));
});
gulp.task('css', gulp.series('less', function () {
return gulp.src([
'./src/styles/*.css',
])
.pipe(concat('iguanachart.css'))
.pipe(gulp.dest('./dist/'));
}));
gulp.task('js', function () {
return gulp.src(jsSources)
.pipe(concat('iguanachart.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('copy-resources', function () {
return gulp.src('./src/scripts/i18n/i18n.en.js').pipe(gulp.dest('./dist/i18n'));
});
gulp.task('complete', function (cb) {
console.log('\x1b[32m Build completed! \x1b[0m');
cb();
});
gulp.task('default', gulp.series('less', 'css', 'js', 'complete'));
gulp.task('webserver', function () {
return gulp.src('./')
.pipe(webserver({
port: 8080,
fallback: 'example/index.html',
}));
});
gulp.task('watch', function () {
gulp.watch(jsSources, gulp.series('js'));
gulp.watch(lessSource, gulp.series('less', 'css'));
})
gulp.task('dev', (done) => {
gulp.parallel('webserver', 'watch')(done);
});