diff --git a/gulpfile.js b/gulpfile.js index 4d25834..22e551e 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,14 +1,14 @@ var gulp = require('gulp'), sass = require('gulp-sass'), rename = require('gulp-rename'), - cssmin = require('gulp-minify-css'), + cleanCSS = require('gulp-clean-css'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), jshint = require('gulp-jshint'), prefix = require('gulp-autoprefixer'), browserSync = require('browser-sync'), reload = browserSync.reload, - minifyHTML = require('gulp-minify-html'), + htmlmin = require('gulp-htmlmin'), size = require('gulp-size'), imagemin = require('gulp-imagemin'), pngquant = require('imagemin-pngquant'), @@ -97,7 +97,10 @@ gulp.task('styles', function() { .pipe(rename('styles.css')) .pipe(gulp.dest(bases.dist + 'css')) .pipe(reload({stream:true})) - .pipe(cssmin()) + .pipe(cleanCSS({debug: true}, function(details) { + console.log(details.name + ': ' + details.stats.originalSize); + console.log(details.name + ': ' + details.stats.minifiedSize); + })) .pipe(size({ gzip: true, showFiles: true })) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest(bases.dist + 'css')) @@ -112,7 +115,10 @@ gulp.task('themes', function() { .pipe(prefix(prefixerOptions)) .pipe(gulp.dest(bases.dist + 'css/themes')) .pipe(reload({stream:true})) - .pipe(cssmin()) + .pipe(cleanCSS({debug: true}, function(details) { + console.log(details.name + ': ' + details.stats.originalSize); + console.log(details.name + ': ' + details.stats.minifiedSize); + })) .pipe(size({ gzip: true, showFiles: true })) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest(bases.dist + 'css/themes')) @@ -180,13 +186,8 @@ gulp.task('sass-lint', function() { }); gulp.task('minify-html', function() { - var opts = { - comments:true, - spare:true - }; - gulp.src(bases.app + './*.html') - .pipe(minifyHTML(opts)) + .pipe(htmlmin({collapseWhitespace: true})) .pipe(gulp.dest(bases.dist)) .pipe(reload({stream:true})); }); diff --git a/package.json b/package.json index 88292bd..08ee346 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "name": "Mina Markham", "url": "https://github.com/minamarkham" }, - "version": "2.0.0", + "version": "2.1.0", "license": "MIT", "repository": { "type": "git", @@ -32,12 +32,12 @@ "del": "^2.0.2", "gulp": "^3.9.0", "gulp-autoprefixer": "^2.1.0", + "gulp-clean-css": "^2.0.7", "gulp-concat": "^2.4.3", "gulp-gh-pages": "^0.4.0", + "gulp-htmlmin": "^2.0.0", "gulp-imagemin": "^2.1.0", "gulp-jshint": "^1.9.0", - "gulp-minify-css": "^0.3.12", - "gulp-minify-html": "^0.1.8", "gulp-notify": "^2.2.0", "gulp-plumber": "^0.6.6", "gulp-rename": "^1.2.0",