-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (29 loc) · 831 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
32
33
34
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
cleanCSS = require('gulp-clean-css');
gulp.task('default', function() {
gulp.start('jshint');
});
gulp.task('jshint', function() {
return gulp.src('datepicker.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('js', ['jshint'], function() {
return gulp.src('datepicker.js')
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('css', function() {
return gulp.src('datepicker.css')
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS())
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['js', 'css']);