-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (31 loc) · 1018 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
35
36
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
del = require('del'),
rename = require('gulp-rename'),
minifyCSS = require('gulp-minify-css'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglifyjs');
gulp.task('clean', function () {
del(['daterangepicker.min.*']);
});
gulp.task('jshint', function () {
gulp.src(['gulpfile.js', 'daterangepicker.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('minifycss', function () {
gulp.src('daterangepicker.css')
.pipe(sourcemaps.init())
.pipe(minifyCSS())
.pipe(rename("daterangepicker.min.css"))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('.'));
});
gulp.task('uglifyjs', function () {
gulp.src('daterangepicker.js')
.pipe(uglify('daterangepicker.min.js', {
outSourceMap: true
}))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['clean', 'jshint', 'minifycss', 'uglifyjs']);