function createLoaderScript(entries, legacyEntries, polyfills, polyfillsConfig, minified = true) {
  const code =
    '(function() {' +
    createLoadScriptFunction(entries, legacyEntries, polyfills) +
    createPolyfillsLoader(polyfills, polyfillsConfig) +
    createEntriesLoader(entries, legacyEntries, polyfills) +
    '})();';

  return minified ? Terser.minify(code).code : code;
}
Creates a loader script that executed immediately.

@param {EntriesConfig} entries
@param {EntriesConfig} legacyEntries
@param {import('@open-wc/building-utils/index-html/create-index-html').Polyfill[]} polyfills
@param {import('@open-wc/building-utils/index-html/create-index-html').PolyfillsConfig} polyfillsConfig