forked from siimonevans/leaflet-offline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (34 loc) · 880 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
33
34
35
36
37
38
39
40
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var connect = require('gulp-connect');
var pump = require('pump');
var del = require('del');
var jsFiles = [
'src/TileLayer.Offline.js',
'src/Control.Offline.js',
'src/leaflet-offline.js'
];
gulp.task('clean', function () {
del.sync(['dist/**/*']);
});
gulp.task('js', function (cb) {
pump([
gulp.src(jsFiles),
concat('leaflet-offline.js'),
gulp.dest('dist')
], cb);
});
gulp.task('minify', ['clean', 'js'], function (cb) {
pump([
gulp.src(['dist/leaflet-offline.js']),
rename({ suffix: '.min' }),
uglify(),
gulp.dest('dist')
], cb);
});
gulp.task('demo', ['clean', 'js'], function () {
connect.server();
});
gulp.task('release', ['minify']);