speed-measure-webpack-plugin
speed-measure-webpack-plugin copied to clipboard
wrap hooks object so that plugins can add custom hooks
this might fix https://github.com/stephencookdev/speed-measure-webpack-plugin/issues/44
I saw issues with incremental builds especially with HardSourceWebpackPlugin. This changes fixes it for me.
Debugging HardSourceWebpackPlugin, it looks like they are modifying the hooks objects to add more hooks https://github.com/mzgoddard/hard-source-webpack-plugin/blob/5122a1c3c3660d94798e73e73b6e36d0fc1d784d/lib/SystemArchetype.js#L14 https://github.com/mzgoddard/hard-source-webpack-plugin/blob/master/lib/util/plugin-compat.js#L59
These modified hooks are okay in the first run, but speed-measure-plugin does not modify the actual hooks when these registrations happen. This makes the subsequent newly created hooks object fail during the next incremental build.