From 37354830e3d29221e993f56ba71bd9ebf521cddb Mon Sep 17 00:00:00 2001 From: Matt Stratton Date: Mon, 9 Jan 2017 02:31:07 -0800 Subject: [PATCH] Remove useref from gulpfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Can’t quite get it to work Signed-off-by: Matt Stratton --- gulpfile.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6b4077aa3..7b44442ed 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,13 +12,32 @@ var gulp = require('gulp'), gulp.task('useref', function(){ return gulp.src('public/**/*.html') - .pipe(useref({ searchPath: ['public/css', 'public/font-awesome'] })) + .pipe(useref({ searchPath: ['../static/']})) .pipe(gulpif('*.js', uglify())) .pipe(gulpif('*.css', minifyCss())) .pipe(gulpif('*.html', htmlmin({collapseWhitespace: true}))) .pipe(gulp.dest('staging')); }); +gulp.task('min-js', function(){ + return gulp.src('public/**/*.js') + .pipe(uglify()) + .pipe(gulp.dest('staging')); +}); + +gulp.task('min-css', function(){ + return gulp.src('public/**/*.css') + .pipe(minifyCss()) + .pipe(gulp.dest('staging')); +}); + +gulp.task('min-html', function(){ + return gulp.src('public/**/*.html') + .pipe(htmlmin({collapseWhitespace: true})) + .pipe(gulp.dest('staging')); +}); + + // The process-images task took about 6 minutes for just sponsors; for now we probably // will just copy the images and not optimize them @@ -60,7 +79,7 @@ gulp.task('copy-icons', function(){ }); gulp.task('default', function (callback) { - runSequence('useref', 'copy-images', 'process-files', 'update-files', 'copy-other-files', 'copy-icons', + runSequence('min-js', 'min-css', 'min-html', 'copy-images', 'process-files', 'update-files', 'copy-other-files', 'copy-icons', callback ) })