lib/index.js
function addBannerToSourcemap (chunk, enc, next) {
      let pushed = false;

      if (banner) {
        // Get the sourcemap, once it exists
        let conv = convertSourcemap.fromSource(chunk.toString("utf8"));
        if (conv) {
          // Offset the sourcemap by the number of lines in the banner
          let offsetMap = offsetSourcemap(conv.toObject(), countLines(banner));
          this.push(new Buffer("\n" + convertSourcemap.fromObject(offsetMap).toComment() + "\n"));
          pushed = true;
        }
      }

      if (!pushed) {
        // This chunk doesn't contain anything for us to modify,
        // so just pass it along as-is
        this.push(chunk);
      }
      next();
    }
function addBannerToSourcemap (chunk, enc, next) {
      let pushed = false;

      if (banner) {
        // Get the sourcemap, once it exists
        let conv = convertSourcemap.fromSource(chunk.toString("utf8"));
        if (conv) {
          // Offset the sourcemap by the number of lines in the banner
          let offsetMap = offsetSourcemap(conv.toObject(), countLines(banner));
          this.push(new Buffer("\n" + convertSourcemap.fromObject(offsetMap).toComment() + "\n"));
          pushed = true;
        }
      }

      if (!pushed) {
        // This chunk doesn't contain anything for us to modify,
        // so just pass it along as-is
        this.push(chunk);
      }
      next();
    }
function addBannerToSourcemap ( chunk , enc , next ) { let pushed = false ; if ( banner ) { // Get the sourcemap, once it exists let conv = convertSourcemap . fromSource ( chunk . toString ( "utf8" ) ) ; if ( conv ) { // Offset the sourcemap by the number of lines in the banner let offsetMap = offsetSourcemap ( conv . toObject ( ) , countLines ( banner ) ) ; this . push ( new Buffer ( "\n" + convertSourcemap . fromObject ( offsetMap ) . toComment ( ) + "\n" ) ) ; pushed = true ; } } if ( ! pushed ) { // This chunk doesn't contain anything for us to modify, // so just pass it along as-is this . push ( chunk ) ; } next ( ) ; }
Adjusts the sourcemap to account for the banner comment block
Adjusts the sourcemap to account for the banner comment block