-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
41 lines (37 loc) · 1.1 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
/* --------------------------------------
config
-------------------------------------- */
var srcFile = 'jquery.kiss-slider.js';
var minFile = 'jquery.kiss-slider.min.js';
/* --------------------------------------
end config
-------------------------------------- */
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
/* --------------------------------------
JS
-------------------------------------- */
gulp.task('js', function() {
return gulp.src(srcFile)
.pipe(plumber())
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename(minFile))
.pipe(gulp.dest('./'));
});
/* --------------------------------------
Watch
-------------------------------------- */
gulp.task('watch', function() {
gulp.watch(srcFile, ['js']);
});
/* --------------------------------------
default task
-------------------------------------- */
gulp.task('default', ['js', 'watch']);