forked from TheGartrellGroup/Mapbox-GL-JS-Layer-Tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
43 lines (37 loc) · 1.07 KB
/
gulpfile.js
File metadata and controls
43 lines (37 loc) · 1.07 KB
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
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
//local webserver
gulp.task('webserver', function() {
gulp.src('./')
.pipe(webserver({
fallback: 'index.html',
directoryListing: false,
livereload: true,
open: true
}));
});
//watch task
gulp.task('watch', function(){
gulp.watch(['index.htm', 'js/app.js', 'js/layer-tree.js', 'css/app.css', 'css/layer-tree.css']);
});
//minify js
gulp.task('scripts', function() {
gulp.src(['node_modules/jquery/dist/jquery.min.js', 'js/jquery-ui-sortable/jquery-ui.min.js', 'js/layer-tree.js'])
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/js'))
});
//minify css
gulp.task('css', function() {
gulp.src(['css/layer-tree.css'])
.pipe(concat('styles.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest('dist/css'))
});
//default task
gulp.task('default', ['webserver', 'watch']);
//build task
gulp.task('build', ['scripts', 'css']);