Skip to content

Commit

Permalink
Merge pull request #11 from mejarc/10-gulp-imagemin
Browse files Browse the repository at this point in the history
feat: Gulp task for image compression
  • Loading branch information
mejarc authored Jul 9, 2018
2 parents f699299 + 554bad6 commit 93eedfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
17 changes: 10 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ var useref = require('gulp-useref');
var del = require('del');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');

var imagemin = require('gulp-imagemin');
// var gutil = require('gulp-util');
var browserSync = require('browser-sync').create();
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var webpackConfig = require('./webpack.config.js');
var stream = require('webpack-stream');
// var browserSync = require('browser-sync').create();
// var webpack = require('webpack');
// var WebpackDevServer = require('webpack-dev-server');
// var webpackConfig = require('./webpack.config.js');
// var stream = require('webpack-stream');

var paths = {
styles: {
Expand Down Expand Up @@ -72,9 +72,12 @@ function html() {
.pipe(gulp.dest(paths.html.dest));
}

// copy /img to /dist
// compress images; copy /img to /dist
function images() {
return (gulp.src(paths.images.src))
.pipe(imagemin([
imagemin.jpegtran({ progressive: true })
]))
.pipe(gulp.dest(paths.images.dest));
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"gulp-babel": "^8.0.0-beta.2",
"gulp-concat": "^2.6.1",
"gulp-grunt": "^0.5.5",
"gulp-imagemin": "^4.1.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
"gulp-useref": "^3.1.5",
Expand Down

0 comments on commit 93eedfa

Please sign in to comment.