function createPolyfillsLoader(polyfills, polyfillsConfig) {
  if (!polyfills) {
    return '';
  }

  let code = '  var polyfills = [];\n';

  polyfills.forEach(polyfill => {
    if (!polyfill.test) {
      return;
    }

    code += `  if (${polyfill.test}) { polyfills.push(loadScript('polyfills/${polyfillFilename(
      polyfill,
      polyfillsConfig,
    )}.js', ${Boolean(polyfill.module)})) }\n`;
  });

  return code;
}
@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