forked from tomscholz/geojson-editor
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
31 lines (25 loc) · 820 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var cssnano = require('gulp-cssnano');
var rename = require("gulp-rename");
// Minify and copy JavaScript to js/min
gulp.task('compileCSS', function() {
return gulp.src('css/styles.css')
.pipe(cssnano())
.pipe(rename('styles.min.css'))
.pipe(gulp.dest('css/min/'));
});
// Minify and copy CSS to css/min
gulp.task('compileJS', function () {
return gulp.src('js/editor.js')
.pipe(uglify())
.pipe(rename('editor.min.js'))
.pipe(gulp.dest('js/min/'));
});
// Watch files for changes and recompile
gulp.task('watch', function() {
gulp.watch('css/styles.css', ['compileCSS']);
gulp.watch('js/editor.js', ['compileJS']);
});
gulp.task('build', ['compileJS', 'compileCSS']);
gulp.task('default', ['watch']);