CupOfTea696 / laravel-mix-imagemin

Laravel Mix imagemin plugin
MIT License
19 stars 14 forks source link

First parameter adjustments #4

Closed ben-rogerson closed 5 years ago

ben-rogerson commented 5 years ago

hey there,

I'm wondering if it's possible to adjust the first parameter to more closely resemble the webpack-copy-plugin options.

Now in v1.0.2 when I use an object as shown in the webpack-copy-plugin docs I receive a multimatch error.

Here's my config:

mix.imagemin(
    {
        from: 'src/images/**/*'),
        to: 'dist',
        flatten: true,
    },
    {},
    ...
},

Perhaps a backwards compatible fix would be to check if the first param is an object that has a from key and check that with multimatch instead, eg:

multimatch(asset, this.patterns.from).length
CupOfTea696 commented 5 years ago

This should be fixed in v1.0.3, let me know if there's anything else.