function createEntriesLoaderFunction(entries, legacyEntries) {
  if (!legacyEntries) {
    return `${entryLoaderCreators[entries.type](
      entries.files.map(cleanImportPath),
      entries.polyfillDynamicImport,
    )};`;
  }

  const load = entryLoaderCreators[entries.type](
    entries.files.map(cleanImportPath),
    entries.polyfillDynamicImport,
  );
  const loadLegacy = entryLoaderCreators[legacyEntries.type](
    legacyEntries.files.map(cleanImportPath),
  );
  return `'noModule' in HTMLScriptElement.prototype ? ${load} : ${loadLegacy};`;
}
@param {EntriesConfig} entries
@param {EntriesConfig} legacyEntries