This is very confusing as seen in #12974 or #12906. My suggestion would be "legacy."
var workerAMDName = "pdfjs-dist/build/pdf.worker";
  var workerOutputName = "pdf.worker.js";
  var workerFileConfig = createWebpackConfig(defines, {
    filename: workerOutputName,
    library: workerAMDName,
    libraryTarget: "umd",
    umdNamedDefine: true,
  });
  return gulp
    .src("./src/pdf.worker.js")
    .pipe(webpack2Stream(workerFileConfig))
    .pipe(replaceWebpackRequire())
    .pipe(replaceJSRootName(workerAMDName, "pdfjsWorker"));
}
function createWebBundle(defines) {
  var viewerOutputName = "viewer.js";
  var viewerFileConfig = createWebpackConfig(defines, {
    filename: viewerOutputName,
  });
  return gulp.src("./web/viewer.js").pipe(webpack2Stream(viewerFileConfig));
}
function createComponentsBundle(defines) {