lib/transforms/html.injectRequireJsShim.js
function transform (opts) {
  var contents = opts.contents;
  var filePath = opts.filePath;
  var lastScript$;

  var $ = cheerio.load(contents);
  if (path.basename(filePath) === 'index.html') {
    lastScript$ = findLastScript($);
    if (lastScript$) {
      lastScript$.after('<script src="require.load.js"></script>');
    } else {
      $('body').append('<script src="require.load.js"></script>');
    }
  }
  return $.html();
}
function transform (opts) {
  var contents = opts.contents;
  var filePath = opts.filePath;
  var lastScript$;

  var $ = cheerio.load(contents);
  if (path.basename(filePath) === 'index.html') {
    lastScript$ = findLastScript($);
    if (lastScript$) {
      lastScript$.after('<script src="require.load.js"></script>');
    } else {
      $('body').append('<script src="require.load.js"></script>');
    }
  }
  return $.html();
}
function transform ( opts ) { var contents = opts . contents ; var filePath = opts . filePath ; var lastScript$ ; var $ = cheerio . load ( contents ) ; if ( path . basename ( filePath ) === 'index.html' ) { lastScript$ = findLastScript ( $ ) ; if ( lastScript$ ) { lastScript$ . after ( '<script src="require.load.js"></script>' ) ; } else { $ ( 'body' ) . append ( '<script src="require.load.js"></script>' ) ; } } return $ . html ( ) ; }
/*
interface StringTransformOptions {
contents: String,
fetcher: Fetcher,
filePath: String,
index: FetcherIndex
}
 transform (opts: StringTransformOptions) => String
/ * interface StringTransformOptions { contents : String fetcher : Fetcher filePath : String index : FetcherIndex } transform ( opts : StringTransformOptions ) = > String