executeTemplate(
    templateFunction,
    assetsInformationByGroups,
    assetTags,
    compilation,
  ) {
    // Template processing
    const templateParamsPromise = this.getTemplateParameters(
      compilation,
      assetsInformationByGroups,
      assetTags,
    );

    return templateParamsPromise.then((templateParams) => {
      try {
        // If html is a promise return the promise
        // If html is a string turn it into a promise
        return templateFunction(templateParams);
      } catch (e) {
        // @ts-ignore
        compilation.errors.push(new Error("Template execution failed: " + e));
        return Promise.reject(e);
      }
    });
  }
This function renders the actual html by executing the template function

@private
@param {(templateParameters) => string | Promise<string>} templateFunction
@param {AssetsInformationByGroups} assetsInformationByGroups
@param {{
       headTags: HtmlTagObject[],
       bodyTags: HtmlTagObject[]
     }} assetTags
@param {Compilation} compilation
@returns Promise<string>