This repository was archived by the owner on Oct 15, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
52 lines (45 loc) · 1.36 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
var gulp = require('gulp'),
postcss = require('gulp-postcss'),
concatCss = require('gulp-concat-css'),
cssnano = require('gulp-cssnano'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
gulp.task('procss', function () {
return gulp.src('./src/css/page.css')
.pipe(postcss([
require('css-mqpacker'),
]))
.pipe(concatCss('page.css'))
.pipe(cssnano({
reduceIdents: false,
svgo: false,
discardComments: {removeAll: true},
zindex: false
}))
.pipe(gulp.dest('./static/css/'));
});
gulp.task('leaflet-css', function () {
return gulp.src('./src/css/leaflet.bundle.css')
.pipe(postcss([
require('css-mqpacker'),
]))
.pipe(concatCss('leaflet.bundle.css'))
.pipe(cssnano({
reduceIdents: false,
svgo: false,
discardComments: {removeAll: true}
}))
.pipe(gulp.dest('./static/css/'));
});
gulp.task('leafletjs', function () {
return gulp.src(['./src/js/leaflet.js','./src/js/leaflet.markercluster.js','./src/js/L.Control.Locate.js'])
.pipe(concat('leaflet.bundle.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./static/js/'));
});
gulp.task('watch-css', function() {
gulp.watch('./src/css/*', ['procss'])
});
gulp.task('build-css', ['procss','leaflet-css']);
gulp.task('build-js', ['leafletjs']);
gulp.task('deploy', ['build-css', 'build-js']);