This repository has been archived by the owner on Oct 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
59 lines (53 loc) · 1.46 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
'use strict';
const cleanCss = require('gulp-clean-css');
const concat = require('gulp-concat');
const gulp = require('gulp');
const less = require('gulp-less');
const path = require('path');
const pump = require('pump');
const rename = require('gulp-rename');
function images() {
return gulp
.src([
'node_modules/leaflet/dist/images/*.*',
'node_modules/leaflet.awesome-markers/dist/images/*.*',
'node_modules/leaflet-minimap/dist/images/*.*'
])
.pipe(gulp.dest('dist/images'));
}
function scripts(cb) {
pump([
gulp.src([
'node_modules/leaflet/dist/leaflet.js',
'node_modules/leaflet.markercluster/dist/leaflet.markercluster.js',
'node_modules/leaflet.awesome-markers/dist/leaflet.awesome-markers.min.js',
'node_modules/leaflet-minimap/dist/Control.MiniMap.min.js',
'src/js/awesome-cluster-map.js'
]),
concat('awesome-cluster-map.min.js'),
gulp.dest('dist')
], cb);
}
function compileStyles() {
return gulp.src('src/less/awesome-cluster-map.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(cleanCss({
compatibility: 'ie8'
}))
.pipe(gulp.dest('dist/'));
}
const styles = gulp.series(images, compileStyles)
function watch() {
gulp.watch('src/less/*.less', styles);
gulp.watch('src/js/*.js', scripts);
}
exports.images = images;
exports.scripts = scripts;
exports.styles = styles;
exports.watch = watch;
exports.default = gulp.series(styles, scripts, watch);