-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
executable file
·75 lines (64 loc) · 1.76 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
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var csslint = require('gulp-csslint');
var minifyCSS = require('gulp-minify-css');
var docco = require("gulp-docco");
// Lint JS
// Lint Task
gulp.task('lint', function() {
gulp.src('js/gcgpxviewer.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Concat & Minify JS
gulp.task('minify-js', function() {
gulp.src(['js/underscore-min.js',
'js/leaflet/leaflet-src.js',
'js/tile.stamen.js',
'js/Control.FullScreen.js',
'js/L.Control.Locate.js',
'js/Control.Options.js',
'js/L.Control.Sidebar.js',
'js/leaflet.label.js',
'js/ActiveLayers.js',
'js/Bing.js',
'js/date.format.js',
'js/gcgpxviewer.js'
])
.pipe(concat('all.js'))
.pipe(gulp.dest('js'))
.pipe(rename('gcgpxviewer.min.js'))
.pipe(uglify())
.pipe(gulp.dest('js'));
});
gulp.task('css', function() {
gulp.src(['css/*.css', 'js/leaflet/leaflet.css'])
.pipe(csslint())
.pipe(csslint.reporter());
});
// Concat & Minify JS
gulp.task('minify-css', function() {
gulp.src(['js/leaflet/leaflet.css',
'css/L.Control.Sidebar.css',
'css/Control.FullScreen.css',
'css/leaflet.label.css',
'css/L.Control.Locate.css',
'css/design.css'
])
.pipe(concat('gcgpxviewer.css'))
.pipe(gulp.dest('css'))
.pipe(rename('gcgpxviewer.min.css'))
.pipe(minifyCSS())
.pipe(gulp.dest('.'));
});
gulp.task('docco', function() {
gulp.src("js/gcgpxviewer.js")
.pipe(docco())
.pipe(gulp.dest('docs/'))
})
gulp.task('default', ['minify-js', 'minify-css', 'docco']);