Skip to content

Commit

Permalink
Merge pull request #804 from robwierzbowski/rw/replace-deprecated-min…
Browse files Browse the repository at this point in the history
…ifiers

Replace deprecated minifiers with gulp-cssnano and gulp-htmlmin
  • Loading branch information
addyosmani committed Jan 15, 2016
2 parents 8de7ec9 + 5eb199c commit 3826f96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ gulp.task('styles', () => {
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp/styles'))
// Concatenate and minify styles
.pipe($.if('*.css', $.minifyCss()))
.pipe($.if('*.css', $.cssnano()))
.pipe($.size({title: 'styles'}))
.pipe($.sourcemaps.write('./'))

This comment has been minimized.

Copy link
@blueyedblues

blueyedblues May 7, 2016

gayalea risley google website owner

.pipe(gulp.dest('dist/styles'));
Expand Down Expand Up @@ -140,10 +140,20 @@ gulp.task('html', () => {

// Concatenate and minify styles
// In case you are still using useref build blocks
.pipe($.if('*.css', $.minifyCss()))
.pipe($.if('*.css', $.cssnano()))

// Minify any HTML
.pipe($.if('*.html', $.minifyHtml()))
.pipe($.if('*.html', $.htmlmin({
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeOptionalTags: true
})))
// Output files
.pipe($.if('*.html', $.size({title: 'html', showFiles: true})))
.pipe(gulp.dest('dist'));
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"gulp-babel": "^6.0.0",
"gulp-cache": "0.2.2",
"gulp-concat": "^2.5.2",
"gulp-cssnano": "^2.0.0",
"gulp-eslint": "^1.0.0",
"gulp-htmlmin": "^1.3.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.0.0",
"gulp-load-plugins": "^1.0.0",
"gulp-minify-css": "^1.1.6",
"gulp-minify-html": "^1.0.4",
"gulp-newer": "^1.0.0",
"gulp-sass": "^2.0.0",
"gulp-size": "^2.0.0",
Expand Down

0 comments on commit 3826f96

Please sign in to comment.