ijs / webp-webpack-plugin

webpack plugin for making webp format file
https://ijs.github.io/webp-webpack-plugin/
MIT License
40 stars 7 forks source link

Add compatibility for webpack 3.5.6 #2

Closed Zyclotrop-j closed 6 years ago

Zyclotrop-j commented 7 years ago

In webpack 3.5.6, each assets in compilation.assets must have source and size, both being functions. Taking the existing setup, I added both to the object being written to compilation.assets.

Changes should be backwards-compatible, too - source and size only get set, if there weren't any!

Tested changes with webpack 3.5.6.

See https://webpack.js.org/development/how-to-write-a-plugin/

jiangtao commented 6 years ago

Thanks for your pull request. I will test and merge it.

jiangtao commented 6 years ago

Hi, I test your code and the result is not correct. I plan to refactor the code and solve this problem