Error in minification of images with Gulp in Laravel

0

I'm trying to make the gulp minify the images of my project. My project is laravel 5.3 and I'm using the laravel-elixir-imagemin thumb to minify, but when I give the command gulp imagemin the following result appears:

Please note that it does not recognize the resources/assets/images source folder and says that it did not minify any images. Anyway, I've tried various configurations for gulp and nothing.

Follow the code:

const elixir = require('laravel-elixir');
const gulp = require('gulp');
const watch = require('gulp-watch');
require('laravel-elixir-imagemin');

elixir.config.sourcemaps = true;

elixir(function (mix) {
    mix.sass('app.scss');
    mix.imagemin();
    mix.scripts(
        [
            'vendor/jquery.js',
            'vendor/bootstrap.js',
            'script.js'
        ],
        'public/js/app.js');


});
    
asked by anonymous 08.06.2017 / 22:26

1 answer

0

I found the answer, the problem was that for this plugin in particular it is necessary to set the settings, since it does not have a default configuration as I believe it had.

Just put this code:

elixir.config.images = {
    folder: 'img',
    outputFolder: 'img'
};
    
16.06.2017 / 14:18