nathanmac / laravel-elixir-imagemin

Laravel Elixir wrapper for ImageMin
MIT License
52 stars 14 forks source link

Getting gulp-imagemin: Minified 0 images (saved 0 B - 0%) when images are present #9

Open mdunbavan opened 9 years ago

mdunbavan commented 9 years ago

Hi,

I have just installed this into my laravel project and I have the setup as follows:

process.env.DISABLE_NOTIFIER = true;
var elixir = require('laravel-elixir');
// var BrowserSync = require('laravel-elixir-browsersync');
require('laravel-elixir-imagemin');
require('laravel-elixir-uglify');
require('laravel-elixir-browser-sync-simple');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss', null, { includePaths: ['resources/assets/sass/partials','resources/assets/sass/bourbon', 'resources/assets/sass/fontawesome','resources/assets/sass/partials/css3'] })
    .browserSync({
      proxy: 'synergycamps.dev',
        logPrefix       : "Laravel Elixir BrowserSync",
        logConnections  : false,
        reloadOnRestart : false,
        notify          : false
    });

    mix.scripts([
        'app.js'
    ]).uglify('**/*.js', 'public/js', {
        mangle: true,
        suffix: '.min'
    });
    mix.imagemin("IMG_5877.jpg");
});

When I do gulp watch I get the message title output and no images are changed at all. In my /resources/img/ folder I have got the image but nothing is being touched.

Is this a bug?

coryarmbrecht commented 9 years ago

Hey @mdunbavan, I'm getting the same issue with gulp-imagemin. Perhaps I will reference this in an issue there, though I'll probably be pointed to post it on SO.

marionava commented 8 years ago

I'm getting the same issue with gulp-imagemin. I'm using OS X El Capitan.

var elixir = require('laravel-elixir');
require('laravel-elixir-imagemin');

elixir.config.images = {
    folder: 'public/images',
    outputFolder: 'public/images'
};

elixir(function(mix) {
    mix.imagemin();
});
shaneparsons commented 8 years ago

+1

andyosbert commented 8 years ago

+1

I am on El Capitan too

MarekMaras commented 8 years ago

+1 same here

jpggvilaca commented 8 years ago

+1

irineujunior commented 8 years ago

Maybe this help someone =)

Old syntax

        .imagemin('./resources/assets/img', 'public/assets/img/', {
            optimizationLevel: 3,
            progressive: true,
            interlaced: false,
            svgoPlugins: [{
                removeViewBox: false
            }]
        })

New syntax

elixir.config.images = {
    folder: 'img',
    outputFolder: 'assets/img'
};
.imagemin({
            optimizationLevel: 3,
            progressive: true,
            interlaced: false,
            svgoPlugins: [{
                removeViewBox: false
            }]
        })
facundofarias commented 7 years ago

Hi there! Still not working :( Any ideas?

valkirilov commented 7 years ago

+1

kokoruz commented 6 years ago

same - following

MiKatre commented 6 years ago

+1

jorgeav527 commented 6 years ago

+1 Ubuntu i think is the node version