This repository has been archived by the owner on Jul 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38efbc5
commit 0621b71
Showing
1 changed file
with
29 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
var gulp = require('gulp'), | ||
htmlmin = require('gulp-htmlmin'), | ||
imgRetina = require('gulp-img-retina'); | ||
imgRetina = require('gulp-img-retina'), | ||
runSequence = require('run-sequence'); | ||
|
||
var retinaOpts = { | ||
// Your options here. | ||
}; | ||
gulp.task('process-html', function() { | ||
gulp.task('process-html', function(callback) { | ||
runSequence('copy-html', 'retina-html', | ||
callback | ||
) | ||
}) | ||
|
||
return gulp.src(['public/**/*.html']) | ||
gulp.task('copy-html', function(){ | ||
return gulp.src('public/**/*.html') | ||
.pipe(gulp.dest('staging')) | ||
}) | ||
|
||
var retinaOpts = { | ||
// Your options here. | ||
}; | ||
|
||
// gulp.task('min-html', function() { | ||
// return gulp.src('public/**/*.html') | ||
// .pipe(htmlmin({ | ||
// collapseWhitespace: true | ||
// })) | ||
// .pipe(gulp.dest('staging')); | ||
// }) | ||
// min-html was taking forever | ||
|
||
gulp.task('retina-html', function() { | ||
return gulp.src(['staging/**/*.html']) | ||
.pipe(imgRetina(retinaOpts)) | ||
.on('error', function(e) { | ||
console.log(e.message); | ||
console.log(e.message); | ||
}) | ||
.pipe(htmlmin({collapseWhitespace: true})) | ||
.pipe(gulp.dest('staging')); | ||
|
||
}); | ||
}) |