Подскажите в чем дело, плагин gulp-Imagemin не сжимает файлы картинок?
вот конфигурация:
var gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
minifyCSS = require('gulp-minify-css'),
autoprefixer = require('gulp-autoprefixer'),
livereload = require('gulp-livereload'),
connect = require('gulp-connect'),
plumber = require('gulp-plumber'),
imagemin = require('gulp-imagemin');
// server connect
gulp.task('connect', function() {
connect.server({
root: 'dev',
livereload: true
});
});
// html
gulp.task('html', function(){
gulp.src('dev')
.pipe(connect.reload());
});
// css
gulp.task('css', function () {
gulp.src('dev/style/css/*.css')
.pipe(plumber())
.pipe(concat("style.css"))
.pipe(autoprefixer({
browsers: ['last 15 versions']
}))
.pipe(minifyCSS())
.pipe(rename('style.min.css'))
.pipe(gulp.dest('dev/style/css/'))
.pipe(connect.reload());
});
// Image Task
// Compress
gulp.task('image', function(){
gulp.src('dev/style/img/sourse/**/*.{jpg,jpeg,png,gif}')
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest('dev/style/img'));
});
// watch
gulp.task('watch', function(){
gulp.watch('dev/style/css/*.css', ['css'])
gulp.watch('dev/*.html', ['html'])
gulp.watch('dev/style/img/sourse/**/*', ['image']);
});
// default
gulp.task('default', ['connect',
'image',
'html',
'css',
'watch'
]);
И вот что в консоли:
[21:13:37] Starting 'connect'...
[21:13:37] Server started http://localhost:8080
[21:13:37] LiveReload started on port 35729
[21:13:37] Finished 'connect' after 65 ms
[21:13:37] Starting 'image'...
[21:13:37] Finished 'image' after 11 ms
[21:13:37] Starting 'html'...
[21:13:37] Finished 'html' after 1.77 ms
[21:13:37] Starting 'css'...
[21:13:37] Finished 'css' after 7.79 ms
[21:13:37] Starting 'watch'...
[21:13:38] Finished 'watch' after 55 ms
[21:13:38] Starting 'default'...
[21:13:38] Finished 'default' after 11 μs
[21:13:38] gulp-imagemin: Minified 8 images (saved 0 B - 0%)
[21:13:38] Starting 'css'...
[21:13:38] Finished 'css' after 3.85 ms