-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.3.1: use autoprefixer and minify css during build process
- Loading branch information
Showing
5 changed files
with
26 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
var gulp = require('gulp'); | ||
var csslint = require('gulp-csslint'); | ||
var jshint = require('gulp-jshint'); | ||
var rename = require('gulp-rename'); | ||
var uglify = require('gulp-uglify'); | ||
var stylish = require('jshint-stylish'); | ||
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('imagelightbox.css') | ||
.pipe(csslint('.csslintrc')) | ||
.pipe(csslint.reporter()) | ||
}); | ||
|
||
gulp.task('minify:css', function () { | ||
return gulp.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('imagelightbox.js') | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter(stylish)); | ||
}); | ||
|
||
gulp.task('minify', function () { | ||
gulp.task('minify:js', function () { | ||
return gulp.src('imagelightbox.js') | ||
.pipe(uglify()) | ||
.pipe(rename('imagelightbox.min.js')) | ||
.pipe(gulp.dest('dist/')); | ||
}); | ||
|
||
gulp.task('default', ['csslint', 'jshint', 'minify']); | ||
gulp.task('default', ['csslint', 'minify:css', 'jshint', 'minify:js']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters