Closed lebleb closed 3 years ago
Problem:
Plugin show an error with Webpack 5.
Error: Content and Map of this Source is not available (only size() is supported)
Why?
Webpack 5 release, replaces the source of assets with SizeOnlySource. Official announce => https://webpack.js.org/blog/2020-10-10-webpack-5-release/#sizeonlysource-after-emit
Key idea:
Only "emit" called before "AfterEmit" has a source for assets. Use the "emit" hook only if there is hook support. So the old version of the Webpack will continue to use the "afterEmit" hook with the old plugin apply.
Closes #327
Nice work 👍🏼
This looks like it'll work, when I get a chance to test it out I'll get a new version published. Thank you!!
I tested on my end and it fixes the issue! 🙌
Out in v7.1.0 now 🎉
v7.1.0
Problem:
Plugin show an error with Webpack 5.
Error: Content and Map of this Source is not available (only size() is supported)
Why?
Webpack 5 release, replaces the source of assets with SizeOnlySource. Official announce => https://webpack.js.org/blog/2020-10-10-webpack-5-release/#sizeonlysource-after-emit
Key idea:
Only "emit" called before "AfterEmit" has a source for assets. Use the "emit" hook only if there is hook support. So the old version of the Webpack will continue to use the "afterEmit" hook with the old plugin apply.
Closes #327