-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (30 loc) · 837 Bytes
/
Copy pathgulpfile.js
File metadata and controls
32 lines (30 loc) · 837 Bytes
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 gulp = require('gulp')
const babel = require('gulp-babel')
const concat = require('gulp-concat')
const rename = require('gulp-rename')
const uglify = require('gulp-uglify')
const connect = require('gulp-connect')
gulp.task('build', function() {
return gulp
.src(['./src/**.js'])
.pipe(concat('leaflet-tile-pixelLayer.js'))
.pipe(
babel({
presets: ['@babel/preset-env']
})
)
.pipe(gulp.dest('dist'))
.pipe(rename('leaflet-tile-pixelLayer.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'))
.pipe(connect.reload())
})
gulp.task('default', function() {
connect.server({
port: 3000,
livereload: true
})
gulp.watch('./src/**.js', gulp.series('build'))
gulp.watch('./gulpfile.js', gulp.series('build'))
gulp.watch('./demo/index.html', gulp.series('build'))
})