iampava / imagemin-webp-webpack-plugin

Webpack plugin which converts images to the WebP format while also keeping the original files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-dev-server error

magicDvlp opened this issue · comments

Hello! Thank you for the cool plugin. I get an error when working with webpack-dev-server: "WARNING in Cannot read property 'path' of undefined". But when building in production, everything works well.

Hey and thanks for the issue submit. I'll investigate the problem over the weekend, when I get some free time and then get back to you ;)

catch similar bug

@iampava The problem is that resp on line 38 is sometimes an empty array for some images. So the resp[0].path of course throws.

I did some improvements and quite a lot of refactoring and the issue should be fixed now. :)

I did a push on GitHub 7409e6f but not a publish on NPM yet. I'm waiting for your feedback to tell me if it actually works in your projects before going public.

PS: to try the latest code just replace the contents directly in node_modules
PPS: since the plugin order matters for Webpack, try and put this plugin last

Good job. Works without errors. Thank you very much!

Great! @dkrnl, @smajl can you confirm it now works in your projects?

Published v3.0.0 with the fix on NPM!

@iampava Tested 3.0.0 and it works flawlessly, thank you.