-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (28 loc) · 967 Bytes
/
gulpfile.js
File metadata and controls
33 lines (28 loc) · 967 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
33
var gulp = require('gulp'),
size = require('gulp-size'),
rename = require('gulp-rename'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps');
var path = ['zepto.autocomplete.js'];
gulp.task('jshint', function() {
return gulp.src(path)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('build', ['jshint'], function() {
return gulp.src(path)
.pipe(size({title: '(original)'}))
.pipe(rename('zepto.autocomplete.min.js'))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(size({title: '(minified)'}))
.pipe(size({title: '(gzipped)', gzip: true}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('.'));
});
gulp.task('watch', function() {
return gulp.watch(path, ['build']);
});
gulp.task('default', ['build', 'watch']);