addFonts(compilation, callback) {
    try {
      const { assets, outputOptions } = compilation;
      const assetNames = assets && (Object.keys(assets) || []);
      const index = assets[this.options.index];
      const indexSource = index && index.source();
      const publicPath = outputOptions && outputOptions.publicPath;
      if (indexSource) {
        let strLink = "";
        assetNames.forEach((asset) => {
          if (this.isFontAsset(asset)) {
            strLink += this.getLinkTag(asset, publicPath);
          }
        });
        // If `replaceCallback` is specified then app is responsible to forming the updated
        // index.html by using the generated link string.
        if (this.options.replaceCallback) {
          assets[this.options.index] = new RawSource(
            this.options.replaceCallback({
              indexSource,
              linksAsString: strLink,
            })
          );
        } else {
          assets[this.options.index] = new RawSource(
            this.appendLinks(indexSource, strLink)
          );
        }
      }
    } catch (error) {
      return callback(error);
    }
    return callback();
  }
/**
   * Process the generated assets to add new <link> tags in the
   * generated html.
   *
   * @param {Object} compilation Compilation object from webpack hook
   * @param {Function} callback Callback to be invoked after processing
   *
   */
Process the generated assets to add new  tags in the
generated html.

@param {Object} compilation Compilation object from webpack hook
@param {Function} callback Callback to be invoked after processing
Process the generated assets to add new tags in the generated html . @param { Object } compilation Compilation object from webpack hook @param { Function } callback Callback to be invoked after processing
addFonts(compilation, callback) {
    try {
      const { assets, outputOptions } = compilation;
      const assetNames = assets && (Object.keys(assets) || []);
      const index = assets[this.options.index];
      const indexSource = index && index.source();
      const publicPath = outputOptions && outputOptions.publicPath;
      if (indexSource) {
        let strLink = "";
        assetNames.forEach((asset) => {
          if (this.isFontAsset(asset)) {
            strLink += this.getLinkTag(asset, publicPath);
          }
        });
        if (this.options.replaceCallback) {
          assets[this.options.index] = new RawSource(
            this.options.replaceCallback({
              indexSource,
              linksAsString: strLink,
            })
          );
        } else {
          assets[this.options.index] = new RawSource(
            this.appendLinks(indexSource, strLink)
          );
        }
      }
    } catch (error) {
      return callback(error);
    }
    return callback();
  }
addFonts ( compilation , callback ) { try { const { assets , outputOptions } = compilation ; const assetNames = assets && ( Object . keys ( assets ) || [ ] ) ; const index = assets [ this . options . index ] ; const indexSource = index && index . source ( ) ; const publicPath = outputOptions && outputOptions . publicPath ; if ( indexSource ) { let strLink = "" ; assetNames . forEach ( ( asset ) => { if ( this . isFontAsset ( asset ) ) { strLink += this . getLinkTag ( asset , publicPath ) ; } } ) ; if ( this . options . replaceCallback ) { assets [ this . options . index ] = new RawSource ( this . options . replaceCallback ( { indexSource , linksAsString : strLink , } ) ) ; } else { assets [ this . options . index ] = new RawSource ( this . appendLinks ( indexSource , strLink ) ) ; } } } catch ( error ) { return callback ( error ) ; } return callback ( ) ; }
Process the generated assets to add new <link> tags in the
 generated html.
Process the generated assets to add new <link > tags in the generated html .
// If `replaceCallback` is specified then app is responsible to forming the updated // index.html by using the generated link string.