forked from Stryzhevskyi/rangeSlider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (62 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Created by Serhei on 02.01.15.
*/
var gulp = require('gulp');
var del = require('del');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var watch = require('gulp-watch');
var dir = {
src: {
cssMin : 'rangeSlider.min.css',
css: './src/*.css',
js: './src/*.js'
},
dist: {
jsMin : 'rangeSlider.min.js',
css: './dist/',
js: './dist/'
}
};
gulp.task('clean', function (cb) {
console.log('CLEAN');
del(['dist/js/*'], cb);
});
gulp.task('js', function () {
gulp
.src(dir.src.js)
.pipe(gulp.dest(dir.dist.js))
.pipe(uglify())
.pipe(rename(dir.dist.jsMin))
.pipe(gulp.dest(dir.dist.js));
});
gulp.task('css', function () {
gulp.src(dir.src.css)
.pipe(gulp.dest(dir.dist.css))
.pipe(minifyCSS())
.pipe(rename(dir.src.cssMin))
.pipe(gulp.dest(dir.dist.css));
});
gulp.task('jshint', function () {
gulp.src(dir.src.js)
.pipe(jshint({
lookup: true
}))
.pipe(jshint.reporter('default'));
});
gulp.task('watch', function () {
watch(dir.src.js, function () {
gulp.start('js');
});
watch(dir.src.css, function () {
gulp.start('css');
});
});
gulp.task('build', ['js', 'css', 'jshint']);
gulp.task('default', [
'js',
'css',
'watch'
]);