This is very confusing as seen in #12974 or #12906. My suggestion would be "legacy."
return replace("__webpack_require__", "__w_pdfjs_require__");
}
function replaceJSRootName(amdName, jsName) {
  
  return replace(
    'root["' + amdName + '"] = factory()',
    'root["' + amdName + '"] = root.' + jsName + " = factory()"
  );
}
function createMainBundle(defines) {
  var mainAMDName = "pdfjs-dist/build/pdf";
  var mainOutputName = "pdf.js";
  var mainFileConfig = createWebpackConfig(defines, {
    filename: mainOutputName,
    library: mainAMDName,
    libraryTarget: "umd",
    umdNamedDefine: true,
  });
  return gulp
    .src("./src/pdf.js")
    .pipe(webpack2Stream(mainFileConfig))
    .pipe(replaceWebpackRequire())
    .pipe(replaceJSRootName(mainAMDName, "pdfjsLib"));
}
function createScriptingBundle(defines, extraOptions = undefined) {