ryotamoriyama / laravel-mix-image-resizer

1 stars 6 forks source link

Error: Cannot find module 'laravel-mix-image-size-checker' #9

Open nathangross opened 3 years ago

nathangross commented 3 years ago

Thanks for the plugin—I'm hoping it will help me out. However, I'm not able to get it working.

Error: Cannot find module 'laravel-mix-image-size-checker'

Not sure if this matters, but the documentation says to require('laravel-mix-image-size-checker') but the module is called laravel-mix-image-resizer. Does that matter?

Any help would be much appreciated!

TristanMouchet commented 3 years ago

Hi @nathangross, I noticed the naming inconsistencies as well and managed to make it work with the following syntax:

const mix = require('laravel-mix');

require('laravel-mix-image-resizer');

mix.ImageResizer({
    // options
});

The package name is "laravel-mix-image-resizer" (not "laravel-mix-image-size-checker") and the function name is "ImageResizer" (not "ImageSizeResizer").

Hope this helps!

nathangross commented 3 years ago

Thanks for this! I've gone off on a different route for now but maybe try this sometime in the future.