Sometimes, for some reason, webpack emits assets with identical content. In the plugin I'm writing now, I need to make sure that the asset content has changed. I'm using compiler.hooks.done
hook and stats.compilation.emittedAssets
argument to determine emitted assets. To make sure that asset content has changed, I'm going to use contenthash.
I've read the webpack documentation, but I can't figure out how to get asset contenthash inside the plugin. Is this even possible? Does webpack calculates contenthash without additional tuning? Or do I have to calculate the asset hash on my own?