forked from marekdedic/imagelightbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (35 loc) · 1.26 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
var gulp = require('gulp'),
csslint = require('gulp-csslint'),
jshint = require('gulp-jshint'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
stylish = require('jshint-stylish');
gulp.task('csslint', function () {
return gulp.src('src/imagelightbox.css')
.pipe(csslint('.csslintrc'))
.pipe(csslint.reporter())
});
gulp.task('minify:css', function () {
return gulp.src('src/imagelightbox.css')
.pipe(autoprefixer({
browsers: ['last 2 versions', 'ie >= 7', 'Firefox ESR', 'Android >= 2.3'],
cascade: false
}))
.pipe(minifyCSS())
.pipe(rename('imagelightbox.min.css'))
.pipe(gulp.dest('dist/'));
});
gulp.task('jshint', function () {
return gulp.src('src/imagelightbox.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('minify:js', function () {
return gulp.src('src/imagelightbox.js')
.pipe(uglify())
.pipe(rename('imagelightbox.min.js'))
.pipe(gulp.dest('dist/'));
});
gulp.task('default', ['csslint', 'minify:css', 'jshint', 'minify:js']);