function tap(inst, hook, pluginName, async, callback) {
	if (inst.hooks) {
		const camel = hook.replace(/-([a-z])/g, (_s, i) => i.toUpperCase());
		inst.hooks[camel][async ? 'tapAsync' : 'tap'](pluginName, callback);
	} else {
		inst.plugin(hook, callback);
	}
}
Critters does not (yet) support `html-webpack-plugin` v5, so we vendor it.