Git Product home page Git Product logo

laravel-elixir-imagemin's People

Contributors

alfonsobries avatar davisvagris avatar loranger avatar lukeed avatar nathanmac avatar tannerhodges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-elixir-imagemin's Issues

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

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?

Cannot find module 'laravel-elixir-imagemin'

Decided to try this on a Laravel 5.2 project. I'm getting the following error:

Error: Cannot find module 'laravel-elixir-imagemin'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\Users\Robert\MyWebs\Sites\biospex\gulpfile.js:3:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

Right now, my gulp file is stripped down to the most basic code:

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

Any ideas?

custom directories supported?

Hello, I have added:

elixir.config.images = {
    folder: './addons/default/themes/defeault/gittheme/img/',
    outputFolder: './assets/build/img/'
};

Later in the code: mix.imagemin(), But I get:
[00:03:56] Starting 'imagemin'...
[00:03:56] gulp-imagemin: Minified 0 images
[00:03:56] Finished 'imagemin' after 11 ms

What I could be doing wrong?

Ability to add more than a directory of origin and destination

First, congratulations on the module it is very interesting.

I believe this would be an improvement ...

For example, normally systems have different directories eg:

  • frontend
  • backend

and their images would be there.

//as we have today
config.images = _.extend({
        folder: 'images', //It would be interesting to place an object containing several directories recursively
        outputFolder: 'images'
}, config.images || {});

elixir.json

//possible implementation
{
    "images": {
            "frontend-test1": {
                "folder": ["frontend/images/folder1", "frontend/images/folder2"], // find by resources
                "outputFolder": "images/frontend/folder1", "images/frontend/folder2" //export into public/
            },
            "frontend-test2": {
                "folder": ["frontend/images/folder3", "frontend/images/folder4"], // find by resources
                "outputFolder": "images/frontend/folderx" //export into public/             
            }

            "backend-test1": {
                "folder": ["backend/images/folder1", "backend/images/folder2"], // find by resources
                "outputFolder": "images/backend/folderx" //export into public/              
            }

            "backend-test2": {
                "folder": ["backend/images/folder3", "backend/images/folder4"], // find by resources
                "outputFolder": "images/backend/foldery" //export into public/              
            }

    }
}

Today, I have only one option to put the images.

It would be interesting and I believe that increase the functionality of it, with the possibility of adding different directories of both origin and destination.

Sincerely, and success!

Add ability to ignore a path

Just like every other gulp function has, this one needs the ability to ignore a path by pre-pending an ! to the path.

If you're not going to bring back the "old syntax", you'll need to incorporate this into the config lines somehow.

Bring back "old syntax"

Please bring back the ability to use what you refer to as "old syntax".. i.e. the ability to override and select multiple files within the mix function itself.

The rest of elixir still works like that so I don't understand why you removed it.

TypeError: index.js:35: undefined is not a function

Hello,

I am using: Laravel 5.1 and Elixir 2.3.13. I am getting an error when I run the imagemin task. I am using the same config as the last example (all of the other examples gives me the same error as well, even if I do not pass any params):

elixir(function(mix) {
    mix.imagemin(
        "./resources/assets/img",
        "public/img",
        { optimizationLevel: 3, progressive: true, interlaced: true }
    );
});

And it fails:

/Users/superkalo/Sites/one-studio/node_modules/laravel-elixir-imagemin/index.js:35
    new elixir.Task('imagemin', function () {
              ^
TypeError: undefined is not a function
    at Object.imagemin (/Users/superkalo/Sites/one-studio/node_modules/laravel-elixir-imagemin/index.js:35:15)
    at /Users/superkalo/Sites/one-studio/gulpfile.js:93:10
    at Elixir (/Users/superkalo/Sites/one-studio/node_modules/laravel-elixir/index.js:3:5)
    at Object.<anonymous> (/Users/superkalo/Sites/one-studio/gulpfile.js:25:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

Any suggestions why?
Thanks in Advance!

process.env error

I'm getting the following error. BinWrapper seems to be trying to access process.env.PATH which isn't set. Any ideas why?

TypeError: Cannot call method 'split' of undefined
    at new BinWrapper (/../node_modules/laravel-elixir-imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/index.js:26:30)
    at Object.<anonymous> (/../node_modules/laravel-elixir-imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/lib/index.js:18:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> /../node_modules/laravel-elixir-imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/index.js:3:11)
    at Module._compile (module.js:456:26)

Issue when combining with imagemin-svgo 5.2.0

When using laravel-elixir-imagemin 0.2.3 with imagemin-svgo 5.2.0 the below error occurs:

/Users/brian/Sites/ddos/node_modules/is-svg/index.js:8
        var charCode = isBuf ? buf[i] : buf.charCodeAt(i);
                                           ^

TypeError: Cannot read property 'charCodeAt' of undefined
    at isBinary (/Users/brian/Sites/ddos/node_modules/is-svg/index.js:8:38)
    at module.exports (/Users/brian/Sites/ddos/node_modules/is-svg/index.js:19:10)
    at buf (/Users/brian/Sites/ddos/node_modules/imagemin-svgo/index.js:8:7)
    at Imagemin.use (/Users/brian/Sites/ddos/node_modules/imagemin/index.js:63:51)
    at DestroyableTransform.through.obj.percent (/Users/brian/Sites/ddos/node_modules/gulp-imagemin/index.js:47:5)
    at DestroyableTransform._transform (/Users/brian/Sites/ddos/node_modules/through2-concurrent/through2-concurrent.js:30:15)
    at DestroyableTransform.Transform._read (/Users/brian/Sites/ddos/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Users/brian/Sites/ddos/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/Users/brian/Sites/ddos/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/Users/brian/Sites/ddos/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)

If I downgrade imagemin-svgo to ^4.2.0 everything works.

Notifications get sent out for each image

Instead of notifying one time, the package notifies for each image separately I believe. I'm using the instructions from the npm page for setting up the Gulp file.

screen shot 2015-02-08 at 15 07 32

Path error

// Config

elixir.config.publicPath = './../../../public';
elixir.config.assetsPath = 'assets';

elixir.config.images = {
    outputFolder: elixir.config.publicPath + '/build/back/images',
    folder: elixir.config.assetsPath + '/images'
};

// Debug

console.log('============================================');
console.log(config.get('assets.images.folder'));
console.log(config.images.folder);
console.log('============================================');
console.log(config.get('assets.images.outputFolder'));
console.log(config.images.outputFolder);
console.log('============================================');

// Result

============================================
assets/assets/images
assets/images
============================================
../../public/build/back/images
./../../../public/build/back/images
============================================

How can I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.